/* ===== Premium UI Upgrade V2.0 ===== */
:root {
    --brand-primary: #2563eb;
    --brand-primary-light: #EFF6FF;
    --brand-primary-deep: #1d4ed8;
    --brand-primary-dark: #1E40AF;
    --brand-primary-rgb: 37, 99, 235;
    --brand-secondary: #7c3aed;
    --brand-accent: #10b981;
    --brand-gradient: linear-gradient(135deg, var(--brand-primary), var(--brand-secondary));
    --brand-primary-soft: rgba(37, 99, 235, 0.08);

    --success-color: #10b981;
    --success-bg: #ECFDF5;
    --success-text: #065F46;

    --warning-color: #f59e0b;
    --warning-bg: #FFFBEB;
    --warning-text: #92400E;

    --error-color: #ef4444;
    --error-bg: #FEF2F2;
    --error-text: #991B1B;

    --info-color: #3b82f6;
    --info-bg: #EFF6FF;
    --info-text: #1E40AF;

    --loading-color: #2563eb;
    --loading-bg: #EFF6FF;
    --loading-text: #1d4ed8;

    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --text-disabled: #cbd5e1;
    --text-on-brand: #FFFFFF;
    --text-on-success: #FFFFFF;
    --text-on-warning: #FFFFFF;
    --text-on-error: #FFFFFF;
    --text-on-dark: #1e293b;

    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f1f5f9;
    --bg-sidebar: #ffffff;
    --bg-card: rgba(255, 255, 255, 0.95);
    --bg-card-solid: #ffffff;
    --bg-glass: rgba(255, 255, 255, 0.92);
    --bg-glass-light: rgba(37, 99, 235, 0.04);
    --bg-disabled: #f1f5f9;
    --bg-hover: #f8fafc;

    --border-light: rgba(0, 0, 0, 0.05);
    --border-medium: rgba(0, 0, 0, 0.08);
    --border-heavy: rgba(0, 0, 0, 0.12);
    --border-glow: rgba(37, 99, 235, 0.25);
    --border-brand: #2563eb;
    --border-success: #10b981;
    --border-warning: #f59e0b;
    --border-error: #ef4444;

    --overlay-light: rgba(15, 23, 42, 0.2);
    --overlay-medium: rgba(15, 23, 42, 0.4);
    --overlay-dark: rgba(15, 23, 42, 0.6);

    --glow-primary: 0 0 20px rgba(37, 99, 235, 0.12);
    --glow-secondary: 0 0 15px rgba(124, 58, 237, 0.12);
    --glow-accent: 0 0 10px rgba(16, 185, 129, 0.08);
    --glow-card: 0 8px 30px rgba(0, 0, 0, 0.06);

    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.02);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.03);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.06), 0 4px 6px -4px rgba(0, 0, 0, 0.03);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
    --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
    --shadow-inner: inset 0 2px 4px rgba(0, 0, 0, 0.03);

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-xxl: 24px;

    --sidebar-width: 260px;
    --sidebar-width-compact: 220px;
    --sidebar-width-mini: 180px;
    --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-medium: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-spring: 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);

    --font-heading: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'SF Pro Display', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'SF Pro Text', 'PingFang SC', 'Microsoft YaHei', sans-serif;
}

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

        body {
            font-family: var(--font-body);
            background: var(--bg-primary);
            color: var(--text-primary);
            line-height: 1.6;
            -webkit-font-smoothing: antialiased;
            -moz-osx-font-smoothing: grayscale;
            overflow-x: hidden;
            background-image:
                radial-gradient(circle at 0% 0%, rgba(37, 99, 235, 0.03) 0%, transparent 50%),
                radial-gradient(circle at 100% 100%, rgba(124, 58, 237, 0.03) 0%, transparent 50%);
        }

        ::-webkit-scrollbar {
            width: 6px;
            height: 6px;
        }

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

        ::-webkit-scrollbar-thumb {
            background: rgba(0, 0, 0, 0.12);
            border-radius: 3px;
        }

        ::-webkit-scrollbar-thumb:hover {
            background: rgba(0, 0, 0, 0.2);
        }

        *:focus-visible {
            outline: 2px solid var(--brand-primary);
            outline-offset: 2px;
            border-radius: 4px;
        }

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

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

        .page {
            display: flex;
            min-height: 100vh;
        }

        /* ===== Premium Sidebar ===== */
        .app-sidebar {
            width: var(--sidebar-width);
            background: var(--bg-sidebar);
            color: var(--text-on-dark);
            display: flex;
            flex-direction: column;
            position: fixed;
            left: 0;
            top: 0;
            bottom: 0;
            border-right: 1px solid var(--border-light);
            z-index: 1000;
            backdrop-filter: blur(20px) saturate(1.5);
            box-shadow: 1px 0 0 var(--border-light), var(--shadow-lg);
            overflow-y: auto;
            overflow-x: hidden;
        }

        .sidebar-header {
            padding: 24px 20px;
            border-bottom: 1px solid var(--border-light);
            position: sticky;
            top: 0;
            z-index: 3;
            background: var(--bg-sidebar);
            overflow: visible;
        }

        .sidebar-header::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            height: 3px;
            background: var(--brand-gradient);
            border-radius: 0 0 4px 4px;
        }

        .app-logo {
            display: flex;
            align-items: center;
            gap: 14px;
            margin-bottom: 4px;
            width: 100%;
            min-width: 0;
        }

        .logo-icon {
            width: 48px;
            height: 48px;
            border-radius: var(--radius-md);
            background: var(--brand-gradient);
            display: flex;
            align-items: center;
            justify-content: center;
            color: white;
            font-weight: 700;
            font-size: 16px;
            flex-shrink: 0;
            box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
            position: relative;
            overflow: hidden;
            border: none;
        }

        .logo-icon::after {
            content: '';
            position: absolute;
            top: -50%;
            left: -50%;
            width: 200%;
            height: 200%;
            background: linear-gradient(
                to bottom right,
                rgba(255, 255, 255, 0) 0%,
                rgba(255, 255, 255, 0.2) 50%,
                rgba(255, 255, 255, 0) 100%
            );
            transform: rotate(30deg);
            animation: shine 4s infinite linear;
        }

        .logo-text {
            display: flex;
            flex-direction: column;
            flex: 1;
            min-width: 0;
            overflow: hidden;
        }

        .logo-main {
            font-size: 16px;
            font-weight: 800;
            letter-spacing: -0.02em;
            color: var(--text-primary);
            background: linear-gradient(135deg, var(--brand-primary), var(--brand-secondary));
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .logo-sub {
            font-size: 11px;
            color: var(--text-muted);
            margin-top: 2px;
            letter-spacing: 0.02em;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .sidebar-header .logo-main{
            color: var(--text-primary);
            -webkit-text-fill-color: initial;
            background: none;
        }

        .nav-section {
            padding: 16px 0;
            border-bottom: 1px solid var(--border-light);
        }

        .nav-section:last-child {
            border-bottom: none;
        }

        .nav-section-title {
            font-size: 10px;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 0.12em;
            color: var(--text-muted);
            padding: 0 24px 10px;
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .nav-section-title::before {
            content: '';
            width: 3px;
            height: 3px;
            background: var(--brand-primary);
            border-radius: 50%;
        }

        .nav-menu {
            display: flex;
            flex-direction: column;
            gap: 2px;
            padding: 0 12px;
        }

        .nav-item {
            display: flex;
            align-items: center;
            gap: 12px;
            padding: 10px 14px;
            border-radius: var(--radius-md);
            cursor: pointer;
            transition: all var(--transition-medium);
            font-size: 13.5px;
            font-weight: 500;
            color: var(--text-secondary);
            border: 1px solid transparent;
            background: transparent;
            text-align: left;
            width: 100%;
            position: relative;
            overflow: hidden;
        }

        .nav-item::before {
            content: '';
            position: absolute;
            inset: 0;
            background: linear-gradient(90deg, rgba(37, 99, 235, 0.06), transparent);
            opacity: 0;
            transition: opacity var(--transition-medium);
            border-radius: inherit;
        }

        .nav-item:hover {
            color: var(--brand-primary);
            background: rgba(37, 99, 235, 0.04);
        }

        .nav-item:hover::before {
            opacity: 1;
        }

        .nav-item.active {
            background: rgba(37, 99, 235, 0.08);
            color: var(--brand-primary);
            font-weight: 600;
            box-shadow: var(--shadow-xs);
        }

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

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

        .nav-label {
            flex: 1;
            font-weight: 500;
        }

        .nav-desc {
            font-size: 11px;
            color: var(--text-muted);
            margin-top: 1px;
        }

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

        .user-card {
            display: flex;
            align-items: center;
            gap: 12px;
        }

        .user-avatar {
            width: 36px;
            height: 36px;
            border-radius: 50%;
            background: var(--brand-gradient);
            display: flex;
            align-items: center;
            justify-content: center;
            color: white;
            font-weight: 600;
            font-size: 13px;
            flex-shrink: 0;
            box-shadow: 0 2px 8px rgba(37, 99, 235, 0.2);
            border: 2px solid white;
        }

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

        .user-name {
            font-size: 13px;
            font-weight: 600;
            color: var(--text-primary);
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .user-role {
            font-size: 11px;
            color: var(--text-muted);
            margin-top: 1px;
        }

        /* ===== Main Content ===== */
        .app-main {
            flex: 1;
            min-width: 0;
            margin-left: var(--sidebar-width);
            padding: 0;
            background: transparent;
        }

        .app-header {
            position: sticky;
            top: 0;
            z-index: 100;
            background: rgba(255, 255, 255, 0.85);
            backdrop-filter: blur(20px) saturate(1.5);
            border-bottom: 1px solid var(--border-light);
            padding: 16px 32px;
            display: flex;
            align-items: center;
            justify-content: space-between;
            box-shadow: var(--shadow-xs);
        }

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

        .page-title {
            font-size: 24px;
            font-weight: 800;
            color: var(--text-primary);
            margin: 0;
            background: linear-gradient(135deg, var(--brand-primary), var(--brand-secondary));
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
            letter-spacing: -0.03em;
        }

        .page-subtitle {
            font-size: 14px;
            color: var(--text-secondary);
            margin: 4px 0 0 0;
        }

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

        .stats-cards {
            display: flex;
            gap: 12px;
        }

        .stat-card {
            background: var(--bg-secondary);
            border-radius: var(--radius-lg);
            padding: 16px 20px;
            min-width: 120px;
            border: 1px solid var(--border-light);
            box-shadow: var(--shadow-xs);
            transition: all var(--transition-medium);
            position: relative;
            overflow: hidden;
        }

        .stat-card::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            height: 2px;
            background: var(--brand-gradient);
            opacity: 0;
            transition: opacity var(--transition-medium);
        }

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

        .stat-card:hover::before {
            opacity: 1;
        }

        .stat-value {
            font-size: 22px;
            font-weight: 800;
            color: var(--brand-primary);
            line-height: 1.2;
            letter-spacing: -0.02em;
        }

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

        .user-quick {
            display: flex;
            align-items: center;
            gap: 12px;
            padding: 8px 14px;
            background: var(--bg-secondary);
            border-radius: var(--radius-lg);
            border: 1px solid var(--border-light);
            transition: all var(--transition-medium);
        }

        .user-quick:hover {
            border-color: var(--border-glow);
            box-shadow: var(--shadow-sm);
        }

        .user-level {
            font-size: 11px;
            font-weight: 700;
            padding: 4px 10px;
            border-radius: 16px;
            background: var(--brand-primary-soft);
            color: var(--brand-primary);
            border: 1px solid rgba(37, 99, 235, 0.15);
        }

        /* ===== Main Workspace ===== */
        .main-content {
            padding: 28px;
        }

        .alert-banner {
            background: linear-gradient(135deg, rgba(37, 99, 235, 0.06), rgba(124, 58, 237, 0.04));
            border: 1px solid rgba(37, 99, 235, 0.12);
            border-radius: var(--radius-lg);
            padding: 16px 20px;
            margin-bottom: 28px;
            display: flex;
            align-items: center;
            gap: 14px;
            color: var(--brand-primary);
            backdrop-filter: blur(10px);
            position: relative;
            overflow: hidden;
        }

        .alert-banner::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            height: 1px;
            background: linear-gradient(90deg, transparent, var(--brand-primary), transparent);
            opacity: 0.5;
        }

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

        .alert-text {
            flex: 1;
            font-size: 14px;
            font-weight: 500;
        }

        /* ===== Workspace Grid ===== */
        .workspace-grid {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 24px;
            margin-bottom: 28px;
        }

        .workspace-card {
            background: var(--bg-secondary);
            border-radius: var(--radius-xl);
            padding: 28px;
            box-shadow: var(--shadow-sm);
            border: 1px solid var(--border-light);
            transition: all var(--transition-medium);
            position: relative;
            overflow: hidden;
        }

        .workspace-card::before {
            content: "";
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            height: 3px;
            background: var(--brand-gradient);
            opacity: 0.7;
        }

        .workspace-card::after {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: linear-gradient(135deg, transparent 40%, rgba(37, 99, 235, 0.015) 100%);
            pointer-events: none;
        }

        .workspace-card:hover {
            transform: translateY(-2px);
            box-shadow: var(--shadow-lg);
            border-color: var(--border-glow);
        }

        .card-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            margin-bottom: 20px;
        }

        .card-title {
            display: flex;
            align-items: center;
            gap: 10px;
            font-size: 17px;
            font-weight: 700;
            color: var(--text-primary);
            letter-spacing: -0.01em;
        }

        .card-badge {
            font-size: 11px;
            font-weight: 700;
            padding: 5px 12px;
            border-radius: 16px;
            background: var(--brand-primary-soft);
            color: var(--brand-primary);
            border: 1px solid rgba(37, 99, 235, 0.12);
            letter-spacing: 0.03em;
        }

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

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

        .form-label {
            display: block;
            font-size: 12px;
            font-weight: 600;
            color: var(--text-secondary);
            margin-bottom: 8px;
            letter-spacing: 0.02em;
        }

        .form-control {
            width: 100%;
            padding: 11px 14px;
            font-size: 14px;
            border: 1px solid var(--border-medium);
            border-radius: var(--radius-md);
            background: var(--bg-secondary);
            transition: all var(--transition-medium);
            color: var(--text-primary);
            font-family: inherit;
        }

        .form-control:hover {
            border-color: var(--border-heavy);
        }

        .form-control:focus {
            outline: none;
            border-color: var(--brand-primary);
            box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.08);
            background: var(--bg-secondary);
        }

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

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

        select.form-control {
            appearance: none;
            background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 20 20' fill='none'%3E%3Cpath d='M5 8L10 13L15 8' stroke='%232563eb' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
            background-repeat: no-repeat;
            background-position: right 14px center;
            background-size: 20px;
            padding-right: 50px;
        }

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

        .form-row {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 20px;
        }

        /* ===== Buttons ===== */
        .btn {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            padding: 10px 22px;
            font-size: 13.5px;
            font-weight: 600;
            border-radius: var(--radius-md);
            border: none;
            cursor: pointer;
            transition: all var(--transition-medium);
            gap: 8px;
            line-height: 1;
            white-space: nowrap;
            position: relative;
            overflow: hidden;
        }

        .btn::before {
            content: '';
            position: absolute;
            inset: 0;
            background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
            transform: translateX(-100%);
            transition: transform 0.5s ease;
        }

        .btn:hover::before {
            transform: translateX(100%);
        }

        .btn:hover {
            transform: translateY(-1px);
        }

        .btn:active {
            transform: translateY(0) scale(0.98);
        }

        .btn-primary {
            background: var(--brand-gradient);
            color: white;
            box-shadow: 0 2px 8px rgba(37, 99, 235, 0.2), 0 1px 2px rgba(37, 99, 235, 0.1);
        }

        .btn-primary:hover {
            box-shadow: 0 4px 14px rgba(37, 99, 235, 0.3), 0 2px 4px rgba(37, 99, 235, 0.15);
        }

        .btn-secondary {
            background: var(--bg-secondary);
            color: var(--text-primary);
            border: 1px solid var(--border-medium);
            box-shadow: var(--shadow-xs);
        }

        .btn-secondary:hover {
            background: var(--bg-tertiary);
            border-color: var(--border-heavy);
            box-shadow: var(--shadow-sm);
        }

        .btn-sm {
            padding: 7px 14px;
            font-size: 12px;
        }

        .btn-group {
            display: flex;
            gap: 12px;
            margin-top: 24px;
            flex-wrap: wrap;
        }

        /* ===== Tasks Section ===== */
        .tasks-section {
            margin-bottom: 40px;
        }

        .section-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            margin-bottom: 24px;
        }

        .section-title {
            font-size: 20px;
            font-weight: 800;
            color: var(--text-primary);
            display: flex;
            align-items: center;
            gap: 12px;
            letter-spacing: -0.02em;
        }

        .section-title .badge {
            font-size: 12px;
            padding: 5px 12px;
            border-radius: 16px;
            background: var(--brand-primary-soft);
            color: var(--brand-primary);
            font-weight: 700;
            border: 1px solid rgba(37, 99, 235, 0.12);
        }

        .tabs-container {
            display: flex;
            gap: 2px;
            background: var(--bg-tertiary);
            padding: 4px;
            border-radius: var(--radius-lg);
            width: fit-content;
            border: 1px solid var(--border-light);
        }

        .tab {
            padding: 9px 22px;
            font-size: 13.5px;
            font-weight: 600;
            color: var(--text-secondary);
            border-radius: var(--radius-md);
            cursor: pointer;
            transition: all var(--transition-medium);
            border: none;
            background: transparent;
        }

        .tab:hover {
            background: rgba(37, 99, 235, 0.04);
            color: var(--text-primary);
        }

        .tab.active {
            background: var(--brand-gradient);
            color: white;
            box-shadow: var(--shadow-sm);
        }

        .table-container {
            background: var(--bg-secondary);
            border-radius: var(--radius-xl);
            overflow: hidden;
            box-shadow: var(--shadow-sm);
            border: 1px solid var(--border-light);
            margin-top: 20px;
            position: relative;
        }

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

        .table thead {
            background: var(--bg-tertiary);
        }

        .table th {
            padding: 14px 20px;
            text-align: left;
            font-size: 11px;
            font-weight: 700;
            color: var(--text-muted);
            text-transform: uppercase;
            letter-spacing: 0.08em;
            border-bottom: 1px solid var(--border-light);
            background: var(--bg-tertiary);
        }

        .table td {
            padding: 14px 20px;
            font-size: 13.5px;
            color: var(--text-primary);
            border-bottom: 1px solid var(--border-light);
        }

        .table tbody tr {
            transition: all var(--transition-medium);
            background: transparent;
        }

        .table tbody tr:hover {
            background: rgba(37, 99, 235, 0.02);
        }

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

        .status-badge {
            display: inline-flex;
            align-items: center;
            padding: 5px 10px;
            border-radius: 16px;
            font-size: 11px;
            font-weight: 700;
            border: 1px solid transparent;
            gap: 4px;
        }

        .status-queued {
            background: rgba(245, 158, 11, 0.08);
            color: #d97706;
            border-color: rgba(245, 158, 11, 0.15);
        }
        .status-running {
            background: rgba(37, 99, 235, 0.08);
            color: var(--brand-primary);
            border-color: rgba(37, 99, 235, 0.15);
        }
        .status-done {
            background: rgba(16, 185, 129, 0.08);
            color: var(--brand-accent);
            border-color: rgba(16, 185, 129, 0.15);
        }
        .status-failed {
            background: rgba(239, 68, 68, 0.08);
            color: #ef4444;
            border-color: rgba(239, 68, 68, 0.15);
        }

        /* ===== Share Section ===== */
        .share-grid {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 24px;
        }

        .share-card {
            background: var(--bg-secondary);
            border-radius: var(--radius-xl);
            padding: 28px;
            box-shadow: var(--shadow-sm);
            border: 1px solid var(--border-light);
            transition: all var(--transition-medium);
        }

        .share-card:hover {
            border-color: var(--border-glow);
            box-shadow: var(--shadow-md);
        }

        .share-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            margin-bottom: 24px;
        }

        .share-title {
            font-size: 17px;
            font-weight: 700;
            color: var(--text-primary);
        }

        .image-preview {
            margin-top: 16px;
            display: flex;
            align-items: center;
            gap: 16px;
            flex-wrap: wrap;
        }

        .image-preview img {
            max-width: 180px;
            max-height: 100px;
            border-radius: var(--radius-md);
            border: 1px solid var(--border-light);
            object-fit: cover;
            box-shadow: var(--shadow-xs);
        }

        .link-container {
            margin-top: 16px;
        }

        .link-input {
            width: 100%;
            padding: 11px 14px;
            background: var(--bg-tertiary);
            border: 1px solid var(--border-light);
            border-radius: var(--radius-md);
            font-size: 13px;
            color: var(--text-primary);
            margin-top: 8px;
            font-family: 'SF Mono', 'Monaco', 'Inconsolata', monospace;
        }

        /* ===== Modal Styles ===== */
        .modal-backdrop {
            position: fixed;
            inset: 0;
            background: rgba(15, 23, 42, 0.5);
            backdrop-filter: blur(8px);
            display: none;
            align-items: center;
            justify-content: center;
            z-index: 2000;
            padding: 16px;
            animation: fadeIn 0.2s ease;
        }

        @keyframes fadeIn {
            from { opacity: 0; }
            to { opacity: 1; }
        }

        .modal {
            background: var(--bg-secondary);
            border-radius: var(--radius-xxl);
            width: 100%;
            max-width: 500px;
            max-height: 90vh;
            overflow-y: auto;
            box-shadow: var(--shadow-2xl);
            animation: modalSlideIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
            border: 1px solid var(--border-light);
            position: relative;
            overflow: hidden;
        }

        .modal::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            height: 3px;
            background: var(--brand-gradient);
        }

        @keyframes modalSlideIn {
            from {
                opacity: 0;
                transform: translateY(-12px) scale(0.97);
            }
            to {
                opacity: 1;
                transform: translateY(0) scale(1);
            }
        }

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

        .modal-title {
            font-size: 18px;
            font-weight: 800;
            color: var(--text-primary);
            letter-spacing: -0.02em;
        }

        .modal-close {
            background: var(--bg-tertiary);
            border: 1px solid var(--border-light);
            font-size: 18px;
            color: var(--text-muted);
            cursor: pointer;
            width: 34px;
            height: 34px;
            display: flex;
            align-items: center;
            justify-content: center;
            border-radius: 50%;
            transition: all var(--transition-medium);
        }

        .modal-close:hover {
            background: rgba(239, 68, 68, 0.08);
            border-color: rgba(239, 68, 68, 0.2);
            color: var(--error-color);
            transform: rotate(90deg);
        }

        .modal-body {
            padding: 24px;
        }

        /* ===== Role Section ===== */
        .role-section {
            margin-bottom: 40px;
        }

        .role-card {
            background: var(--bg-secondary);
            border-radius: var(--radius-xl);
            padding: 28px;
            box-shadow: var(--shadow-sm);
            border: 1px solid var(--border-light);
            margin-bottom: 24px;
            transition: all var(--transition-medium);
        }

        .role-card:hover {
            border-color: var(--border-glow);
            box-shadow: var(--shadow-md);
        }

        .role-cloud-status {
            font-size: 12px;
            color: var(--text-secondary);
            margin-top: 12px;
            padding: 10px 14px;
            background: var(--bg-tertiary);
            border-radius: var(--radius-md);
            border: 1px solid var(--border-light);
            font-family: 'SF Mono', 'Monaco', 'Inconsolata', monospace;
        }

        /* ===== Characters Section ===== */
        #section-characters {
            margin-bottom: 40px;
        }

        #section-characters .workspace-card {
            margin-top: 0;
        }

        #section-characters .section-header {
            margin-bottom: 24px;
        }

        #section-characters .card-subtitle {
            margin-bottom: 24px;
        }

        #section-characters .tasks-actions {
            display: flex;
            align-items: center;
            gap: 14px;
            margin-bottom: 24px;
            flex-wrap: wrap;
            padding: 16px 20px;
            background: var(--bg-tertiary);
            border-radius: var(--radius-lg);
            border: 1px solid var(--border-light);
        }

        #section-characters .tag-filter {
            display: flex;
            align-items: center;
            gap: 8px;
            background: var(--bg-secondary);
            padding: 10px 16px;
            border-radius: var(--radius-md);
            border: 1px solid var(--border-light);
        }

        #section-characters .tag-filter-label {
            color: var(--text-secondary);
            font-size: 12px;
            font-weight: 600;
            letter-spacing: 0.02em;
        }

        #section-characters .tasks-actions .form-control.small {
            background: var(--bg-secondary);
            border: 1px solid var(--border-light);
            color: var(--text-primary);
            padding: 10px 14px;
            font-size: 13px;
            border-radius: var(--radius-md);
        }

        #section-characters .tasks-actions .form-control.small:focus {
            border-color: var(--brand-primary);
            box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.08);
        }

        #section-characters .tasks-actions .btn-secondary {
            background: var(--bg-secondary);
            border: 1px solid var(--border-light);
            color: var(--text-primary);
        }

        #section-characters .tasks-actions .btn-secondary:hover {
            background: var(--bg-tertiary);
            border-color: var(--border-glow);
            transform: translateY(-1px);
        }

        #section-characters .tasks-table-wrap {
            background: var(--bg-secondary);
            border-radius: var(--radius-xl);
            overflow: hidden;
            box-shadow: var(--shadow-sm);
            border: 1px solid var(--border-light);
        }

        #section-characters .tasks-table {
            width: 100%;
            border-collapse: collapse;
        }

        #section-characters .tasks-table th {
            padding: 14px 20px;
            text-align: left;
            font-size: 11px;
            font-weight: 700;
            color: var(--text-muted);
            text-transform: uppercase;
            letter-spacing: 0.08em;
            background: var(--bg-tertiary);
            border-bottom: 1px solid var(--border-light);
            white-space: nowrap;
        }

        #section-characters .tasks-table td {
            padding: 14px 20px;
            font-size: 13px;
            color: var(--text-primary);
            border-bottom: 1px solid var(--border-light);
            vertical-align: middle;
        }

        #section-characters .tasks-table tbody tr {
            transition: all var(--transition-medium);
            background: transparent;
        }

        #section-characters .tasks-table tbody tr:hover {
            background: rgba(37, 99, 235, 0.02);
        }

        #section-characters .tasks-table tbody tr:last-child td {
            border-bottom: none;
        }

        #section-characters .tasks-table .muted {
            color: var(--text-muted);
            text-align: center;
            padding: 40px !important;
            font-size: 14px;
        }

        #section-characters .tasks-hint {
            font-size: 12px;
            color: var(--text-secondary);
            margin-top: 16px;
            padding: 14px 20px;
            background: var(--brand-primary-soft);
            border-radius: var(--radius-md);
            border: 1px solid rgba(37, 99, 235, 0.1);
            line-height: 1.6;
        }

        .tg-tag-badge {
            display: inline-flex;
            align-items: center;
            padding: 5px 10px;
            border-radius: 16px;
            border: 1px solid rgba(37, 99, 235, 0.12);
            background: var(--brand-primary-soft);
            font-size: 11px;
            font-weight: 600;
            color: var(--brand-primary);
            margin-right: 6px;
            margin-bottom: 4px;
            transition: all var(--transition-medium);
        }

        .tg-tag-badge:hover {
            transform: translateY(-1px);
            box-shadow: 0 2px 6px rgba(37, 99, 235, 0.1);
            background: rgba(37, 99, 235, 0.12);
        }

        .tg-pin-btn {
            padding: 5px 10px;
            border-radius: var(--radius-sm);
            border: 1px solid var(--border-light);
            background: var(--bg-tertiary);
            color: var(--text-secondary);
            font-size: 11px;
            font-weight: 600;
            cursor: pointer;
            transition: all var(--transition-medium);
        }

        .tg-pin-btn:hover {
            background: rgba(37, 99, 235, 0.04);
            border-color: var(--brand-primary);
            color: var(--brand-primary);
            transform: translateY(-1px);
        }

        .tg-pin-btn.pinned {
            background: var(--brand-gradient);
            color: white;
            border-color: var(--brand-primary);
            box-shadow: 0 2px 6px rgba(37, 99, 235, 0.2);
        }

        /* ===== Responsive ===== */
        @media (max-width: 1400px) {
            .app-sidebar {
                width: var(--sidebar-width-compact);
            }

            .app-main {
                margin-left: var(--sidebar-width-compact);
            }

            .hidden-features-menu {
                left: var(--sidebar-width-compact);
            }
        }

        @media (max-width: 1200px) {
            .workspace-grid {
                grid-template-columns: 1fr;
            }

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

            .stats-cards {
                flex-wrap: wrap;
            }

            .stat-card {
                min-width: 100px;
            }
        }

        @media (max-width: 1024px) {
            .app-sidebar {
                width: var(--sidebar-width-mini);
            }

            .app-main {
                margin-left: var(--sidebar-width-mini);
            }

            .hidden-features-menu {
                left: var(--sidebar-width-mini);
            }

            .logo-icon {
                width: 48px;
                height: 48px;
                font-size: 15px;
            }

            .logo-main {
                font-size: 14px;
            }

            .logo-sub {
                font-size: 9px;
            }

            .nav-item {
                padding: 10px 12px;
                font-size: 13px;
            }

            .nav-desc {
                display: none;
            }
        }

        @media (max-width: 768px) {
            .app-sidebar {
                width: 100%;
                height: auto;
                position: relative;
                margin-left: 0;
            }

            .app-main {
                margin-left: 0;
            }

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

            .header-right {
                flex-direction: column;
                align-items: flex-start;
                gap: 12px;
            }

            .user-quick {
                width: 100%;
            }

            .modal {
                max-width: 95%;
            }
        }

        /* ===== Utility Classes ===== */
        .mt-4 { margin-top: 16px; }
        .mt-6 { margin-top: 20px; }
        .mt-8 { margin-top: 24px; }
        .mb-4 { margin-bottom: 16px; }
        .mb-6 { margin-bottom: 20px; }
        .mb-8 { margin-bottom: 24px; }
        .flex { display: flex; }
        .items-center { align-items: center; }
        .justify-between { justify-content: space-between; }
        .gap-3 { gap: 12px; }
        .gap-4 { gap: 16px; }
        .gap-6 { gap: 20px; }
        .text-sm { font-size: 14px; }
        .text-center { text-align: center; }
        .py-8 { padding-top: 24px; padding-bottom: 24px; }
        .mono { font-family: 'SF Mono', 'Monaco', 'Inconsolata', monospace; }

        /* ===== Message Styles ===== */
        .msg {
            font-size: 12px;
            margin-top: 10px;
            padding: 10px 14px;
            border-radius: var(--radius-md);
            border: 1px solid transparent;
        }
        .msg.error {
            background: rgba(239, 68, 68, 0.06);
            color: #ef4444;
            border-color: rgba(239, 68, 68, 0.12);
        }
        .msg.success {
            background: rgba(16, 185, 129, 0.06);
            color: var(--brand-accent);
            border-color: rgba(16, 185, 129, 0.12);
        }
        .msg.loading {
            background: rgba(37, 99, 235, 0.06);
            color: var(--brand-primary);
            border-color: rgba(37, 99, 235, 0.12);
        }

        /* ===== Animations ===== */
        @keyframes shine {
            0% { transform: translateX(-100%) translateY(-100%) rotate(30deg); }
            100% { transform: translateX(100%) translateY(100%) rotate(30deg); }
        }

        @keyframes pulse-glow {
            0%, 100% { opacity: 0.4; }
            50% { opacity: 1; }
        }

        @keyframes slideUp {
            from { opacity: 0; transform: translateY(8px); }
            to { opacity: 1; transform: translateY(0); }
        }

        @keyframes scaleIn {
            from { opacity: 0; transform: scale(0.95); }
            to { opacity: 1; transform: scale(1); }
        }

        /* ===== Detail Modal Content ===== */
        .script-detail-content {
            background: var(--bg-tertiary);
            border-radius: var(--radius-md);
            padding: 16px;
            font-size: 13px;
            line-height: 1.7;
            white-space: pre-wrap;
            max-height: 300px;
            overflow-y: auto;
            border: 1px solid var(--border-light);
            font-family: 'SF Mono', 'Monaco', 'Inconsolata', monospace;
        }

        .video-detail-content {
            font-size: 14px;
        }

        .video-link {
            color: var(--brand-primary);
            text-decoration: none;
            font-weight: 500;
            word-break: break-all;
            transition: all var(--transition-fast);
        }

        .video-link:hover {
            color: var(--brand-secondary);
            text-decoration: underline;
        }

        .modal-line {
            margin-bottom: 12px;
            font-size: 14px;
        }

        .modal-line .label {
            color: var(--text-secondary);
            font-weight: 600;
            margin-right: 8px;
        }

        .modal-section-title {
            font-size: 15px;
            font-weight: 700;
            margin: 20px 0 12px;
            color: var(--text-primary);
            padding-bottom: 8px;
            border-bottom: 1px solid var(--border-light);
        }

        .divider {
            height: 1px;
            background: linear-gradient(90deg, transparent, var(--border-medium), transparent);
            margin: 24px 0;
        }

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

        .bind-bank-form {
            background: var(--bg-tertiary);
            border-radius: var(--radius-lg);
            padding: 20px;
            margin-top: 16px;
            border: 1px solid var(--border-light);
        }

        .wallet-remind {
            background: var(--bg-tertiary);
            border-radius: var(--radius-md);
            padding: 14px 16px;
            margin-top: 16px;
            font-size: 12px;
            color: var(--text-secondary);
            border: 1px solid var(--border-light);
        }

        .wallet-remind .highlight {
            color: var(--brand-primary);
            font-weight: 700;
        }

        .wallet-summary {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
            gap: 16px;
            margin: 16px 0;
        }

        .wallet-item {
            background: var(--bg-tertiary);
            border-radius: var(--radius-md);
            padding: 16px;
            border: 1px solid var(--border-light);
            transition: all var(--transition-medium);
        }

        .wallet-item:hover {
            border-color: var(--border-glow);
            transform: translateY(-2px);
            box-shadow: var(--shadow-sm);
        }

        .wallet-item-label {
            font-size: 11px;
            color: var(--text-muted);
            margin-bottom: 6px;
            text-transform: uppercase;
            letter-spacing: 0.05em;
        }

        .wallet-item-value {
            font-size: 20px;
            font-weight: 800;
            color: var(--brand-primary);
            letter-spacing: -0.02em;
        }

        .wallet-actions {
            display: flex;
            flex-wrap: wrap;
            gap: 10px;
            margin-top: 16px;
        }

        /* ===== Field Row ===== */
        .field-row {
            margin-bottom: 16px;
        }

        .field-row label {
            display: block;
            font-size: 12px;
            font-weight: 600;
            color: var(--text-secondary);
            margin-bottom: 6px;
            letter-spacing: 0.02em;
        }

        .field-row input {
            width: 100%;
            padding: 10px 14px;
            border: 1px solid var(--border-medium);
            border-radius: var(--radius-md);
            font-size: 14px;
            background: var(--bg-secondary);
            color: var(--text-primary);
            transition: all var(--transition-medium);
        }

        .field-row input:focus {
            outline: none;
            border-color: var(--brand-primary);
            box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.08);
            background: var(--bg-secondary);
        }

        .btn-row {
            display: flex;
            gap: 10px;
            margin-top: 16px;
        }

        .btn.small {
            padding: 7px 14px;
            font-size: 12px;
        }

        .hint {
            font-size: 11px;
            color: var(--text-muted);
            margin-top: 6px;
            line-height: 1.4;
        }

        /* ===== Video Detail Modal ===== */
        #videoDetailModal .modal {
            max-width: 900px;
            min-height: 80vh;
            display: flex;
            flex-direction: column;
            background: var(--bg-secondary);
        }

        #videoDetailModal .modal-body {
            flex: 1;
            display: flex;
            flex-direction: column;
            padding: 0;
            overflow: hidden;
        }

        .video-detail-header {
            padding: 20px 24px;
            border-bottom: 1px solid var(--border-light);
            background: var(--bg-secondary);
        }

        .video-detail-title {
            font-size: 18px;
            font-weight: 800;
            color: var(--text-primary);
            margin-bottom: 6px;
            display: flex;
            align-items: center;
            gap: 10px;
            letter-spacing: -0.02em;
        }

        .video-detail-meta {
            display: flex;
            gap: 16px;
            font-size: 13px;
            color: var(--text-secondary);
            flex-wrap: wrap;
        }

        .video-detail-meta-item {
            display: flex;
            align-items: center;
            gap: 6px;
        }

        .video-player-container {
            flex: 1;
            min-height: 0;
            display: flex;
            flex-direction: column;
            background: #000;
            position: relative;
        }

        .video-player {
            flex: 1;
            min-height: 0;
            background: #000;
            display: flex;
            align-items: center;
            justify-content: center;
            position: relative;
        }

        .video-player video {
            width: 100%;
            height: 100%;
            object-fit: contain;
            background: #000;
        }

        .video-player-placeholder {
            width: 100%;
            height: 100%;
            background: linear-gradient(135deg, #0f172a, #1e293b);
            display: flex;
            align-items: center;
            justify-content: center;
            color: var(--text-muted);
            font-size: 16px;
        }

        .video-action-bar {
            position: relative;
            left: 0;
            right: 0;
            background: var(--bg-card-solid);
            border-top: 1px solid var(--border-light);
            padding: 16px 24px;
            z-index: 1000;
            box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.04);
        }

        .video-actions-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
            gap: 10px;
        }

        .video-action-btn {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
            padding: 11px 16px;
            border-radius: var(--radius-md);
            background: var(--bg-secondary);
            border: 1px solid var(--border-medium);
            color: var(--text-primary);
            font-size: 13px;
            font-weight: 600;
            cursor: pointer;
            transition: all var(--transition-medium);
        }

        .video-action-btn:hover {
            transform: translateY(-1px);
            box-shadow: var(--shadow-sm);
        }

        .video-action-btn.primary {
            background: var(--brand-gradient);
            color: white;
            border: none;
            box-shadow: 0 2px 8px rgba(37, 99, 235, 0.2);
        }

        .video-action-btn.secondary {
            background: var(--bg-secondary);
            border: 1px solid var(--border-medium);
        }

        .video-action-btn i {
            font-size: 16px;
        }

        .video-drawers-container {
            position: relative;
            background: var(--bg-card-solid);
            border-top: 1px solid var(--border-light);
            z-index: 1000;
            max-height: 0;
            overflow: hidden;
            transition: max-height var(--transition-slow);
        }

        .video-drawers-container.open {
            max-height: 600px;
            overflow-y: auto;
        }

        .video-drawer {
            padding: 0;
            border-bottom: 1px solid var(--border-light);
        }

        .video-drawer:last-child {
            border-bottom: none;
        }

        .video-drawer-header {
            padding: 14px 24px;
            display: flex;
            align-items: center;
            justify-content: space-between;
            background: var(--bg-tertiary);
            cursor: pointer;
            transition: all var(--transition-medium);
        }

        .video-drawer-header:hover {
            background: rgba(37, 99, 235, 0.04);
        }

        .video-drawer-header.active {
            background: rgba(37, 99, 235, 0.06);
        }

        .video-drawer-header.active::before {
            content: '';
            position: absolute;
            left: 0;
            top: 0;
            bottom: 0;
            width: 3px;
            background: var(--brand-primary);
        }

        .video-drawer-title {
            font-size: 14px;
            font-weight: 700;
            color: var(--text-primary);
            display: flex;
            align-items: center;
            gap: 10px;
        }

        .video-drawer-icon {
            width: 20px;
            height: 20px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 16px;
        }

        .video-drawer-arrow {
            transition: transform var(--transition-medium);
            color: var(--text-muted);
        }

        .video-drawer-header.active .video-drawer-arrow {
            transform: rotate(180deg);
            color: var(--brand-primary);
        }

        .video-drawer-content {
            padding: 0;
            max-height: 0;
            overflow: hidden;
            transition: max-height var(--transition-slow), padding var(--transition-slow);
        }

        .video-drawer-header.active + .video-drawer-content {
            padding: 24px;
            max-height: 400px;
        }

        .drawer-form-group {
            margin-bottom: 16px;
        }

        .drawer-form-label {
            display: block;
            font-size: 12px;
            font-weight: 600;
            color: var(--text-secondary);
            margin-bottom: 8px;
            letter-spacing: 0.02em;
        }

        .drawer-form-control {
            width: 100%;
            padding: 11px 14px;
            font-size: 14px;
            border: 1px solid var(--border-medium);
            border-radius: var(--radius-md);
            background: var(--bg-secondary);
            transition: all var(--transition-medium);
            color: var(--text-primary);
            font-family: inherit;
        }

        .drawer-form-control:focus {
            outline: none;
            border-color: var(--brand-primary);
            box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.08);
            background: var(--bg-secondary);
        }

        .drawer-btn-group {
            display: flex;
            gap: 10px;
            margin-top: 20px;
            justify-content: flex-end;
        }

        .video-info-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
            gap: 16px;
            padding: 20px 24px;
            background: var(--bg-tertiary);
            border-top: 1px solid var(--border-light);
        }

        .video-info-item {
            display: flex;
            flex-direction: column;
            gap: 6px;
        }

        .video-info-label {
            font-size: 11px;
            color: var(--text-muted);
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 0.05em;
        }

        .video-info-value {
            font-size: 15px;
            font-weight: 700;
            color: var(--text-primary);
        }

        .status-badge-pill {
            display: inline-flex;
            align-items: center;
            padding: 5px 10px;
            border-radius: 16px;
            font-size: 11px;
            font-weight: 700;
            gap: 4px;
            border: 1px solid transparent;
        }

        .status-badge-pill i {
            font-size: 10px;
        }

        .status-queued-pill {
            background: rgba(245, 158, 11, 0.08);
            color: #d97706;
            border-color: rgba(245, 158, 11, 0.15);
        }
        .status-running-pill {
            background: rgba(37, 99, 235, 0.08);
            color: var(--brand-primary);
            border-color: rgba(37, 99, 235, 0.15);
        }
        .status-done-pill {
            background: rgba(16, 185, 129, 0.08);
            color: var(--brand-accent);
            border-color: rgba(16, 185, 129, 0.15);
        }
        .status-failed-pill {
            background: rgba(239, 68, 68, 0.08);
            color: #ef4444;
            border-color: rgba(239, 68, 68, 0.15);
        }

        .table-actions {
            display: flex;
            gap: 6px;
            flex-wrap: wrap;
        }

        .table-action-btn {
            padding: 5px 10px;
            border-radius: var(--radius-sm);
            font-size: 11px;
            font-weight: 700;
            border: 1px solid var(--border-light);
            background: var(--bg-tertiary);
            color: var(--text-primary);
            cursor: pointer;
            transition: all var(--transition-medium);
        }

        .table-action-btn:hover {
            transform: translateY(-1px);
            box-shadow: var(--shadow-xs);
            border-color: var(--border-glow);
        }

        .table-action-btn.primary {
            background: var(--brand-gradient);
            color: white;
            border: none;
            box-shadow: 0 1px 4px rgba(37, 99, 235, 0.15);
        }

        .table-action-btn.secondary {
            background: var(--bg-tertiary);
            border-color: var(--border-light);
        }

/* ===== V2.2 Player & Edit Area ===== */
.tg-video-modal-body{
  display:flex;
  flex-direction:column;
}
#vdVideoElement{
  display:block !important;
  max-height:45vh;
  width:100%;
  background:#000;
}
.tg-video-ops{
  flex:1;
  overflow:auto;
}

#tgCharInfoModal{position:fixed;inset:0;display:none;align-items:center;justify-content:center;background:rgba(15,23,42,.45);z-index:99999;padding:16px;backdrop-filter:blur(4px);}
#tgCharInfoModal .tg-charinfo-box{width:min(640px, 96vw);background:#fff;border-radius:var(--radius-xl);box-shadow:var(--shadow-2xl);overflow:hidden;border:1px solid var(--border-light);}
#tgCharInfoModal .tg-charinfo-head{display:flex;justify-content:flex-end;padding:12px 16px;border-bottom:1px solid var(--border-light);}
#tgCharInfoModal .tg-charinfo-close{cursor:pointer;border:0;background:var(--text-primary);color:#fff;border-radius:var(--radius-sm);padding:8px 14px;font-weight:700;font-size:12px;transition:all var(--transition-medium);}
#tgCharInfoModal .tg-charinfo-close:hover{opacity:0.85;}
#tgCharInfoModal .tg-charinfo-body{padding:16px 20px;max-height:70vh;overflow:auto;}
#tgCharInfoModal .tg-charinfo-row{display:flex;gap:12px;padding:10px 0;border-bottom:1px solid var(--border-light);}
#tgCharInfoModal .tg-charinfo-row:last-child{border-bottom:0;}
#tgCharInfoModal .tg-charinfo-row .k{width:110px;color:var(--text-muted);font-size:12px;font-weight:600;}
#tgCharInfoModal .tg-charinfo-row .v{flex:1;color:var(--text-primary);font-size:13px;word-break:break-all;}
#tgCharInfoModal .mono{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;}

.hidden-features-menu {
  position: fixed;
  left: var(--sidebar-width);
  bottom: 0;
  width: 320px;
  background: var(--bg-card);
  border-radius: var(--radius-lg) 0 0 var(--radius-lg);
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--border-light);
  z-index: 2000;
  transform: translateX(-320px);
  transition: transform var(--transition-medium), opacity var(--transition-medium), visibility var(--transition-medium);
  backdrop-filter: blur(20px);
  visibility: hidden;
  opacity: 0;
}

.hidden-features-menu.show {
  transform: translateX(0);
  visibility: visible;
  opacity: 1;
}

.hidden-features-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-light);
  background: var(--bg-tertiary);
  border-radius: var(--radius-lg) 0 0 0;
}

.hidden-features-header span {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}

.close-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: var(--bg-secondary);
  color: var(--text-muted);
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-medium);
}

.close-btn:hover {
  background: rgba(239, 68, 68, 0.08);
  color: var(--error-color);
  transform: rotate(90deg);
}

.hidden-features-list {
  padding: 12px;
  max-height: 400px;
  overflow-y: auto;
}

.hidden-feature-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-medium);
  text-decoration: none;
  border: 1px solid transparent;
}

.hidden-feature-item:hover {
  background: rgba(37, 99, 235, 0.04);
  border-color: var(--border-light);
  transform: translateX(2px);
}

.hidden-feature-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  background: var(--brand-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.2);
}

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

.hidden-feature-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 3px;
}

.hidden-feature-desc {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.4;
}

/* ===== Premium Toast Enhancement ===== */
#tgGlobalToast {
    font-family: var(--font-body) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    backdrop-filter: blur(12px) !important;
}

/* ===== Selection Style ===== */
::selection {
    background: rgba(37, 99, 235, 0.15);
    color: var(--text-primary);
}

/* ===== Smooth Page Transitions ===== */
@keyframes pageEnter {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

.app-main {
    animation: pageEnter 0.3s ease;
}

/* ===== Better Input Autofill ===== */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0 30px white inset !important;
    -webkit-text-fill-color: var(--text-primary) !important;
}

/* ===== Embedded Page Adjustments ===== */
/* When page is loaded in iframe, adjust height to fill iframe */
body.embedded {
  height: 100%;
  overflow-y: auto;
}

body.embedded .workbench-container,
body.embedded .workspace-container,
body.embedded .page-container {
  min-height: auto;
  height: 100%;
}

/* ===== Placeholder Style ===== */
::placeholder {
    color: var(--text-muted);
    opacity: 1;
}

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

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