/* ===================================
   SEO 任務協作系統 - Design System
   =================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Noto+Sans+TC:wght@300;400;500;600;700&display=swap');

:root {
    /* Color System */
    --primary-50: #eef2ff;
    --primary-100: #e0e7ff;
    --primary-200: #c7d2fe;
    --primary-300: #a5b4fc;
    --primary-400: #818cf8;
    --primary-500: #6366f1;
    --primary-600: #4f46e5;
    --primary-700: #4338ca;
    --primary-800: #3730a3;
    --primary-900: #312e81;

    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;

    --success-50: #ecfdf5;
    --success-500: #10b981;
    --success-600: #059669;
    --warning-50: #fffbeb;
    --warning-500: #f59e0b;
    --warning-600: #d97706;
    --danger-50: #fef2f2;
    --danger-500: #ef4444;
    --danger-600: #dc2626;
    --info-50: #eff6ff;
    --info-500: #3b82f6;
    --info-600: #2563eb;

    /* Dark Theme Colors */
    --bg-body: #0c0e1a;
    --bg-sidebar: #111327;
    --bg-card: #161832;
    --bg-card-hover: #1c1f40;
    --bg-input: #1a1d3a;
    --bg-modal: rgba(0, 0, 0, 0.7);
    --border-color: rgba(99, 102, 241, 0.15);
    --border-light: rgba(255, 255, 255, 0.06);
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;

    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #6366f1, #8b5cf6);
    --gradient-accent: linear-gradient(135deg, #06b6d4, #3b82f6);
    --gradient-success: linear-gradient(135deg, #10b981, #059669);
    --gradient-warning: linear-gradient(135deg, #f59e0b, #ef4444);
    --gradient-card: linear-gradient(145deg, rgba(22, 24, 50, 0.9), rgba(30, 33, 66, 0.6));
    --gradient-sidebar: linear-gradient(180deg, #111327, #0d0f20);
    --gradient-glass: linear-gradient(135deg, rgba(255,255,255,0.05), rgba(255,255,255,0.02));

    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.15);
    --shadow-glow-strong: 0 0 40px rgba(99, 102, 241, 0.25);

    /* Typography */
    --font-sans: 'Inter', 'Noto Sans TC', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

    /* Spacing */
    --sidebar-width: 260px;
    --header-height: 64px;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;

    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-base: 0.25s ease;
    --transition-slow: 0.4s ease;
}

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

html {
    font-size: 15px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    background: var(--bg-body);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

img { max-width: 100%; height: auto; }

/* ===== Login Page ===== */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-body);
    position: relative;
    overflow: hidden;
}

.login-wrapper::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -30%;
    width: 80%;
    height: 80%;
    background: radial-gradient(circle, rgba(99,102,241,0.08) 0%, transparent 70%);
    animation: floatOrb 20s ease-in-out infinite;
}

.login-wrapper::after {
    content: '';
    position: absolute;
    bottom: -40%;
    right: -20%;
    width: 60%;
    height: 60%;
    background: radial-gradient(circle, rgba(139,92,246,0.06) 0%, transparent 70%);
    animation: floatOrb 15s ease-in-out infinite reverse;
}

@keyframes floatOrb {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(30px, -30px) scale(1.05); }
    66% { transform: translate(-20px, 20px) scale(0.95); }
}

.login-card {
    position: relative;
    z-index: 1;
    width: 420px;
    padding: 48px 40px;
    background: var(--gradient-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    backdrop-filter: blur(20px);
    box-shadow: var(--shadow-lg), var(--shadow-glow);
}

.login-logo {
    text-align: center;
    margin-bottom: 36px;
}

.login-logo h1 {
    font-size: 1.6rem;
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.02em;
}

.login-logo p {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 6px;
}

/* ===== Layout ===== */
.app-layout {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--gradient-sidebar);
    border-right: 1px solid var(--border-color);
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    transition: transform var(--transition-base);
}

.sidebar-header {
    padding: 24px 20px;
    border-bottom: 1px solid var(--border-light);
}

.sidebar-brand {
    font-size: 1.15rem;
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.02em;
}

.sidebar-subtitle {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 2px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.sidebar-nav {
    padding: 12px 10px;
    flex: 1;
}

.nav-section {
    margin-bottom: 8px;
}

.nav-section-title {
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: 8px 12px 6px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 0.88rem;
    font-weight: 450;
    transition: all var(--transition-fast);
    cursor: pointer;
    text-decoration: none;
    position: relative;
    margin-bottom: 2px;
}

.nav-item:hover {
    background: rgba(99, 102, 241, 0.08);
    color: var(--text-primary);
}

.nav-item.active {
    background: rgba(99, 102, 241, 0.12);
    color: var(--primary-400);
    font-weight: 500;
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 60%;
    background: var(--gradient-primary);
    border-radius: 0 3px 3px 0;
}

.nav-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}

.nav-badge {
    margin-left: auto;
    background: var(--primary-600);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
    min-width: 22px;
    text-align: center;
}

.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border-light);
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
}

.sidebar-user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 600;
    color: #fff;
}

.sidebar-user-info {
    flex: 1;
}

.sidebar-user-name {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-primary);
}

.sidebar-user-role {
    font-size: 0.72rem;
    color: var(--text-muted);
}

/* Main Content */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    min-height: 100vh;
}

.content-header {
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    border-bottom: 1px solid var(--border-light);
    background: rgba(12, 14, 26, 0.8);
    backdrop-filter: blur(12px);
    position: sticky;
    top: 0;
    z-index: 50;
}

.content-title {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text-primary);
}

.content-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.content-body {
    padding: 28px 32px;
}

/* ===== Cards ===== */
.card {
    background: var(--gradient-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all var(--transition-base);
}

.card:hover {
    border-color: rgba(99, 102, 241, 0.25);
    box-shadow: var(--shadow-glow);
}

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

.card-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.card-body {
    padding: 24px;
}

.card-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
}

/* Stat Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 28px;
}

.stat-card {
    background: var(--gradient-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 22px 24px;
    position: relative;
    overflow: hidden;
    transition: all var(--transition-base);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.stat-card.primary::before { background: var(--gradient-primary); }
.stat-card.success::before { background: var(--gradient-success); }
.stat-card.warning::before { background: var(--gradient-warning); }
.stat-card.info::before { background: var(--gradient-accent); }

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

.stat-label {
    font-size: 0.78rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 8px;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
}

.stat-change {
    font-size: 0.75rem;
    margin-top: 6px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.stat-change.up { color: var(--success-500); }
.stat-change.down { color: var(--danger-500); }

/* ===== Forms ===== */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

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

.form-control {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 0.9rem;
    transition: all var(--transition-fast);
    outline: none;
}

.form-control:focus {
    border-color: var(--primary-500);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

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

textarea.form-control {
    resize: vertical;
    min-height: 120px;
    line-height: 1.6;
}

textarea.form-control.large {
    min-height: 300px;
}

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

.form-hint {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

/* Checkbox */
.form-check {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.form-check input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary-500);
    cursor: pointer;
}

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    font-family: var(--font-sans);
    font-size: 0.88rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    outline: none;
    text-decoration: none;
    white-space: nowrap;
}

.btn:active {
    transform: scale(0.97);
}

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

.btn-primary:hover {
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.4);
    transform: translateY(-1px);
    color: #fff;
}

.btn-secondary {
    background: var(--bg-card);
    border-color: var(--border-color);
    color: var(--text-secondary);
}

.btn-secondary:hover {
    border-color: var(--primary-500);
    color: var(--text-primary);
}

.btn-success {
    background: var(--gradient-success);
    color: #fff;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.btn-success:hover {
    box-shadow: 0 4px 16px rgba(16, 185, 129, 0.4);
    color: #fff;
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: #fff;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
    box-shadow: 0 4px 16px rgba(239, 68, 68, 0.4);
    color: #fff;
}

.btn-warning {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #fff;
}

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

.btn-ghost:hover {
    background: rgba(99, 102, 241, 0.08);
    color: var(--text-primary);
}

.btn-sm {
    padding: 6px 14px;
    font-size: 0.8rem;
}

.btn-lg {
    padding: 14px 28px;
    font-size: 1rem;
}

.btn-block {
    width: 100%;
}

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: var(--radius-md);
}

/* ===== Tables ===== */
.table-wrapper {
    overflow-x: auto;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
}

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

.data-table th {
    padding: 14px 16px;
    text-align: left;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    background: rgba(99, 102, 241, 0.04);
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}

.data-table td {
    padding: 14px 16px;
    font-size: 0.88rem;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-light);
    vertical-align: middle;
}

.data-table tbody tr {
    transition: background var(--transition-fast);
}

.data-table tbody tr:hover {
    background: rgba(99, 102, 241, 0.04);
}

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

/* ===== Badges ===== */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.73rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.badge-primary { background: rgba(99,102,241,0.15); color: var(--primary-400); }
.badge-success { background: rgba(16,185,129,0.15); color: var(--success-500); }
.badge-warning { background: rgba(245,158,11,0.15); color: var(--warning-500); }
.badge-danger  { background: rgba(239,68,68,0.15); color: var(--danger-500); }
.badge-info    { background: rgba(59,130,246,0.15); color: var(--info-500); }
.badge-gray    { background: rgba(148,163,184,0.15); color: var(--gray-400); }

/* Status badges */
.status-draft { background: rgba(148,163,184,0.12); color: var(--gray-400); }
.status-queued { background: rgba(59,130,246,0.12); color: var(--info-500); }
.status-processing { background: rgba(245,158,11,0.12); color: var(--warning-500); }
.status-claimed { background: rgba(139,92,246,0.12); color: #a78bfa; }
.status-waiting_review { background: rgba(6,182,212,0.12); color: #22d3ee; }
.status-completed { background: rgba(16,185,129,0.12); color: var(--success-500); }
.status-rejected { background: rgba(239,68,68,0.12); color: var(--danger-500); }
.status-failed { background: rgba(239,68,68,0.12); color: var(--danger-500); }
.status-cancelled { background: rgba(148,163,184,0.15); color: var(--gray-400); text-decoration: line-through; }
.status-archived { background: rgba(148,163,184,0.08); color: var(--gray-500); }
.status-skipped { background: rgba(148,163,184,0.08); color: var(--gray-500); }
.status-superseded { background: rgba(148,163,184,0.12); color: var(--gray-400); text-decoration: line-through; }

/* ===== Step Progress ===== */
.step-progress {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 16px 0;
    overflow-x: auto;
}

.step-dot {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    min-width: 70px;
    position: relative;
}

.step-dot-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
    border: 2px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-muted);
    transition: all var(--transition-base);
}

.step-dot.completed .step-dot-circle {
    background: var(--gradient-success);
    border-color: var(--success-500);
    color: #fff;
}

.step-dot.active .step-dot-circle {
    background: var(--gradient-primary);
    border-color: var(--primary-500);
    color: #fff;
    box-shadow: 0 0 12px rgba(99, 102, 241, 0.4);
    animation: pulse 2s ease-in-out infinite;
}

.step-dot.rejected .step-dot-circle {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    border-color: var(--danger-500);
    color: #fff;
}

@keyframes pulse {
    0%, 100% { box-shadow: 0 0 12px rgba(99, 102, 241, 0.4); }
    50% { box-shadow: 0 0 20px rgba(99, 102, 241, 0.6); }
}

.step-dot-label {
    font-size: 0.65rem;
    color: var(--text-muted);
    text-align: center;
    white-space: nowrap;
}

.step-dot.active .step-dot-label,
.step-dot.completed .step-dot-label {
    color: var(--text-secondary);
}

.step-connector {
    flex: 1;
    height: 2px;
    background: var(--border-color);
    min-width: 20px;
    margin-bottom: 22px;
}

.step-connector.completed {
    background: var(--gradient-success);
}

/* ===== Alerts ===== */
.alert {
    padding: 14px 18px;
    border-radius: var(--radius-md);
    font-size: 0.88rem;
    margin-bottom: 16px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    border: 1px solid;
}

.alert-success { background: rgba(16,185,129,0.08); border-color: rgba(16,185,129,0.2); color: var(--success-500); }
.alert-warning { background: rgba(245,158,11,0.08); border-color: rgba(245,158,11,0.2); color: var(--warning-500); }
.alert-danger  { background: rgba(239,68,68,0.08); border-color: rgba(239,68,68,0.2); color: var(--danger-500); }
.alert-info    { background: rgba(59,130,246,0.08); border-color: rgba(59,130,246,0.2); color: var(--info-500); }

/* ===== Modals ===== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: var(--bg-modal);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-base);
}

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

.modal {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    width: 90%;
    max-width: 560px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    transform: scale(0.95) translateY(10px);
    transition: transform var(--transition-base);
}

.modal-overlay.active .modal {
    transform: scale(1) translateY(0);
}

.modal-header {
    padding: 24px 28px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-title {
    font-size: 1.1rem;
    font-weight: 600;
}

.modal-close {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: var(--radius-sm);
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.modal-close:hover {
    background: rgba(239,68,68,0.1);
    color: var(--danger-500);
}

.modal-body {
    padding: 0 28px 24px;
}

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

/* ===== Tabs ===== */
.tabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 24px;
}

.tab-item {
    padding: 12px 20px;
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all var(--transition-fast);
}

.tab-item:hover {
    color: var(--text-secondary);
}

.tab-item.active {
    color: var(--primary-400);
    border-bottom-color: var(--primary-500);
}

/* ===== Pagination ===== */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 20px 0;
}

.page-btn {
    width: 36px;
    height: 36px;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.page-btn:hover { border-color: var(--primary-500); color: var(--primary-400); }
.page-btn.active { background: var(--gradient-primary); color: #fff; border-color: var(--primary-500); }

/* ===== Task Process Page ===== */
.process-section {
    margin-bottom: 24px;
}

.process-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    background: rgba(99, 102, 241, 0.04);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    cursor: pointer;
}

.process-section-title {
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.process-section-body {
    padding: 20px;
    border: 1px solid var(--border-color);
    border-top: none;
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    background: var(--bg-card);
}

.copy-btn {
    padding: 4px 12px;
    background: rgba(99,102,241,0.1);
    border: 1px solid rgba(99,102,241,0.2);
    color: var(--primary-400);
    border-radius: var(--radius-sm);
    font-size: 0.78rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.copy-btn:hover {
    background: rgba(99,102,241,0.2);
}

.output-preview {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px;
    font-size: 0.88rem;
    color: var(--text-secondary);
    white-space: pre-wrap;
    word-wrap: break-word;
    max-height: 400px;
    overflow-y: auto;
    line-height: 1.7;
}

/* ===== Quick Actions ===== */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin-bottom: 28px;
}

.quick-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 20px 16px;
    background: var(--gradient-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-base);
    text-decoration: none;
    text-align: center;
}

.quick-action-btn:hover {
    border-color: var(--primary-500);
    background: var(--bg-card-hover);
    color: var(--primary-400);
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

.quick-action-icon {
    font-size: 1.6rem;
}

.quick-action-label {
    font-size: 0.82rem;
    font-weight: 500;
}

/* ===== File Upload ===== */
.file-upload-zone {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-lg);
    padding: 32px;
    text-align: center;
    transition: all var(--transition-base);
    cursor: pointer;
}

.file-upload-zone:hover,
.file-upload-zone.dragover {
    border-color: var(--primary-500);
    background: rgba(99, 102, 241, 0.04);
}

.file-upload-zone .upload-icon {
    font-size: 2.5rem;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.file-upload-zone .upload-text {
    font-size: 0.88rem;
    color: var(--text-secondary);
}

.file-upload-zone .upload-hint {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* ===== Utilities ===== */
.text-primary { color: var(--primary-400); }
.text-success { color: var(--success-500); }
.text-warning { color: var(--warning-500); }
.text-danger  { color: var(--danger-500); }
.text-muted   { color: var(--text-muted); }
.text-center  { text-align: center; }
.text-right   { text-align: right; }

.fw-500 { font-weight: 500; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }

.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }

.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }

.w-full { width: 100%; }

.hidden { display: none !important; }

.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-muted);
}

.empty-state-icon {
    font-size: 3rem;
    margin-bottom: 12px;
    opacity: 0.5;
}

.empty-state-text {
    font-size: 0.95rem;
}

/* ===== Toast Notification ===== */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

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

.toast.success { border-left: 3px solid var(--success-500); }
.toast.error   { border-left: 3px solid var(--danger-500); }
.toast.warning { border-left: 3px solid var(--warning-500); }
.toast.info    { border-left: 3px solid var(--info-500); }

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

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

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

::-webkit-scrollbar-thumb {
    background: rgba(99, 102, 241, 0.2);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(99, 102, 241, 0.4);
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.open {
        transform: translateX(0);
    }
    .main-content {
        margin-left: 0;
    }
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .content-body {
        padding: 16px;
    }
    .form-row {
        grid-template-columns: 1fr;
    }
}

/* AI Model Buttons */
.btn-ai-chatgpt {
    background: rgba(16, 163, 127, 0.15);
    color: #10a37f;
    border: 1px solid rgba(16, 163, 127, 0.3);
    font-weight: 500;
}
.btn-ai-chatgpt:hover, .btn-ai-chatgpt.active {
    background: rgba(16, 163, 127, 0.3);
    border-color: #10a37f;
}

.btn-ai-claude {
    background: rgba(204, 120, 50, 0.15);
    color: #cc7832;
    border: 1px solid rgba(204, 120, 50, 0.3);
    font-weight: 500;
}
.btn-ai-claude:hover, .btn-ai-claude.active {
    background: rgba(204, 120, 50, 0.3);
    border-color: #cc7832;
}

.btn-ai-gemini {
    background: rgba(66, 133, 244, 0.15);
    color: #4285f4;
    border: 1px solid rgba(66, 133, 244, 0.3);
    font-weight: 500;
}
.btn-ai-gemini:hover, .btn-ai-gemini.active {
    background: rgba(66, 133, 244, 0.3);
    border-color: #4285f4;
}

.btn-ai-perplexity {
    background: rgba(124, 58, 237, 0.15);
    color: #7c3aed;
    border: 1px solid rgba(124, 58, 237, 0.3);
    font-weight: 500;
}
.btn-ai-perplexity:hover, .btn-ai-perplexity.active {
    background: rgba(124, 58, 237, 0.3);
    border-color: #7c3aed;
}

.btn-ai-chatgptimg {
    background: rgba(20, 184, 166, 0.15);
    color: #14b8a6;
    border: 1px solid rgba(20, 184, 166, 0.3);
    font-weight: 500;
}
.btn-ai-chatgptimg:hover, .btn-ai-chatgptimg.active {
    background: rgba(20, 184, 166, 0.3);
    border-color: #14b8a6;
}

/* AI Sidebar Claim Panel */
.ai-claim-toggle {
    user-select: none;
    padding: 10px 16px !important;
    margin: 0 !important;
    font-size: 0.85rem;
}
.ai-claim-panel {
    padding: 4px 0 8px 0;
}
.ai-claim-panel.hidden {
    display: none;
}
.ai-claim-btn {
    background: transparent;
    padding: 8px 16px 8px 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    transition: background 0.15s;
}
.ai-claim-btn:hover {
    background: rgba(255,255,255,0.06);
}
.ai-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}
.ai-dot-chatgpt { background: #10a37f; }
.ai-dot-claude { background: #cc7832; }
.ai-dot-gemini { background: #4285f4; }
.ai-dot-perplexity { background: #7c3aed; }
.ai-dot-chatgptimg { background: #14b8a6; }

.ai-claim-btn.btn-ai-chatgpt { color: #10a37f; }
.ai-claim-btn.btn-ai-claude { color: #cc7832; }
.ai-claim-btn.btn-ai-gemini { color: #4285f4; }
.ai-claim-btn.btn-ai-perplexity { color: #7c3aed; }
.ai-claim-btn.btn-ai-chatgptimg { color: #14b8a6; }

.ai-claim-count {
    margin-left: auto;
    background: rgba(255,255,255,0.1);
    padding: 1px 8px;
    border-radius: 10px;
    font-size: 0.75rem;
    min-width: 20px;
    text-align: center;
}
.ai-claim-msg {
    padding: 6px 16px;
    font-size: 0.78rem;
    color: #e9a23b;
    border-top: 1px solid rgba(255,255,255,0.06);
    margin-top: 4px;
}
.ai-claim-msg.ai-claim-error {
    color: #ef4444;
}

/* AI Model Badges */
.badge-ai-chatgpt {
    background: rgba(16, 163, 127, 0.2);
    color: #10a37f;
}
.badge-ai-claude {
    background: rgba(204, 120, 50, 0.2);
    color: #cc7832;
}
.badge-ai-gemini {
    background: rgba(66, 133, 244, 0.2);
    color: #4285f4;
}
.badge-ai-perplexity {
    background: rgba(124, 58, 237, 0.2);
    color: #7c3aed;
}
