/**
 * Tiger Sys - Base CSS
 * CSS Variables and Reset Styles
 *
 * This file contains:
 * - CSS custom properties (variables) for theming
 * - CSS reset and normalization
 * - Base typography and body styles
 */

/* ========== Light Theme Variables ========== */
:root {
    /* Colors - Background (深灰护眼配色) */
    --color-bg: #d3d3d3;
    --color-surface: #e5e7eb;
    --color-surface-elevated: #f3f4f6;

    /* Colors - Text */
    --color-text: #374151;
    --color-text-dark: #1f2937;
    --color-text-heading: #111827;
    --color-text-secondary: #6b7280;
    --color-text-muted: #9ca3af;
    --color-text-inverted: #ffffff;

    /* Colors - Border */
    --color-border: #e5e7eb;
    --color-border-light: #f3f4f6;
    --color-border-focus: #3b82f6;

    /* Theme Colors - Primary */
    --color-primary: #3b82f6;
    --color-primary-hover: #2563eb;
    --color-primary-light: #eff6ff;
    --color-primary-dark: #1d4ed8;

    /* Theme Colors - Success */
    --color-success: #10b981;
    --color-success-hover: #059669;
    --color-success-light: #d1fae5;
    --color-success-dark: #047857;

    /* Theme Colors - Warning */
    --color-warning: #f59e0b;
    --color-warning-hover: #d97706;
    --color-warning-light: #fef3c7;
    --color-warning-dark: #b45309;

    /* Theme Colors - Danger */
    --color-danger: #ef4444;
    --color-danger-hover: #dc2626;
    --color-danger-light: #fee2e2;
    --color-danger-dark: #b91c1c;

    /* Theme Colors - Info */
    --color-info: #0891b2;
    --color-info-hover: #0e7490;
    --color-info-light: #cffafe;
    --color-info-dark: #155e75;

    /* Theme Colors - Secondary (Gray) */
    --color-secondary: #6b7280;
    --color-secondary-hover: #4b5563;
    --color-secondary-light: #f9fafb;
    --color-secondary-dark: #374151;

    /* Sizing - Border Radius */
    --radius-xs: 2px;
    --radius-sm: 4px;
    --radius-md: 6px;
    --radius-lg: 8px;
    --radius-xl: 12px;
    --radius-2xl: 16px;
    --radius-full: 9999px;

    /* Sizing - Spacing */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --space-6: 24px;
    --space-8: 32px;
    --space-10: 40px;

    /* Shadows */
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.1);
    --shadow-focus: 0 0 0 3px rgba(59, 130, 246, 0.1);

    /* Typography */
    --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --font-mono: 'Courier New', Consolas, monospace;

    --font-size-xs: 11px;
    --font-size-sm: 12px;
    --font-size-base: 14px;
    --font-size-md: 15px;
    --font-size-lg: 16px;
    --font-size-xl: 18px;
    --font-size-2xl: 20px;
    --font-size-3xl: 24px;
    --font-size-4xl: 28px;

    --font-weight-normal: 400;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;

    --line-height-tight: 1.25;
    --line-height-normal: 1.5;
    --line-height-relaxed: 1.75;

    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-base: 0.2s ease;
    --transition-slow: 0.3s ease;

    /* Z-Index Scale */
    --z-dropdown: 100;
    --z-sticky: 200;
    --z-fixed: 300;
    --z-modal-backdrop: 400;
    --z-modal: 500;
    --z-popover: 600;
    --z-tooltip: 700;
    --z-toast: 800;
}

/* ========== CSS Reset ========== */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Remove default list styles */
ul, ol {
    list-style: none;
}

/* Reset anchor styles */
a {
    text-decoration: none;
    color: inherit;
}

/* Reset button styles */
button {
    font-family: inherit;
    font-size: inherit;
    cursor: pointer;
    border: none;
    background: none;
}

/* Reset form element styles */
input, textarea, select {
    font-family: inherit;
    font-size: inherit;
}

/* Prevent text selection on interactive elements */
button, select {
    user-select: none;
}

/* Remove default table spacing */
table {
    border-collapse: collapse;
    border-spacing: 0;
}

/* ========== Base Styles ========== */
html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

/* ========== Typography Utilities ========== */
h1, h2, h3, h4, h5, h6 {
    font-weight: var(--font-weight-semibold);
    line-height: var(--line-height-tight);
    color: var(--color-text);
}

h1 { font-size: var(--font-size-3xl); }
h2 { font-size: var(--font-size-2xl); }
h3 { font-size: var(--font-size-xl); }
h4 { font-size: var(--font-size-lg); }
h5 { font-size: var(--font-size-md); }
h6 { font-size: var(--font-size-base); }

/* ========== Focus Styles ========== */
:focus {
    outline: none;
}

:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

/* ========== Scrollbar Styles ========== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--color-border-light);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb {
    background: var(--color-text-muted);
    border-radius: var(--radius-full);
}

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

/* ========== Selection Styles ========== */
::selection {
    background-color: var(--color-primary-light);
    color: var(--color-primary-dark);
}
/**
 * Tiger Sys - Components CSS
 * Common UI Component Styles
 *
 * This file contains reusable component styles extracted from:
 * - dashboard.html
 * - ad_monitor.html
 * - project_copy_list.html
 * - order_decision.html
 * - traffic_monitor.html
 *
 * Components included:
 * 1. Buttons (.btn-*)
 * 2. Page Header (.page-header-simple)
 * 3. Filter Bar (.filter-bar, .filter-group, .filter-input, .filter-select)
 * 4. Tables (.table-container, .data-table)
 * 5. Status Badges (.status-badge, .reason-badge-*)
 * 6. Modals (.modal, .modal-content, .modal-header, .modal-body)
 * 7. Loading Animation (@keyframes spin)
 */

/* ==========================================================================
   1. BUTTONS
   ========================================================================== */

/**
 * Base button styles
 * All buttons share these common properties
 */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-4);
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-medium);
    line-height: 1.5;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    transition: all var(--transition-base);
    white-space: nowrap;
    text-decoration: none;
}

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

/**
 * Button Variants
 */

/* Primary Button - Blue */
.btn-primary {
    background-color: var(--color-primary);
    color: var(--color-text-inverted);
}

.btn-primary:hover:not(:disabled) {
    background-color: var(--color-primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

/* Success Button - Green */
.btn-success {
    background-color: var(--color-success);
    color: var(--color-text-inverted);
}

.btn-success:hover:not(:disabled) {
    background-color: var(--color-success-hover);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

/* Warning Button - Orange/Yellow */
.btn-warning {
    background-color: var(--color-warning);
    color: var(--color-text-inverted);
}

.btn-warning:hover:not(:disabled) {
    background-color: var(--color-warning-hover);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
}

/* Danger Button - Red */
.btn-danger {
    background-color: var(--color-danger);
    color: var(--color-text-inverted);
}

.btn-danger:hover:not(:disabled) {
    background-color: var(--color-danger-hover);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
}

/* Secondary Button - Gray */
.btn-secondary {
    background-color: var(--color-secondary);
    color: var(--color-text-inverted);
}

.btn-secondary:hover:not(:disabled) {
    background-color: var(--color-secondary-hover);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(107, 114, 128, 0.3);
}

/* Outline Button - Transparent with border */
.btn-outline {
    background-color: transparent;
    color: var(--color-primary);
    border: 2px solid var(--color-primary);
}

.btn-outline:hover:not(:disabled) {
    background-color: var(--color-primary);
    color: var(--color-text-inverted);
}

/**
 * Button Sizes
 */
.btn-sm {
    padding: var(--space-1) var(--space-3);
    font-size: var(--font-size-sm);
}

.btn-lg {
    padding: var(--space-3) var(--space-6);
    font-size: var(--font-size-lg);
}

/**
 * Legacy Button Classes (backward compatibility)
 * These map to the new button system
 */
.btn-refresh {
    padding: 8px 16px;
    background: var(--color-primary);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-refresh:hover {
    background: var(--color-primary-hover);
}

.btn-refresh:disabled {
    background: var(--color-text-muted);
    cursor: not-allowed;
}

.btn-refresh i {
    margin-right: 4px;
}

.btn-search {
    padding: 10px 20px;
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 500;
    transition: all 0.2s;
}

.btn-search:hover {
    background: #2563eb;
    transform: translateY(-1px);
}

.btn-reset {
    padding: 10px 20px;
    background: var(--color-secondary);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 500;
    transition: all 0.2s;
}

.btn-reset:hover {
    background: #4b5563;
    transform: translateY(-1px);
}

/* ==========================================================================
   2. PAGE HEADER
   ========================================================================== */

/**
 * Simple page header with title and actions
 * Used in: dashboard, ad_monitor, project_copy_list, order_decision, traffic_monitor
 */
.page-header-simple {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-5);
    background: var(--color-surface);
    border-bottom: 2px solid var(--color-border);
    margin-bottom: var(--space-5);
    border-radius: var(--radius-lg);
}

.page-header-simple h1 {
    font-size: var(--font-size-3xl);
    color: var(--color-text);
    margin: 0;
    font-weight: var(--font-weight-semibold);
}

.page-header-simple .header-controls {
    display: flex;
    align-items: center;
    gap: var(--space-4);
}

.page-header-simple .update-time {
    color: var(--color-text-secondary);
    font-size: var(--font-size-base);
}

/* ==========================================================================
   3. FILTER BAR
   ========================================================================== */

/**
 * Filter/Search bar component
 * Used for filtering data in tables
 */
.filter-bar {
    background: var(--color-surface);
    border-radius: var(--radius-xl);
    padding: var(--space-5);
    margin-bottom: var(--space-5);
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-sm);
}

.filter-row {
    display: flex;
    gap: var(--space-4);
    flex-wrap: wrap;
    align-items: flex-end;
}

.filter-group {
    flex: 1;
    min-width: 200px;
}

.filter-group label {
    display: block;
    margin-bottom: var(--space-2);
    color: var(--color-text);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
}

.filter-input,
.filter-select {
    width: 100%;
    padding: 10px 12px;
    background: var(--color-surface);
    border: 2px solid var(--color-border);
    border-radius: var(--radius-md);
    color: var(--color-text);
    font-size: var(--font-size-base);
    transition: border-color var(--transition-base), box-shadow var(--transition-base);
}

.filter-input:focus,
.filter-select:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: var(--shadow-focus);
}

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

.filter-actions {
    display: flex;
    align-items: flex-end;
    gap: var(--space-3);
}

/* Input with clear button wrapper */
.input-wrapper,
.input-with-clear {
    position: relative;
    display: inline-block;
    width: 100%;
    flex: 1;
    max-width: 400px;
}

.clear-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--color-border);
    border: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    color: var(--color-text-secondary);
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.clear-btn:hover {
    background: #d1d5db;
    color: var(--color-text);
}

/* Search panel variant - unified with ad_monitor */
.search-panel {
    background: var(--color-surface);
    padding: 16px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid var(--color-border);
}

.search-panel h3 {
    margin: 0 0 var(--space-4) 0;
    color: var(--color-text);
    font-size: var(--font-size-lg);
}

.search-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}

/* Horizontal checkbox group */
.checkbox-group-inline {
    display: flex;
    gap: 15px;
    align-items: center;
    margin-left: 5px;
    margin-right: 5px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    color: #333;
    cursor: pointer;
    white-space: nowrap;
}

.checkbox-label input[type="checkbox"] {
    width: 15px;
    height: 15px;
    cursor: pointer;
    margin: 0;
}

/* Search input - larger padding for clear button */
.search-input {
    width: 100%;
    padding: 10px 36px 10px 14px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 15px;
    background: white;
    color: var(--color-text-dark);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.search-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

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

/* Date input */
.date-input {
    padding: 10px 14px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 15px;
    background: white;
    color: var(--color-text);
    min-width: 150px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.date-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.date-separator {
    color: var(--color-text-secondary);
    font-size: 14px;
}

/* ==========================================================================
   4. TABLES
   ========================================================================== */

/**
 * Table container and data table styles
 */
.table-container {
    background: var(--color-surface);
    border-radius: var(--radius-xl);
    overflow: hidden;
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-md);
}

.table-wrapper {
    background: var(--color-surface);
    border-radius: 8px;
    padding: 20px;
    border: 1px solid var(--color-border);
    overflow-x: auto;
}

.data-table,
.monitor-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table thead,
.monitor-table thead {
    background: var(--color-secondary-light);
    border-bottom: 2px solid var(--color-border);
}

.data-table th,
.monitor-table th {
    background: var(--color-secondary-light);
    padding: 12px;
    text-align: left;
    font-size: 16px;
    font-weight: 600;
    color: var(--color-text);
    border-bottom: 2px solid var(--color-border);
}

.data-table tbody tr,
.monitor-table tbody tr {
    border-bottom: 1px solid var(--color-border-light);
    transition: background-color var(--transition-fast);
}

.data-table tbody tr:hover,
.monitor-table tbody tr:hover {
    background: var(--color-secondary-light);
}

.data-table td,
.monitor-table td {
    padding: 12px;
    color: var(--color-text-dark);
    font-size: 18px;
    vertical-align: top;
}

/* Info cell styles - for combined info display in tables */
.info-cell {
    line-height: 1.6;
}

.info-name {
    font-weight: 600;
    color: var(--color-text-dark);
    margin-bottom: 4px;
}

.info-id {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ID text and copy icon styles */
.id-text {
    color: #3b82f6;
    font-family: 'SF Mono', 'Monaco', 'Courier New', monospace;
    font-size: 14px;
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 4px;
    transition: all 0.2s;
}

.id-text:hover {
    background: #eff6ff;
    color: #2563eb;
    text-decoration: underline;
}

.copy-icon {
    display: inline-block;
    font-size: 14px;
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 4px;
    opacity: 0.6;
    transition: all 0.2s;
    margin-left: 4px;
}

.copy-icon:hover {
    background: #eff6ff;
    opacity: 1;
    transform: scale(1.1);
}

.copy-icon.copied {
    opacity: 1;
}

/* ID copy combined style */
.id-copy {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #3b82f6;
    font-family: 'SF Mono', 'Monaco', 'Courier New', monospace;
    font-size: 14px;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    transition: all 0.2s;
}

.id-copy:hover {
    background: #eff6ff;
    color: #2563eb;
}

.id-copy.copied {
    color: #10b981;
    background: #d1fae5;
}

.id-copy .copy-icon {
    font-size: 12px;
    opacity: 0.7;
}

/* Clickable advertiser ID */
.advertiser-id {
    color: #3b82f6;
    cursor: pointer;
    text-decoration: underline;
    font-family: 'SF Mono', 'Monaco', 'Courier New', monospace;
}

.advertiser-id:hover {
    color: #2563eb;
}

/* Loading and error messages */
.loading-message,
.error-message {
    text-align: center;
    padding: 40px;
    color: var(--color-text-secondary);
    font-size: 14px;
}

.error-message {
    color: #dc2626;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--color-text-muted);
}

.empty-state i {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state p {
    font-size: 14px;
    margin: 0;
}

/* Editable cell styles */
.editable-cell {
    position: relative;
    cursor: pointer;
    padding: var(--space-2);
    border-radius: var(--radius-sm);
    transition: background-color var(--transition-fast);
}

.editable-cell:hover {
    background: var(--color-primary-light);
}

.non-editable-cell {
    padding: var(--space-2);
    color: var(--color-text-secondary);
    cursor: not-allowed;
}

/* ==========================================================================
   5. STATUS BADGES
   ========================================================================== */

/**
 * Status badges and reason badges
 */
.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    white-space: nowrap;
}

/* Status badge variants */
.status-success,
.status-badge.active {
    background-color: var(--color-success-light);
    color: var(--color-success-dark);
}

.status-failed,
.status-badge.inactive {
    background-color: var(--color-danger-light);
    color: var(--color-danger-dark);
}

.status-running {
    background-color: var(--color-info-light);
    color: var(--color-info-dark);
}

.status-pending {
    background-color: #e2e3e5;
    color: #383d41;
}

.status-partial {
    background-color: var(--color-warning-light);
    color: var(--color-warning-dark);
}

.status-api-error {
    color: var(--color-warning);
    font-weight: var(--font-weight-bold);
}

/**
 * Reason badges for decision/callback reasons
 */
.reason-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: var(--radius-sm);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-medium);
    margin-right: var(--space-1);
    margin-bottom: var(--space-1);
    white-space: nowrap;
}

.reason-badge-danger {
    background: var(--color-danger);
    color: white;
}

.reason-badge-success {
    background: var(--color-success);
    color: white;
}

.reason-badge-info {
    background: var(--color-info);
    color: white;
}

.reason-badge-warning {
    background: #ea580c;
    color: white;
}

.reason-badge-primary {
    background: var(--color-primary);
    color: white;
}

.reason-badge-layer {
    background: var(--color-secondary);
    color: white;
}

.reason-text {
    display: block;
    color: var(--color-text);
    font-size: var(--font-size-xs);
    margin-top: var(--space-1);
    line-height: var(--line-height-normal);
}

/* ==========================================================================
   6. MODALS
   ========================================================================== */

/**
 * Modal/Dialog component styles
 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: var(--z-modal);
    align-items: center;
    justify-content: center;
}

.modal.show {
    display: flex;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
    z-index: 1;
}

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

.modal-header h2 {
    margin: 0;
    color: var(--color-text);
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-semibold);
}

.modal-close {
    background: none;
    border: none;
    color: var(--color-text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    transition: color var(--transition-base), transform var(--transition-base);
    line-height: 1;
    padding: 0;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    color: var(--color-danger);
    transform: rotate(90deg);
}

.modal-body {
    padding: var(--space-5);
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: var(--space-3);
    padding: var(--space-5);
    border-top: 1px solid var(--color-border);
}

/* ==========================================================================
   7. LOADING ANIMATION
   ========================================================================== */

/**
 * Loading spinner animation
 */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid var(--color-border);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    vertical-align: middle;
}

.loading-spinner-lg {
    width: 24px;
    height: 24px;
    border-width: 3px;
}

.async-loading {
    text-align: center;
    vertical-align: middle;
    padding: var(--space-2);
    color: var(--color-text-secondary);
}

.async-error {
    color: var(--color-danger);
    font-size: var(--font-size-sm);
}

.async-value {
    color: var(--color-text);
    font-weight: var(--font-weight-medium);
}

.loading-message,
.error-message {
    text-align: center;
    padding: var(--space-8);
    font-size: var(--font-size-lg);
    color: var(--color-text-secondary);
}

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

/* ==========================================================================
   8. FORM COMPONENTS
   ========================================================================== */

/**
 * Form group and input styles
 */
.form-group {
    margin-bottom: var(--space-4);
}

.form-group label {
    display: block;
    margin-bottom: var(--space-2);
    color: var(--color-text);
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-medium);
}

.form-input,
.form-control {
    width: 100%;
    padding: 10px 12px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    color: var(--color-text);
    font-size: var(--font-size-base);
    transition: border-color var(--transition-base), box-shadow var(--transition-base);
}

.form-input:focus,
.form-control:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: var(--shadow-focus);
}

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

.form-hint {
    display: block;
    margin-top: var(--space-1);
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
}

.form-row {
    display: flex;
    gap: var(--space-4);
    margin-bottom: var(--space-4);
}

.form-actions {
    display: flex;
    gap: var(--space-3);
    margin-top: var(--space-4);
}

/* ==========================================================================
   9. STATISTICS CARDS
   ========================================================================== */

/**
 * Stats and summary card styles
 */
.stats-simple {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-5);
    margin-bottom: var(--space-5);
}

.stat-item {
    background: var(--color-surface);
    padding: var(--space-5);
    border-radius: var(--radius-lg);
    text-align: center;
    box-shadow: var(--shadow-sm);
}

.stat-label {
    display: block;
    color: var(--color-text-secondary);
    font-size: var(--font-size-base);
    margin-bottom: var(--space-2);
}

.stat-value {
    display: block;
    font-size: var(--font-size-4xl);
    font-weight: var(--font-weight-bold);
    color: var(--color-text);
}

.stat-value.success { color: var(--color-success); }
.stat-value.danger { color: var(--color-danger); }
.stat-value.warning { color: #ea580c; }
.stat-value.info { color: var(--color-info); }

/* Summary card with gradient background */
.summary-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: var(--radius-xl);
    padding: var(--space-5);
    margin: var(--space-4) 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    color: white;
}

.summary-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-4);
}

.summary-header h3 {
    margin: 0;
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-semibold);
    color: white;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: var(--space-3);
}

.summary-item {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-lg);
    padding: var(--space-3);
    text-align: center;
    transition: transform var(--transition-base), background var(--transition-base);
}

.summary-item:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.2);
}

.summary-item.primary {
    background: rgba(255, 255, 255, 0.25);
}

.summary-label {
    font-size: var(--font-size-sm);
    opacity: 0.9;
    margin-bottom: var(--space-2);
    font-weight: var(--font-weight-medium);
}

.summary-value {
    font-size: var(--font-size-2xl);
    font-weight: var(--font-weight-bold);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* ==========================================================================
   10. PAGINATION
   ========================================================================== */

/**
 * Pagination styles
 */
.pagination,
.pagination-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: var(--space-4);
    margin-top: var(--space-5);
    padding: var(--space-4);
}

.pagination-info {
    color: var(--color-text-secondary);
    font-size: var(--font-size-sm);
}

.pagination-controls {
    display: flex;
    gap: var(--space-2);
}

.page-btn,
.btn-pagination {
    padding: var(--space-2) var(--space-4);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    color: var(--color-text);
    cursor: pointer;
    transition: all var(--transition-base);
}

.page-btn:hover:not(:disabled),
.btn-pagination:hover:not(:disabled) {
    border-color: var(--color-primary);
    background: var(--color-primary-light);
}

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

.page-btn.active,
.page-num.active {
    background: var(--color-primary);
    color: white;
    border-color: var(--color-primary);
}

.page-num {
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-base);
}

.page-num:hover:not(.active) {
    background: var(--color-primary-light);
}

.page-dots {
    color: var(--color-text-secondary);
    padding: var(--space-2);
}

/* ==========================================================================
   11. UTILITY CLASSES
   ========================================================================== */

/**
 * Common utility classes
 */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.text-muted { color: var(--color-text-muted); }
.text-secondary { color: var(--color-text-secondary); }
.text-success { color: var(--color-success); }
.text-danger { color: var(--color-danger); }
.text-warning { color: var(--color-warning); }
.text-info { color: var(--color-info); }

.text-small { font-size: var(--font-size-sm); }
.text-large { font-size: var(--font-size-lg); }

.font-medium { font-weight: var(--font-weight-medium); }
.font-semibold { font-weight: var(--font-weight-semibold); }
.font-bold { font-weight: var(--font-weight-bold); }

.d-flex { display: flex; }
.d-inline-flex { display: inline-flex; }
.d-none { display: none; }
.d-block { display: block; }

.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.justify-end { justify-content: flex-end; }

.align-center { align-items: center; }
.align-start { align-items: flex-start; }
.align-end { align-items: flex-end; }

.gap-1 { gap: var(--space-1); }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }

.mb-0 { margin-bottom: 0; }
.mb-2 { margin-bottom: var(--space-2); }
.mb-3 { margin-bottom: var(--space-3); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-5 { margin-bottom: var(--space-5); }

.mt-0 { margin-top: 0; }
.mt-2 { margin-top: var(--space-2); }
.mt-3 { margin-top: var(--space-3); }
.mt-4 { margin-top: var(--space-4); }
.mt-5 { margin-top: var(--space-5); }

.py-2 { padding-top: var(--space-2); padding-bottom: var(--space-2); }
.py-4 { padding-top: var(--space-4); padding-bottom: var(--space-4); }

.px-2 { padding-left: var(--space-2); padding-right: var(--space-2); }
.px-4 { padding-left: var(--space-4); padding-right: var(--space-4); }

.rounded { border-radius: var(--radius-md); }
.rounded-lg { border-radius: var(--radius-lg); }

.shadow-sm { box-shadow: var(--shadow-sm); }
.shadow-md { box-shadow: var(--shadow-md); }

/* ==========================================================================
   12. PAGE HEADER (CENTERED)
   ========================================================================== */

/**
 * Centered page header with title and description
 * Used in: mixed_edit_monitor, video_analysis
 */
.page-header {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 2rem;
    margin-bottom: 2rem;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.page-header h1 {
    color: var(--color-text-dark);
    font-size: 2rem;
    margin: 0 0 0.5rem 0;
    font-weight: 700;
}

.page-header p {
    color: var(--color-text-secondary);
    font-size: 1rem;
    margin: 0;
}

/* ==========================================================================
   13. TABS
   ========================================================================== */

/**
 * Tab container and buttons
 * Used in: ad_monitor, mixed_edit_monitor, collect_cart_assist
 * Supports two structures:
 *   1. .tab-container > .tab-buttons > .tab-btn (with wrapper)
 *   2. .tab-container > .tab-btn (direct children)
 */
.tab-container {
    display: flex;
    gap: 0.5rem;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 0.375rem;
    margin-bottom: 1.5rem;
}

/* When using .tab-buttons wrapper, container becomes transparent */
.tab-container:has(.tab-buttons) {
    display: block;
    background: transparent;
    border: none;
    padding: 0;
}

.tab-buttons {
    display: flex;
    gap: 0.5rem;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 0.375rem;
}

.tab-btn {
    flex: 1;
    padding: 0.75rem 1rem;
    background: transparent;
    border: none;
    border-radius: var(--radius-md);
    color: var(--color-text-secondary);
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-medium);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.tab-btn:hover {
    background: var(--color-border-light);
    color: var(--color-primary);
}

.tab-btn.active {
    background: var(--color-primary-light);
    color: var(--color-primary);
    font-weight: var(--font-weight-semibold);
}

/**
 * Tab content panels
 * Controls visibility of tab content - only active tab is shown
 * Used in: ad_monitor, mixed_edit_monitor, collect_cart_assist
 */
.tab-content {
    display: none;
}

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

/* ==========================================================================
   14. STATISTICS GRID & CARDS
   ========================================================================== */

/**
 * Stats grid with icon cards
 * Used in: mixed_edit_monitor, dashboard, v5_monitor
 */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all 0.3s;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.stat-card:hover {
    border-color: #3b82f6;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
}

.stat-icon {
    font-size: 2rem;
    background: #eff6ff;
    border-radius: 50%;
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-icon.success { background: #d1fae5; }
.stat-icon.warning { background: #fef3c7; }
.stat-icon.danger { background: #fee2e2; }
.stat-icon.info { background: #dbeafe; }

.stat-content h3 {
    color: var(--color-text-secondary);
    margin: 0 0 0.25rem 0;
    font-size: 0.875rem;
    font-weight: 500;
}

.stat-content .stat-value {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--color-text-dark);
    display: block;
}

/* ==========================================================================
   15. CONTROLS BAR
   ========================================================================== */

/**
 * Controls bar with refresh button and status
 * Used in: mixed_edit_monitor, dashboard
 */
.controls-bar {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.controls-bar .last-update {
    color: var(--color-text-secondary);
    font-size: 0.875rem;
}

/* ==========================================================================
   16. METRIC BADGES
   ========================================================================== */

/**
 * Metric display badges
 * Used in: mixed_edit_monitor, order_decision, ad_monitor
 */
.metric-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
}

.metric-cost {
    background: #fef3c7;
    color: #d97706;
}

.metric-cpa {
    background: #d1fae5;
    color: #059669;
}

.metric-info {
    background: #dbeafe;
    color: #2563eb;
}

.metric-excellent {
    background: #f3e8ff;
    color: #9333ea;
}

.metric-danger {
    background: #fee2e2;
    color: #dc2626;
}

/* ==========================================================================
   17. CLICKABLE ELEMENTS
   ========================================================================== */

/**
 * Clickable IDs and links
 * Used in: mixed_edit_monitor, order_decision
 */
.clickable-id {
    cursor: pointer;
    color: #3b82f6;
    text-decoration: underline;
    transition: opacity 0.2s;
}

.clickable-id:hover {
    opacity: 0.7;
}

/* ==========================================================================
   18. EXPANDABLE ROWS
   ========================================================================== */

/**
 * Expandable table rows with nested content
 * Used in: mixed_edit_monitor, collect_cart_assist
 */
.expandable {
    user-select: none;
}

.expand-arrow {
    cursor: pointer;
    font-size: 0.75rem;
    transition: transform 0.3s;
    display: inline-block;
    margin-right: 5px;
    color: var(--color-text-secondary);
}

.expandable.expanded .expand-arrow {
    transform: rotate(90deg);
}

.nested-row {
    display: none;
    background: var(--color-secondary-light);
}

.nested-row.show {
    display: table-row;
}

.nested-content {
    padding: 1rem 1rem 1rem 2rem;
    font-size: 0.875rem;
    line-height: 1.6;
    color: var(--color-text);
    border-left: 3px solid #3b82f6;
    margin-left: 1rem;
}

/* ==========================================================================
   19. LOADING & ERROR STATES
   ========================================================================== */

/**
 * Loading and error display states
 */
.loading {
    text-align: center;
    padding: 3rem;
    color: var(--color-text-secondary);
    font-size: 1rem;
}

.error {
    background: #fee2e2;
    color: #dc2626;
    padding: 1rem;
    border-radius: 6px;
    margin: 1rem 0;
}

/* ==========================================================================
   20. SIDEBAR LAYOUT
   ========================================================================== */

/**
 * Sidebar layout for two-column pages
 * Used in: video_analysis
 */
.sidebar-layout {
    display: flex;
    height: calc(100vh - 60px);
    background: var(--color-bg);
}

.sidebar {
    width: 400px;
    background: var(--color-surface);
    border-right: 1px solid var(--color-border);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid var(--color-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.sidebar-header h2 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
}

.main-content {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
}

/* ==========================================================================
   21. FORM SECTION
   ========================================================================== */

/**
 * Form section with header
 */
.form-section {
    background: var(--color-secondary-light);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 1.25rem;
    margin-bottom: 1rem;
}

.form-section h3 {
    color: var(--color-text-heading);
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 0.75rem 0;
}

/* ==========================================================================
   22. BUTTON VARIANTS (UPDATED)
   ========================================================================== */

/**
 * Refresh button - Green style
 */
.btn-refresh,
.refresh-btn {
    padding: 0.5rem 1rem;
    background: #10b981;
    border: none;
    border-radius: 6px;
    color: white;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
}

.btn-refresh:hover,
.refresh-btn:hover {
    background: #059669;
}

.btn-refresh:disabled,
.refresh-btn:disabled {
    background: #9ca3af;
    cursor: not-allowed;
}

/**
 * New button - Glass style
 */
.btn-new {
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    backdrop-filter: blur(10px);
    transition: all 0.2s;
}

.btn-new:hover {
    background: rgba(255, 255, 255, 0.3);
}

/**
 * Copy button - Used for clipboard operations
 */
.btn-copy {
    padding: 0.5rem 1rem;
    background: #10b981;
    color: white;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-copy:hover {
    background: #059669;
}

/* ==========================================================================
   23. CARD STYLES
   ========================================================================== */

/**
 * Generic card component
 */
.card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.card-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--color-border);
    background: var(--color-secondary-light);
}

.card-header h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-text-heading);
}

.card-body {
    padding: 1.25rem;
}

.card-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--color-border);
    background: var(--color-secondary-light);
}
/* 淘宝浏览器弹窗样式 - 使用ID选择器提高优先级 */
#taobaoBrowserModal .taobao-browser-modal-content {
    max-width: 1000px;
    width: 95%;
    max-height: 90vh;
    border-radius: 12px;
    overflow: hidden;
}

/* ==================== 广告监测风格统一样式 ==================== */
/* 完全覆盖base.css的深色金色主题，改为浅色清爽主题 */

body {
    background: var(--color-bg);
    color: var(--color-text);
}

/* ==================== 导航栏样式 ==================== */
.navbar {
    background: white;
    border-bottom: 1px solid var(--color-border);
    padding: 0.75rem 0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    overflow-x: auto;
    max-width: 100vw;
}

.navbar-container {
    max-width: 100%;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: var(--color-text-heading);
    font-size: 1.5rem;
    font-weight: bold;
}

.logo-icon {
    font-size: 1.75rem;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: nowrap;
}

.nav-item {
    color: #4b5563;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    transition: all 0.2s;
    font-weight: 500;
    white-space: nowrap;
    font-size: 1rem;
    border: 1px solid transparent;
}

.nav-item:hover {
    background: var(--color-border-light);
    color: #3b82f6;
}

.nav-item.active {
    background: #eff6ff;
    color: #3b82f6;
    border-color: #bfdbfe;
    font-weight: 600;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: #4b5563;
    font-size: 0.875rem;
}

.logout-btn {
    color: #ef4444;
    text-decoration: none;
    padding: 0.375rem 0.75rem;
    border-radius: 6px;
    border: 1px solid #fecaca;
    background: #fef2f2;
    transition: all 0.2s;
    font-size: 0.875rem;
}

.logout-btn:hover {
    background: #fee2e2;
    border-color: #fca5a5;
}

.main-container {
    background: transparent;
}

/* 页面标题样式（简洁版） */
.page-header-simple {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    background: var(--color-surface);
    border-radius: 8px;
    margin-bottom: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.page-header-simple h1 {
    font-size: 1.8rem;
    font-weight: 600;
    color: var(--color-text-heading);
    margin: 0;
}

/* 过滤栏样式 - 覆盖深色主题 */
.filter-bar {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.filter-group label {
    color: var(--color-text);
    font-weight: 600;
    font-size: 0.875rem;
}

.filter-input,
.filter-select {
    background: white;
    border: 1px solid #d1d5db;
    color: var(--color-text);
    padding: 0.6rem;
    border-radius: 6px;
}

.filter-input:focus,
.filter-select:focus {
    border-color: #3b82f6;
    outline: none;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.clear-btn {
    color: var(--color-text-secondary);
}

.clear-btn:hover {
    color: #3b82f6;
}

/* 按钮样式 */
.btn-filter {
    background: #3b82f6;
    color: white;
    border: none;
    padding: 0.6rem 1.5rem;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-filter:hover {
    background: #2563eb;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.btn-add {
    background: #10b981;
    color: white;
    border: none;
    padding: 0.6rem 1.5rem;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.9rem;
}

.btn-add:hover {
    background: #059669;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

/* 表格容器 - 覆盖深色主题 */
.table-container {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    margin-bottom: 1.5rem;
}

/* 表格样式 */
.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table thead {
    background: var(--color-secondary-light);
    border-bottom: 2px solid var(--color-border);
}

.data-table th {
    padding: 0.875rem;
    text-align: left;
    color: var(--color-text);
    font-weight: 600;
    font-size: 0.8125rem;
    text-transform: none;
    letter-spacing: normal;
    border-bottom: 2px solid var(--color-border);
}

.data-table tbody tr {
    border-bottom: 1px solid var(--color-border);
    transition: background 0.2s;
}

.data-table tbody tr:hover {
    background: var(--color-secondary-light);
}

.data-table td {
    padding: 0.875rem;
    color: var(--color-text);
    font-size: 0.8125rem;
}

/* 可编辑单元格 */
.editable-cell {
    padding: 0.4rem 0.6rem;
    border: 1px solid transparent;
    border-radius: 4px;
    transition: all 0.2s;
    cursor: pointer;
    color: var(--color-text);
}

.editable-cell:hover {
    background: #eff6ff;
    border-color: #bfdbfe;
}

.editable-cell:focus {
    background: white;
    border-color: #3b82f6;
    outline: none;
}

.non-editable-cell {
    color: var(--color-text-secondary);
    cursor: default;
}

/* 状态标签 - 广告监测风格 */
.status-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
}

.status-badge.active {
    background: rgba(16, 185, 129, 0.1);
    color: #059669;
    border: 1px solid #10b981;
}

.status-badge.inactive {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
    border: 1px solid #ef4444;
}

.status-badge.clickable:hover {
    transform: scale(1.05);
}

/* 分页样式 */
.pagination {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 1rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.page-info {
    color: var(--color-text);
}

.page-btn {
    background: #3b82f6;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    text-decoration: none;
    border: none;
    font-weight: 500;
    transition: all 0.2s;
}

.page-btn:hover:not([disabled]) {
    background: #2563eb;
    transform: translateY(-1px);
}

.page-btn[disabled] {
    background: #9ca3af;
    cursor: not-allowed;
    opacity: 0.6;
}

.page-num {
    color: var(--color-text);
    padding: 0.5rem 0.8rem;
    border-radius: 6px;
    text-decoration: none;
}

.page-num:hover {
    background: var(--color-border-light);
    color: #3b82f6;
}

.page-num.active {
    background: #3b82f6;
    color: white;
    font-weight: 600;
}

/* 模态框样式 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal[style*="display: flex"],
.modal[style*="display:flex"] {
    display: flex;
}

.modal-content {
    background: var(--color-surface-elevated);
    border-radius: 8px;
    border: 1px solid var(--color-border);
    width: 90%;
    max-width: 500px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

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

.modal-header h2 {
    color: var(--color-text-heading);
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
}

.modal-close {
    font-size: 1.5rem;
    color: var(--color-text-secondary);
    cursor: pointer;
    transition: color 0.2s;
    background: none;
    border: none;
}

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

.modal-body {
    padding: 1.5rem;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    color: var(--color-text);
    margin-bottom: 0.5rem;
    font-weight: 600;
    font-size: 0.875rem;
}

.form-input {
    width: 100%;
    padding: 0.6rem;
    background: white;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    color: var(--color-text);
    transition: all 0.2s;
    font-size: 0.875rem;
}

.form-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Toast 提示样式 */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 12px 20px;
    border-radius: 6px;
    color: white;
    font-weight: 500;
    font-size: 14px;
    z-index: 10000;
    animation: slideIn 0.3s ease-out;
    box-shadow: 0 3px 10px rgba(0,0,0,0.2);
    min-width: 200px;
    max-width: 350px;
}

.toast.success {
    background: #4CAF50;
    border-left: 4px solid #2E7D32;
}

.toast.error {
    background: #f44336;
    border-left: 4px solid #C62828;
}

@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;
    }
}

/* ==================== 监控规则页面样式 ==================== */

/* 表格包装器 */
.table-wrapper {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    overflow-x: auto;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

/* monitor-table 样式 */
.monitor-table {
    width: 100%;
    border-collapse: collapse;
}

.monitor-table thead {
    background: var(--color-secondary-light);
}

.monitor-table th {
    padding: 0.875rem;
    text-align: left;
    color: var(--color-text);
    font-weight: 600;
    font-size: 0.8125rem;
    border-bottom: 2px solid var(--color-border);
}

.monitor-table tbody tr {
    border-bottom: 1px solid var(--color-border);
    transition: background 0.2s;
}

.monitor-table tbody tr:hover {
    background: var(--color-secondary-light);
}

.monitor-table td {
    padding: 0.875rem;
    color: var(--color-text);
    font-size: 0.875rem;
}

/* 按钮样式 */
.btn-refresh {
    background: #10b981;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-refresh:hover {
    background: #059669;
}

.btn-primary {
    background: #3b82f6;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary:hover {
    background: #2563eb;
}

.btn-secondary {
    background: var(--color-secondary);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-secondary:hover {
    background: #4b5563;
}

.btn-danger {
    background: #ef4444;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

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

/* 表单控件 */
.form-control {
    width: 100%;
    padding: 0.6rem;
    background: white;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    color: var(--color-text);
    font-size: 0.875rem;
    transition: all 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-section {
    background: var(--color-secondary-light);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 1.25rem;
    margin-bottom: 1rem;
}

.form-section h3 {
    color: var(--color-text-heading);
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 0.75rem 0;
}

/* 模态框底部 */
.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--color-border);
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    background: var(--color-secondary-light);
}

/* 加载消息 */
.loading-message {
    text-align: center;
    padding: 3rem;
    color: var(--color-text-secondary);
}

/* 预览区域 */
#preview {
    background: var(--color-secondary-light) !important;
    color: var(--color-text) !important;
    border: 1px solid var(--color-border);
}

/* ==================== 登录页面样式 ==================== */

.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 1rem;
}

.login-box {
    background: white;
    border-radius: 16px;
    padding: 3rem;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    text-align: center;
}

.tiger-logo {
    font-size: 4rem;
    margin-bottom: 0.5rem;
    animation: bounce 2s ease-in-out infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.login-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--color-text-heading);
    margin: 0 0 2rem 0;
    letter-spacing: 0.1em;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.login-form .form-group {
    text-align: left;
}

.login-form .form-group label {
    display: block;
    color: var(--color-text);
    font-weight: 600;
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

.login-form .form-input {
    width: 100%;
    padding: 0.875rem 1rem;
    background: var(--color-secondary-light);
    border: 2px solid var(--color-border);
    border-radius: 8px;
    color: var(--color-text-heading);
    font-size: 1rem;
    transition: all 0.2s;
    box-sizing: border-box;
}

.login-form .form-input:focus {
    outline: none;
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

.btn-login {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 0.5rem;
    letter-spacing: 0.2em;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3);
}

.btn-login:active {
    transform: translateY(0);
}
