/**
 * 美团外卖转链系统 - 管理后台样式
 * 现代玻璃拟态设计
 */

/* ==================== CSS变量定义 ==================== */
:root {
    --primary: #07c160;
    --primary-hover: #06ad56;
    --primary-light: #e8f8ed;
    --primary-dark: #059642;
    --primary-gradient: linear-gradient(135deg, #07c160 0%, #059642 100%);
    
    --success: #07c160;
    --warning: #ff9538;
    --danger: #ff4d4f;
    --info: #1890ff;
    
    --bg-page: #f0f2f5;
    --bg-card: #ffffff;
    --bg-sidebar: #1a1d29;
    --bg-sidebar-light: #252836;
    
    --text-primary: #1f1f2e;
    --text-secondary: #6b7280;
    --text-muted: #9ca3af;
    --text-white: #ffffff;
    
    --border-color: #e5e7eb;
    --border-light: #f3f4f6;
    
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --shadow-glow: 0 0 30px rgba(7, 193, 96, 0.25);
    
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;
    
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
    --spacing-2xl: 48px;
    
    --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --font-size-xs: 12px;
    --font-size-sm: 13px;
    --font-size-base: 14px;
    --font-size-md: 16px;
    --font-size-lg: 18px;
    --font-size-xl: 20px;
    --font-size-2xl: 24px;
    --font-size-3xl: 30px;
    
    --transition-fast: 0.15s ease;
    --transition-normal: 0.25s ease;
    --transition-slow: 0.4s ease;
    
    --sidebar-width: 260px;
    --header-height: 64px;
}

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

html {
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-page);
    min-height: 100vh;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--primary-hover);
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
    outline: none;
}

input, textarea, select {
    font-family: inherit;
    font-size: inherit;
    outline: none;
}

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

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ==================== 布局容器 ==================== */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* ==================== 侧边栏 ==================== */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--bg-sidebar);
    color: var(--text-white);
    z-index: 100;
    display: flex;
    flex-direction: column;
    transition: transform var(--transition-normal);
}

.sidebar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 280px;
    background: linear-gradient(180deg, rgba(7, 193, 96, 0.15) 0%, transparent 100%);
    pointer-events: none;
}

.sidebar-logo {
    height: var(--header-height);
    display: flex;
    align-items: center;
    padding: 0 var(--spacing-lg);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    position: relative;
    z-index: 1;
    gap: var(--spacing-md);
}

.sidebar-logo .logo-icon {
    width: 40px;
    height: 40px;
    background: var(--primary-gradient);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: #fff;
    box-shadow: var(--shadow-glow);
    overflow: hidden;
}

.sidebar-logo .logo-img {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    object-fit: contain;
}

.sidebar-logo span {
    font-size: var(--font-size-md);
    font-weight: 600;
    color: var(--text-white);
}

.sidebar-nav {
    flex: 1;
    padding: var(--spacing-md);
    overflow-y: auto;
    position: relative;
    z-index: 1;
}

.nav-section {
    padding: var(--spacing-sm) var(--spacing-md);
    font-size: var(--font-size-xs);
    color: rgba(255, 255, 255, 0.4);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: var(--spacing-md);
    font-weight: 500;
}

.nav-section:first-child {
    margin-top: 0;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 12px var(--spacing-md);
    color: rgba(255, 255, 255, 0.7);
    transition: all var(--transition-fast);
    cursor: pointer;
    border-radius: var(--radius-md);
    margin-bottom: 4px;
    gap: var(--spacing-md);
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-white);
}

.nav-item.active {
    background: var(--primary-gradient);
    color: var(--text-white);
    box-shadow: var(--shadow-glow);
}

.nav-item i {
    font-size: 18px;
    width: 20px;
    text-align: center;
}

.nav-item span {
    font-size: var(--font-size-sm);
    font-weight: 500;
}

/* 侧边栏底部 */
.sidebar-footer {
    padding: var(--spacing-md);
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    position: relative;
    z-index: 1;
}

.sidebar-footer .system-info {
    font-size: var(--font-size-xs);
    color: rgba(255, 255, 255, 0.4);
    text-align: center;
    margin-top: 12px;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.footer-btn {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.7);
    border-radius: var(--radius-sm);
    font-size: 12px;
    transition: all 0.2s;
    text-decoration: none;
    white-space: nowrap;
}

.footer-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}

/* ==================== 遮罩层 ==================== */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99;
}

.sidebar-overlay.show {
    display: block;
}

/* ==================== 主内容区 ==================== */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ==================== 顶部导航 ==================== */
.header {
    height: var(--header-height);
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--spacing-lg);
    position: sticky;
    top: 0;
    z-index: 50;
}

.header-left {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.header-left h1 {
    font-size: var(--font-size-lg);
    font-weight: 600;
    color: var(--text-primary);
}

.header-right {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

/* ==================== 内容区 ==================== */
.content {
    flex: 1;
    padding: var(--spacing-lg);
    max-width: 1400px;
}

/* ==================== 卡片 ==================== */
.settings-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    margin-bottom: var(--spacing-lg);
    overflow: hidden;
    border: 1px solid var(--border-light);
}

.settings-header {
    padding: var(--spacing-lg);
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.settings-header i {
    font-size: 20px;
    color: var(--primary);
}

.settings-header h3 {
    font-size: var(--font-size-md);
    font-weight: 600;
    color: var(--text-primary);
}

.settings-body {
    padding: var(--spacing-lg);
}

/* ==================== 页面标题区 ==================== */
.page-hero {
    background: var(--primary-gradient);
    color: white;
    padding: 32px 40px;
    border-radius: var(--radius-lg);
    margin-bottom: var(--spacing-lg);
    position: relative;
    overflow: hidden;
}

.page-hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 300px;
    height: 300px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
}

.page-hero h1 {
    font-size: 24px;
    margin-bottom: 8px;
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
}

.page-hero h1 i {
    font-size: 28px;
}

.page-hero p {
    opacity: 0.9;
    font-size: 14px;
    position: relative;
}

.page-hero .quick-links {
    margin-top: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    position: relative;
}

.page-hero .quick-links a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border-radius: var(--radius-md);
    font-size: 13px;
    transition: all 0.2s;
    text-decoration: none;
}

.page-hero .quick-links a:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

/* page-hero 颜色变体 */
.page-hero.info {
    background: linear-gradient(135deg, #1890ff 0%, #096dd9 100%);
}

.page-hero.warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.page-hero.purple {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* ==================== 统计卡片网格 ==================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
}

.stat-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-light);
    transition: all 0.3s;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
}

.stat-icon.primary {
    background: linear-gradient(135deg, #07c160 0%, #059642 100%);
    color: #fff;
}

.stat-icon.success {
    background: linear-gradient(135deg, #52c41a 0%, #389e0d 100%);
    color: #fff;
}

.stat-icon.info {
    background: linear-gradient(135deg, #1890ff 0%, #096dd9 100%);
    color: #fff;
}

.stat-icon.warning {
    background: linear-gradient(135deg, #faad14 0%, #d48806 100%);
    color: #fff;
}

.stat-info {
    flex: 1;
    min-width: 0;
}

.stat-label {
    font-size: var(--font-size-sm);
    color: var(--text-muted);
    margin-bottom: 4px;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.stat-trend {
    font-size: var(--font-size-xs);
    color: var(--text-muted);
    margin-top: 4px;
}

.stat-trend.up {
    color: var(--success);
}

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

.table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.table th,
.table td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-light);
}

.table th {
    background: var(--bg-page);
    font-weight: 600;
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    white-space: nowrap;
}

.table td {
    font-size: var(--font-size-sm);
    color: var(--text-primary);
}

/* 表格列宽设置 */
.table th:nth-child(1),
.table td:nth-child(1) {
    width: 70px;
    text-align: center;
}

.table th:nth-child(2),
.table td:nth-child(2) {
    width: 180px;
}

.table th:nth-child(3),
.table td:nth-child(3) {
    min-width: 300px;
}

.table th:nth-child(4),
.table td:nth-child(4) {
    width: 80px;
    text-align: center;
}

.table th:nth-child(5),
.table td:nth-child(5) {
    width: 160px;
}

.table tbody tr:hover {
    background: var(--bg-page);
}

.table tbody tr:last-child td {
    border-bottom: none;
}

/* 回复内容列样式 */
.table .reply-content {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
    word-break: break-word;
}

/* ==================== 日志表格 ==================== */
.logs-table {
    table-layout: auto;
    min-width: 800px;
}

.logs-table th,
.logs-table td {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: middle;
}

/* ID列 - 固定宽度，居中 */
.logs-table th:nth-child(1),
.logs-table td:nth-child(1) {
    width: 50px;
    min-width: 50px;
    text-align: center;
    flex-shrink: 0;
}

/* 时间列 - 固定宽度 */
.logs-table th:nth-child(2),
.logs-table td:nth-child(2) {
    width: 130px;
    min-width: 130px;
    flex-shrink: 0;
}

/* 类型列 - badge自适应 */
.logs-table th:nth-child(3),
.logs-table td:nth-child(3) {
    width: 70px;
    min-width: 70px;
    text-align: center;
    flex-shrink: 0;
}

/* 用户列 - openid截断 */
.logs-table th:nth-child(4),
.logs-table td:nth-child(4) {
    width: 110px;
    min-width: 80px;
    max-width: 140px;
    flex-shrink: 0;
}

.logs-table td:nth-child(4) {
    font-size: 12px;
    color: var(--text-muted);
}

/* 内容列 - 最宽，占据剩余空间 */
.logs-table th:nth-child(5),
.logs-table td:nth-child(5) {
    min-width: 150px;
    max-width: none;
    white-space: normal;
    word-break: break-all;
    flex-grow: 1;
}

/* 店铺列 - poi名称 */
.logs-table th:nth-child(6),
.logs-table td:nth-child(6) {
    width: 100px;
    min-width: 80px;
    max-width: 150px;
    flex-shrink: 0;
}

/* 状态列 - 固定宽度 */
.logs-table th:nth-child(7),
.logs-table td:nth-child(7) {
    width: 60px;
    min-width: 60px;
    text-align: center;
    flex-shrink: 0;
}

/* ==================== 表单 ==================== */
.form-group {
    margin-bottom: var(--spacing-lg);
}

.form-label {
    display: block;
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: var(--spacing-sm);
}

.form-hint {
    font-size: var(--font-size-xs);
    color: var(--text-muted);
    margin-top: 6px;
}

.form-input {
    width: 100%;
    height: 44px;
    padding: 0 var(--spacing-md);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-page);
    color: var(--text-primary);
    transition: all var(--transition-fast);
}

.form-input:focus {
    border-color: var(--primary);
    background: var(--bg-card);
    box-shadow: 0 0 0 3px rgba(7, 193, 96, 0.1);
}

.form-textarea {
    height: auto;
    min-height: 120px;
    padding: var(--spacing-md);
    resize: vertical;
    line-height: 1.6;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-lg);
}

.form-row-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--spacing-lg);
}

/* ==================== 开关 ==================== */
.switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 26px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.switch-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.3s;
    border-radius: 26px;
}

.switch-slider::before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
    box-shadow: var(--shadow-sm);
}

.switch input:checked + .switch-slider {
    background: var(--primary);
}

.switch input:checked + .switch-slider::before {
    transform: translateX(22px);
}

/* ==================== 按钮 ==================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 40px;
    padding: 0 20px;
    font-size: var(--font-size-sm);
    font-weight: 500;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    cursor: pointer;
    border: none;
    white-space: nowrap;
}

.btn-primary {
    background: var(--primary-gradient);
    color: #fff;
    box-shadow: 0 2px 8px rgba(7, 193, 96, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(7, 193, 96, 0.4);
}

.btn-default {
    background: var(--bg-page);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-default:hover {
    background: var(--border-light);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
}

.btn-ghost:hover {
    background: var(--bg-page);
    color: var(--text-primary);
}

.btn-danger {
    background: #fff1f0;
    color: var(--danger);
    border: 1px solid #ffccc7;
}

.btn-danger:hover {
    background: #ff4d4f;
    color: #fff;
}

.btn-sm {
    height: 32px;
    padding: 0 12px;
    font-size: var(--font-size-xs);
}

.btn-lg {
    height: 48px;
    padding: 0 28px;
    font-size: var(--font-size-md);
}

/* ==================== 徽章 ==================== */
.badge {
    display: inline-flex;
    align-items: center;
    height: 24px;
    padding: 0 10px;
    font-size: var(--font-size-xs);
    font-weight: 500;
    border-radius: var(--radius-full);
    white-space: nowrap;
}

.badge-success {
    background: #f6ffed;
    color: #52c41a;
    border: 1px solid #b7eb8f;
}

.badge-danger {
    background: #fff1f0;
    color: #ff4d4f;
    border: 1px solid #ffccc7;
}

.badge-info {
    background: #e6f7ff;
    color: #1890ff;
    border: 1px solid #91d5ff;
}

.badge-warning {
    background: #fffbe6;
    color: #faad14;
    border: 1px solid #ffe58f;
}

.tag {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    background: var(--bg-page);
    color: var(--text-muted);
    border-radius: var(--radius-sm);
    font-size: var(--font-size-xs);
}

/* ==================== 提示框 ==================== */
.alert {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 18px;
    border-radius: var(--radius-md);
    margin-bottom: var(--spacing-lg);
    font-size: var(--font-size-sm);
}

.alert i {
    font-size: 18px;
    flex-shrink: 0;
    margin-top: 1px;
}

.alert-success {
    background: #f6ffed;
    color: #52c41a;
    border: 1px solid #b7eb8f;
}

.alert-danger {
    background: #fff1f0;
    color: #ff4d4f;
    border: 1px solid #ffccc7;
}

.alert-warning {
    background: #fffbe6;
    color: #faad14;
    border: 1px solid #ffe58f;
}

.alert-info {
    background: #e6f7ff;
    color: #1890ff;
    border: 1px solid #91d5ff;
}

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

.empty-state i {
    font-size: 64px;
    color: var(--border-color);
    margin-bottom: 16px;
}

.empty-state h3 {
    font-size: var(--font-size-md);
    color: var(--text-primary);
    margin-bottom: 8px;
}

.empty-state p {
    font-size: var(--font-size-sm);
    color: var(--text-muted);
}

/* ==================== 操作栏 ==================== */
.action-bar {
    display: flex;
    justify-content: center;
    gap: var(--spacing-md);
    padding-top: var(--spacing-lg);
    margin-top: var(--spacing-lg);
    border-top: 1px solid var(--border-light);
}

/* ==================== 卡片组件 ==================== */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    border: 1px solid var(--border-light);
}

.card-header {
    padding: var(--spacing-lg);
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-header h2 {
    font-size: var(--font-size-md);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-header h2 i {
    color: var(--primary);
}

.card-body {
    padding: var(--spacing-lg);
}

.card-footer {
    padding: var(--spacing-md) var(--spacing-lg);
    border-top: 1px solid var(--border-light);
    background: var(--bg-page);
}

/* ==================== 分页 ==================== */
.pagination {
    display: flex;
    align-items: center;
    gap: 4px;
}

.pagination-item {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 8px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: var(--font-size-sm);
    color: var(--text-primary);
    transition: all var(--transition-fast);
}

.pagination-item:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.pagination-item.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

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

/* ==================== Toast提示 ==================== */
.toast-container {
    position: fixed;
    top: 80px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 20px;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    min-width: 280px;
    animation: slideIn 0.3s ease;
}

.toast-icon {
    font-size: 18px;
}

.toast-success .toast-icon { color: var(--success); }
.toast-error .toast-icon { color: var(--danger); }
.toast-warning .toast-icon { color: var(--warning); }
.toast-info .toast-icon { color: var(--info); }

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* ==================== 加载状态 ==================== */
.page-loading {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    flex-direction: column;
    gap: 16px;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* ==================== Modal对话框 ==================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-overlay.show {
    display: flex;
}

.modal {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    width: 480px;
    max-width: 95%;
    box-shadow: var(--shadow-xl);
    animation: modalIn 0.3s ease;
}

@keyframes modalIn {
    from {
        transform: scale(0.9);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.modal-header {
    padding: var(--spacing-lg);
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h3 {
    font-size: var(--font-size-md);
    font-weight: 600;
}

.modal-close {
    cursor: pointer;
    color: var(--text-muted);
    font-size: 20px;
}

.modal-close:hover {
    color: var(--text-primary);
}

.modal-body {
    padding: var(--spacing-lg);
}

.modal-footer {
    padding: var(--spacing-lg);
    border-top: 1px solid var(--border-light);
    display: flex;
    justify-content: flex-end;
    gap: var(--spacing-sm);
}

/* ==================== 变量标签 ==================== */
.variable-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.var-tag {
    display: inline-flex;
    padding: 2px 8px;
    background: var(--bg-page);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: var(--font-size-xs);
    font-family: monospace;
    color: var(--text-secondary);
}

/* ==================== 配置项 ==================== */
.config-item {
    margin-bottom: var(--spacing-lg);
    padding-bottom: var(--spacing-lg);
    border-bottom: 1px solid var(--border-light);
}

.config-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.section-title {
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--text-primary);
    margin: var(--spacing-lg) 0 var(--spacing-md);
    padding-bottom: var(--spacing-sm);
    border-bottom: 2px solid var(--primary);
    display: inline-block;
}

.section-title:first-child {
    margin-top: 0;
}

/* ==================== 快捷操作 ==================== */
.quick-actions {
    display: flex;
    gap: var(--spacing-md);
}

/* ==================== 项目链接 ==================== */
.project-links {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

.project-links a {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 24px;
    background: var(--bg-page);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
    text-decoration: none;
}

.project-links a:hover {
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-2px);
}

.project-links a i {
    font-size: 18px;
    color: var(--primary);
}

/* ==================== 移动端菜单按钮 ==================== */
.mobile-menu-btn {
    display: none;
}

/* ==================== 响应式 ==================== */
@media (max-width: 1200px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 1024px) {
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .form-row-3 {
        grid-template-columns: 1fr;
    }
    
    .table .reply-content {
        max-width: 300px;
    }
}

@media (max-width: 768px) {
    /* 侧边栏 */
    .sidebar {
        transform: translateX(-100%);
        z-index: 200;
        width: 280px;
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .mobile-menu-btn {
        display: flex;
    }
    
    /* 统计卡片 */
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .stat-card {
        padding: 16px;
        gap: 16px;
    }
    
    .stat-icon {
        width: 48px;
        height: 48px;
        font-size: 20px;
    }
    
    .stat-value {
        font-size: 22px;
    }
    
    /* 内容区 */
    .content {
        padding: 12px;
    }
    
    /* 页面标题区 */
    .page-hero {
        padding: 20px;
        border-radius: 12px;
        margin-bottom: 16px;
    }
    
    .page-hero h1 {
        font-size: 18px;
    }
    
    .page-hero p {
        font-size: 13px;
    }
    
    .page-hero .quick-links {
        gap: 8px;
        margin-top: 12px;
    }
    
    .page-hero .quick-links a {
        padding: 8px 12px;
        font-size: 12px;
        flex: 1 1 calc(50% - 4px);
        justify-content: center;
    }
    
    /* 卡片 */
    .settings-card {
        margin-bottom: 12px;
        border-radius: 12px;
    }
    
    .settings-header {
        padding: 14px 16px;
        flex-wrap: wrap;
    }
    
    .settings-header h3 {
        font-size: 15px;
    }
    
    .settings-body {
        padding: 16px;
    }
    
    /* 快速链接 */
    .settings-body .quick-links {
        display: flex !important;
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .settings-body .quick-links a {
        flex: 1 1 calc(50% - 4px);
        min-width: 0;
        justify-content: center;
        padding: 10px 12px;
        font-size: 13px;
    }
    
    /* 项目链接 - 手机端2列 */
    .project-links {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .project-links a {
        justify-content: center;
        padding: 12px 16px;
        font-size: 13px;
    }
    
    /* 表单 */
    .form-group {
        margin-bottom: 14px;
    }
    
    .form-input {
        height: 44px;
        font-size: 14px;
    }
    
    .form-textarea {
        min-height: 100px;
    }
    
    .form-label {
        font-size: 14px;
        margin-bottom: 6px;
    }
    
    /* 表格 */
    .table-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
    }
    
    .table {
        font-size: 13px;
        table-layout: auto;
    }
    
    .table th, 
    .table td {
        padding: 12px 10px;
    }
    
    /* 手机端：日志表格横屏滚动 */
    .table-wrapper.logs-scroll {
        overflow-x: auto;
        overflow-y: hidden;
        max-width: 100%;
    }
    
    .logs-table {
        min-width: 700px;
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
    
    .logs-table thead,
    .logs-table tbody,
    .logs-table tr,
    .logs-table th,
    .logs-table td {
        display: inline-block;
        vertical-align: middle;
    }
    
    /* 手机端日志表格列宽优化 */
    .logs-table th:nth-child(1),
    .logs-table td:nth-child(1) { width: 40px; min-width: 40px; }
    .logs-table th:nth-child(2),
    .logs-table td:nth-child(2) { width: 110px; min-width: 110px; }
    .logs-table th:nth-child(3),
    .logs-table td:nth-child(3) { width: 60px; min-width: 60px; }
    .logs-table th:nth-child(4),
    .logs-table td:nth-child(4) { width: 100px; min-width: 80px; }
    .logs-table th:nth-child(5),
    .logs-table td:nth-child(5) { width: 250px; min-width: 150px; }
    .logs-table th:nth-child(6),
    .logs-table td:nth-child(6) { width: 80px; min-width: 70px; }
    .logs-table th:nth-child(7),
    .logs-table td:nth-child(7) { width: 50px; min-width: 50px; }
    
    .table .reply-content {
        max-width: none;
    }
    
    /* 按钮 */
    .btn {
        height: 38px;
        padding: 0 14px;
        font-size: 13px;
    }
    
    .btn-sm {
        height: 32px;
        padding: 0 10px;
        font-size: 12px;
    }
    
    .btn-lg {
        height: 44px;
    }
    
    /* 标签徽章 */
    .badge {
        height: 22px;
        padding: 0 8px;
        font-size: 11px;
    }
    
    /* 提示框 */
    .alert {
        padding: 12px 14px;
        font-size: 13px;
        border-radius: 8px;
    }
    
    /* 操作栏 */
    .action-bar {
        flex-direction: column;
        gap: 10px;
    }
    
    .action-bar .btn {
        width: 100%;
    }
    
    /* 开关 */
    .switch {
        width: 44px;
        height: 24px;
    }
    
    .switch-slider::before {
        width: 20px;
        height: 20px;
    }
    
    .switch input:checked + .switch-slider::before {
        transform: translateX(20px);
    }
    
    /* 头部 */
    .header {
        padding: 0 12px;
        height: 56px;
    }
    
    .header-left h1 {
        font-size: 16px;
    }
    
    .header-right .btn {
        padding: 0 10px;
        font-size: 12px;
    }
    
    /* Toast */
    .toast-container {
        left: 12px;
        right: 12px;
        top: 12px;
    }
    
    .toast {
        min-width: auto;
        width: 100%;
        border-radius: 8px;
    }
    
    /* 分页 */
    .pagination {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    /* 侧边栏导航 */
    .nav-item {
        padding: 14px 16px;
    }
    
    .nav-item span {
        font-size: 14px;
    }
    
    /* 空状态 */
    .empty-state {
        padding: 40px 16px;
    }
    
    .empty-state i {
        font-size: 48px;
    }
    
    .empty-state h3 {
        font-size: 15px;
    }
    
    /* Modal */
    .modal {
        width: 95%;
        max-width: none;
        margin: 16px;
        border-radius: 16px;
    }
    
    .modal-header {
        padding: 16px;
    }
    
    .modal-body {
        padding: 16px;
    }
    
    .modal-footer {
        padding: 16px;
        flex-direction: column;
    }
    
    .modal-footer .btn {
        width: 100%;
    }
    
    /* 卡片表格切换 */
    .desktop-table {
        display: none;
    }
    
    .mobile-cards {
        display: flex !important;
    }
}

/* 超小屏幕 */
@media (max-width: 480px) {
    .content {
        padding: 8px;
    }
    
    .page-hero {
        padding: 16px;
    }
    
    .page-hero h1 {
        font-size: 16px;
    }
    
    .page-hero h1 i {
        font-size: 20px;
    }
    
    .settings-header {
        padding: 12px;
    }
    
    .settings-body {
        padding: 12px;
    }
    
    .table th, .table td {
        padding: 10px 8px;
        font-size: 12px;
    }
    
    .stat-card {
        padding: 12px;
    }
    
    .stat-icon {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }
    
    .stat-value {
        font-size: 20px;
    }
    
    /* 超小屏幕header按钮只显示图标 */
    .header-right .btn span {
        display: none;
    }
    
    /* 底部链接手机端 */
    .footer-links {
        gap: 6px;
    }
    
    .footer-btn {
        padding: 5px 10px;
        font-size: 11px;
    }
    
    /* 项目链接 - 超小屏幕保持2列 */
    .project-links {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    
    .project-links a {
        padding: 10px 12px;
        font-size: 12px;
        gap: 6px;
    }
    
    .project-links a i {
        font-size: 16px;
    }
}

/* ==================== 工具类 ==================== */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }
.text-muted { color: var(--text-muted); }
.text-primary { color: var(--primary); }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.mt-sm { margin-top: var(--spacing-sm); }
.mt-md { margin-top: var(--spacing-md); }
.mt-lg { margin-top: var(--spacing-lg); }
.mb-sm { margin-bottom: var(--spacing-sm); }
.mb-md { margin-bottom: var(--spacing-md); }
.mb-lg { margin-bottom: var(--spacing-lg); }
