/* =====================================================
   AutoMarketing 后台管理模块 - 公共样式
   风格：深紫渐变 + 玻璃拟态 + 科技感（参考 GEO 平台）
   ===================================================== */

:root {
    --primary: #667eea;
    --primary-dark: #764ba2;
    --primary-light: #a78bfa;
    --bg-page: #f0f2f8;
    --card-bg: rgba(255, 255, 255, 0.85);
    --text-main: #2d3436;
    --text-mute: #8a8f9c;
    --border: #e8eaf3;
    --green: #10b981;
    --red: #ef4444;
    --orange: #f59e0b;
    --radius: 16px;
    --shadow: 0 8px 30px rgba(31, 45, 90, 0.08);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC',
                 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background: var(--bg-page);
    color: var(--text-main);
    min-height: 100vh;
}

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

/* ---------- 按钮 ---------- */
.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 22px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all .25s;
    box-shadow: 0 6px 18px rgba(102, 126, 234, .3);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(102, 126, 234, .4); }
.btn-ghost {
    padding: 9px 18px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text-main);
    font-size: 14px;
    cursor: pointer;
    transition: all .2s;
}
.btn-ghost:hover { background: #f5f6fb; border-color: #cdd3ec; }
.btn-danger {
    padding: 6px 14px;
    background: transparent;
    border: 1px solid rgba(239, 68, 68, .4);
    border-radius: 8px;
    color: var(--red);
    font-size: 13px;
    cursor: pointer;
    transition: all .2s;
}
.btn-danger:hover { background: rgba(239, 68, 68, .08); }

/* ---------- 输入框 ---------- */
.form-input, .form-select {
    width: 100%;
    padding: 11px 14px;
    border: 2px solid var(--border);
    border-radius: 10px;
    font-size: 14px;
    background: #fff;
    transition: all .25s;
    outline: none;
    color: var(--text-main);
}
.form-input:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(102, 126, 234, .1);
}

/* ---------- 标签/徽章 ---------- */
.badge {
    display: inline-block;
    padding: 3px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}
.badge-active { background: rgba(16, 185, 129, .12); color: #059669; }
.badge-inactive { background: rgba(148, 155, 168, .14); color: #6b7280; }
.badge-disabled { background: rgba(239, 68, 68, .1); color: #dc2626; }
.badge-warning { background: rgba(245, 158, 11, .13); color: #d97706; }
.badge-info { background: rgba(102, 126, 234, .1); color: #5b6fd6; }

/* ---------- 统计卡片 ---------- */
.stat-card {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border-radius: var(--radius);
    padding: 22px;
    box-shadow: var(--shadow);
    border: 1px solid rgba(255, 255, 255, .6);
    transition: transform .25s, box-shadow .25s;
}
.stat-card:hover { transform: translateY(-4px); box-shadow: 0 14px 36px rgba(31, 45, 90, .12); }
.stat-card .stat-label { font-size: 13px; color: var(--text-mute); margin-bottom: 8px; }
.stat-card .stat-value { font-size: 30px; font-weight: 700; color: var(--text-main); }
.stat-card .stat-extra { font-size: 12px; color: var(--text-mute); margin-top: 6px; }
.stat-card .stat-icon {
    width: 44px; height: 44px;
    border-radius: 12px;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 22px; margin-bottom: 12px;
}
.icon-purple { background: rgba(102, 126, 234, .12); }
.icon-green { background: rgba(16, 185, 129, .12); }
.icon-blue { background: rgba(59, 130, 246, .12); }
.icon-orange { background: rgba(245, 158, 11, .12); }

/* ---------- 数据表格 ---------- */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
.data-table th {
    text-align: left;
    padding: 12px 14px;
    color: var(--text-mute);
    font-weight: 500;
    font-size: 13px;
    background: #f8f9fd;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
.data-table td {
    padding: 13px 14px;
    border-bottom: 1px solid #f0f1f7;
    color: var(--text-main);
}
.data-table tr:hover td { background: #fafbff; }
.data-table .empty-row td { text-align: center; color: #b0b4c0; padding: 46px 0; }

/* ---------- 卡片面板 ---------- */
.panel {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid rgba(255, 255, 255, .6);
    backdrop-filter: blur(10px);
}
.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 22px;
    border-bottom: 1px solid var(--border);
}
.panel-header h3 { font-size: 16px; font-weight: 600; }
.panel-body { padding: 22px; }

/* ---------- 弹窗 ---------- */
.modal-mask {
    position: fixed; inset: 0;
    background: rgba(20, 24, 45, .55);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center; justify-content: center;
    z-index: 999;
}
.modal-mask.show { display: flex; }
.modal-box {
    width: 440px;
    max-width: 92vw;
    max-height: 90vh;
    overflow-y: auto;
    background: #fff;
    border-radius: 18px;
    padding: 28px;
    box-shadow: 0 24px 70px rgba(15, 20, 45, .28);
    animation: modalIn .25s ease;
}
@keyframes modalIn {
    from { transform: translateY(18px) scale(.97); opacity: 0; }
    to { transform: translateY(0) scale(1); opacity: 1; }
}
.modal-box h3 { font-size: 18px; margin-bottom: 20px; }
.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 22px;
}

/* ---------- 分页 ---------- */
.pagination { display: flex; align-items: center; gap: 8px; justify-content: flex-end; padding: 14px 0 0; }
.pagination button {
    min-width: 34px; height: 34px;
    border: 1px solid var(--border);
    background: #fff;
    border-radius: 8px;
    font-size: 13px;
    cursor: pointer;
    color: var(--text-main);
    transition: all .2s;
}
.pagination button:hover:not(:disabled) { border-color: var(--primary); color: var(--primary); }
.pagination button.active { background: linear-gradient(135deg, #667eea, #764ba2); color: #fff; border-color: transparent; }
.pagination button:disabled { opacity: .4; cursor: not-allowed; }
.pagination .page-info { font-size: 13px; color: var(--text-mute); margin: 0 8px; }

/* ---------- 工具条 ---------- */
.toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 18px;
}
.toolbar .search-box {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* ---------- toast ---------- */
.toast {
    position: fixed;
    top: 26px;
    left: 50%;
    transform: translateX(-50%) translateY(-70px);
    padding: 12px 26px;
    border-radius: 12px;
    color: #fff;
    font-size: 14px;
    z-index: 9999;
    opacity: 0;
    transition: all .35s;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .18);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast-success { background: linear-gradient(135deg, #10b981, #059669); }
.toast-error { background: linear-gradient(135deg, #f43f5e, #e11d48); }
.toast-info { background: linear-gradient(135deg, #667eea, #764ba2); }