:root {
    /* 核心色板 - Modern Palette */
    --primary-hue: 210;
    /* Blue */
    --primary-sat: 90%;
    --primary-lit: 58%;

    --color-primary: hsl(var(--primary-hue), var(--primary-sat), var(--primary-lit));
    --color-primary-hover: hsl(var(--primary-hue), var(--primary-sat), 48%);
    --color-primary-active: hsl(var(--primary-hue), var(--primary-sat), 40%);
    --color-primary-glow: hsla(var(--primary-hue), var(--primary-sat), var(--primary-lit), 0.3);

    /* Dark Mode Variables (Default base) */
    --bg-body: #0f172a;
    /* 深蓝黑背景 */
    --bg-card: #1e293b;
    /* 卡片背景 */
    --bg-card-hover: #263346;
    --bg-input: #0f172a;
    --border-color: #334155;
    --border-hover: #475569;

    --text-main: #f1f5f9;
    --text-muted: #94a3b8;

    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.3);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.3), 0 2px 4px -2px rgb(0 0 0 / 0.3);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.3), 0 4px 6px -4px rgb(0 0 0 / 0.3);

    /* Specific Colors */
    --color-success: #10b981;
    --color-warning: #f59e0b;
    --color-danger: #ef4444;
    --code-bg: #0d1117;

    /* Chat Colors */
    --chat-user-bg: var(--color-primary);
    --chat-user-text: #ffffff;
    --chat-ai-bg: #334155;
    --chat-ai-text: #f1f5f9;

    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 16px;

    --header-height: 70px;
    --nav-width-desktop: 450px;
}

body.light-theme {
    --bg-body: #f8fafc;
    /* 柔和灰白 */
    --bg-card: #ffffff;
    --bg-card-hover: #fcfcfc;
    --bg-input: #f1f5f9;
    --border-color: #e2e8f0;
    --border-hover: #cbd5e1;

    --text-main: #0f172a;
    --text-muted: #64748b;

    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);

    --chat-ai-bg: #f1f5f9;
    --chat-ai-text: #0f172a;
    --code-bg: #f1f5f9;
}

body.mobile-menu-open {
    overflow: hidden;
}

/* Mobile Menu Overlay */
.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: transparent; /* 不再给页面叠加灰色遮罩 */
    z-index: 900; /* 低于导航及头部，确保菜单和按钮可点击 */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    pointer-events: none;
}

.mobile-menu-overlay.is-active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* 确保导航栏在遮罩层之上 */
@media (max-width: 768px) {
    nav {
        z-index: 1000 !important; /* 确保导航栏在遮罩层之上 */
    }
}

/* --- Global Styles --- */
* {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    margin: 0;
    height: 100%;
    line-height: 1.6;
    transition: background-color 0.4s ease, color 0.4s ease;
    overflow-y: scroll;
    /* Prevent shift on modal open */
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
    height: 100%;
}

/* Main Layout */
.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* --- Header --- */
header {
    position: sticky;
    top: 10px;
    z-index: 1200; /* 高于移动遮罩层，避免遮挡菜单/主题按钮 */
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    margin-bottom: 30px;
    transition: all 0.3s ease;
}

/* Glassmorphism effect for header if supported */
@supports (backdrop-filter: blur(12px)) {
    header {
        background: color-mix(in srgb, var(--bg-card) 85%, transparent);
    }
}

.header-content {
    height: var(--header-height);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 24px;
}

header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
    background: linear-gradient(135deg, var(--color-primary) 0%, #8b5cf6 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: flex;
    align-items: center;
    gap: 12px;
    letter-spacing: -0.5px;
}

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

header h1 i {
    -webkit-text-fill-color: initial;
    /* Icon keeps its color or uses gradient */
    color: var(--color-primary);
    font-size: 1.2rem;
}

/* Navigation */
nav {
    display: flex;
    gap: 5px;
    background: var(--bg-input);
    padding: 5px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.nav-link {
    text-decoration: none;
    color: var(--text-muted);
    font-weight: 500;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-link:hover {
    color: var(--text-main);
    background-color: rgba(148, 163, 184, 0.1);
}

.nav-link.active {
    background-color: var(--bg-card);
    color: var(--color-primary);
    box-shadow: var(--shadow-sm);
    font-weight: 600;
}

/* Clear All Button */
.clear-all-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    width: 42px;
    height: 42px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin-left: 15px;
}

.clear-all-btn:hover {
    background: var(--bg-input);
    color: var(--color-danger);
    border-color: var(--color-danger);
    transform: scale(1.1);
    box-shadow: 0 0 15px -3px var(--color-danger);
}

/* Theme Toggle */
.theme-toggle {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    width: 42px;
    height: 42px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin-left: 15px;
}

.theme-toggle:hover {
    background: var(--bg-input);
    color: var(--color-warning);
    border-color: var(--color-warning);
    transform: rotate(15deg);
    box-shadow: 0 0 15px -3px var(--color-warning);
}

/* Menu Toggle */
.menu-toggle {
    display: none;
    /* Hidden on desktop */
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    width: 42px;
    height: 42px;
    border-radius: 50%;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 1001;
    /* Above nav */
}

.menu-toggle:hover {
    color: var(--color-primary);
    border-color: var(--color-primary);
}


/* --- Main Content --- */
main {
    flex: 1;
    animation: fadeIn 0.6s ease-out;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Tool Section Cards */
.tool-section {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 40px;
    box-shadow: var(--shadow-lg);
    margin-bottom: 40px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.tool-section:hover {
    border-color: var(--border-hover);
}

.tool-section h2 {
    margin-top: 0;
    font-size: 1.75rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 20px;
    margin-bottom: 30px;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 12px;
}

.tool-section h2 i {
    color: var(--color-primary);
    background: rgba(59, 130, 246, 0.1);
    /* Subtle bg for icon */
    padding: 10px;
    border-radius: 10px;
    font-size: 0.9em;
}

/* --- Inputs & Forms --- */
input[type="text"],
textarea,
select {
    width: 100%;
    background-color: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 14px 16px;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: inherit;
}

select {
    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 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 40px;
}

textarea {
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    line-height: 1.5;
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px var(--color-primary-glow), 0 4px 12px rgba(59, 130, 246, 0.15);
    background-color: var(--bg-card);
    transform: translateY(-1px);
}

select:hover {
    border-color: var(--border-hover);
    background-color: var(--bg-card);
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* --- Buttons --- */
button {
    background-color: var(--bg-input);
    color: var(--text-main);
    border: 1px solid var(--border-color);
    padding: 12px 24px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 0.95rem;
    position: relative;
    overflow: hidden;
    /* Important for scan lines */
}

button:hover {
    background-color: var(--bg-card-hover);
    border-color: var(--text-muted);
    transform: translateY(-1px);
}

button:active {
    transform: translateY(0);
}

.button-primary {
    background: var(--color-primary);
    color: #ffffff;
    border-color: transparent;
    box-shadow: 0 10px 18px rgba(59, 130, 246, 0.28);
}

.button-primary:hover {
    background: var(--color-primary-hover);
    box-shadow: 0 14px 24px rgba(59, 130, 246, 0.35);
    color: #fff;
}

.api-ghost-btn {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.12), rgba(59, 130, 246, 0.08));
    border: 1px solid rgba(59, 130, 246, 0.35);
    color: var(--color-primary);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.api-ghost-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(59, 130, 246, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.4s, height 0.4s;
}

.api-ghost-btn:hover::before {
    width: 200px;
    height: 200px;
}

.api-ghost-btn.subtle {
    background: transparent;
    border-style: dashed;
    border-color: var(--border-color);
    color: var(--text-muted);
}

.api-ghost-btn.subtle:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
    background: rgba(59, 130, 246, 0.05);
}

.api-ghost-btn:hover {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(59, 130, 246, 0.12));
    border-color: rgba(59, 130, 246, 0.6);
    color: var(--color-primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
}

/* --- API Debugger Layout --- */
#api-debugger {
    display: flex;
    flex-direction: column;
    gap: 32px;
    animation: fadeInUp 0.5s ease-out;
}

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

.api-debugger-heading {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    padding: 8px 0;
}

.api-debugger-heading h2 {
    margin: 0;
    border-bottom: none;
    padding-bottom: 0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.api-debugger-heading h2 i {
    background: linear-gradient(135deg, var(--color-primary), #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 1.1em;
}

.section-subtitle {
    margin: 8px 0 0;
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.6;
}

.api-debugger-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.api-vertical-stack {
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.api-panel {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 28px;
    box-shadow: var(--shadow-md);
    display: flex;
    flex-direction: column;
    gap: 24px;
    min-height: 100%;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.api-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--color-primary), #8b5cf6, var(--color-primary));
    background-size: 200% 100%;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.api-panel:hover {
    border-color: var(--border-hover);
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.api-panel:hover::before {
    opacity: 1;
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--border-color);
    transition: border-color 0.3s ease;
}

.api-panel:hover .panel-header {
    border-bottom-color: var(--color-primary);
}

.panel-header h3 {
    margin: 0;
    font-size: 1.3rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-main);
}

.panel-header h3 i {
    color: var(--color-primary);
    font-size: 1.1em;
    background: rgba(59, 130, 246, 0.1);
    padding: 8px;
    border-radius: 8px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.panel-collapse-btn {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    width: 40px;
    height: 40px;
    border-radius: 10px;
    color: var(--text-muted);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.panel-collapse-btn:hover {
    background: var(--bg-card-hover);
    border-color: var(--color-primary);
    color: var(--color-primary);
    transform: scale(1.05);
}

.panel-collapse-btn i {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.api-panel.collapsed .panel-collapse-btn i {
    transform: rotate(180deg);
}

.panel-body {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.api-panel.collapsed .panel-body {
    display: none;
}

.request-panel {
    position: relative;
}

.api-request-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.api-request-bar {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 20px;
    padding: 20px;
    background: var(--bg-input);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    transition: all 0.2s ease;
}

.api-request-bar:hover {
    border-color: var(--border-hover);
    box-shadow: var(--shadow-sm);
}

.api-request-sections {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.api-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.api-field label {
    margin-bottom: 0;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 6px;
}

.api-field label::before {
    content: '';
    width: 3px;
    height: 16px;
    background: var(--color-primary);
    border-radius: 2px;
}

.api-field select,
.api-field input {
    transition: all 0.2s ease;
}

.api-field select:focus,
.api-field input:focus {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
}

.api-field input.error {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
    animation: shake 0.3s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.api-card {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--bg-input) 0%, var(--bg-card) 100%);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.api-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(59, 130, 246, 0.05), transparent);
    transition: left 0.5s ease;
}

.api-card:hover {
    border-color: var(--color-primary);
    box-shadow: 0 8px 24px rgba(59, 130, 246, 0.12);
    transform: translateY(-2px);
}

.api-card:hover::after {
    left: 100%;
}

.api-card textarea {
    background: var(--bg-card);
    min-height: 140px;
}

/* CodeMirror编辑器容器美化 */
.api-card .CodeMirror {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--code-bg) !important;
    font-family: 'JetBrains Mono', 'Fira Code', monospace !important;
    font-size: 14px !important;
    transition: border-color 0.2s ease;
}

.api-card .CodeMirror:focus-within {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px var(--color-primary-glow);
}

.api-card .CodeMirror-scroll {
    overflow-x: auto !important;
    overflow-y: auto !important;
}

.api-card .CodeMirror-scrollbar-filler {
    background: transparent;
}

.api-card .CodeMirror-gutters {
    background: var(--code-bg) !important;
    border-right: 1px solid var(--border-color) !important;
}

.api-card .CodeMirror-linenumber {
    color: var(--text-muted) !important;
}

.api-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 4px;
}

.api-card-header strong {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 8px;
}

.api-card-header strong::before {
    content: '';
    width: 4px;
    height: 18px;
    background: var(--color-primary);
    border-radius: 2px;
}

.api-card-header p {
    margin: 6px 0 0;
    color: var(--text-muted);
    font-size: 0.875rem;
    line-height: 1.5;
}

.api-chip {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.15), rgba(59, 130, 246, 0.08));
    color: var(--color-primary);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 12px;
    border: 1px solid rgba(59, 130, 246, 0.3);
    white-space: nowrap;
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.1);
    transition: all 0.2s ease;
}

.api-chip:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(59, 130, 246, 0.2);
}

.api-chip.optional {
    background: linear-gradient(135deg, rgba(148, 163, 184, 0.15), rgba(148, 163, 184, 0.08));
    border-color: rgba(148, 163, 184, 0.3);
    color: var(--text-muted);
    box-shadow: 0 2px 4px rgba(148, 163, 184, 0.1);
}

.api-message {
    padding: 14px 18px;
    border-radius: var(--radius-md);
    font-size: 0.93rem;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.api-message::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: currentColor;
    opacity: 0.5;
}

.api-message.success {
    border-color: rgba(16, 185, 129, 0.4);
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.12), rgba(16, 185, 129, 0.06));
    color: var(--color-success);
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.15);
}

.api-message.error {
    border-color: rgba(239, 68, 68, 0.4);
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.12), rgba(239, 68, 68, 0.06));
    color: var(--color-danger);
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.15);
}

.api-message.info {
    border-color: rgba(59, 130, 246, 0.4);
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.12), rgba(59, 130, 246, 0.06));
    color: var(--color-primary);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.15);
}

.api-message.muted {
    background: linear-gradient(135deg, rgba(148, 163, 184, 0.08), rgba(148, 163, 184, 0.04));
    border-color: var(--border-color);
}

.api-actions-row {
    display: flex;
    justify-content: flex-end;
    padding-top: 8px;
}

#send-request {
    min-width: 140px;
    font-size: 1rem;
    padding: 14px 28px;
    font-weight: 600;
    letter-spacing: 0.3px;
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#send-request::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

#send-request:hover::before {
    width: 300px;
    height: 300px;
}

#send-request:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 24px rgba(59, 130, 246, 0.4);
}

#send-request.loading {
    cursor: not-allowed;
    opacity: 0.7;
    pointer-events: none;
}

#send-request.loading i {
    animation: spin 1s linear infinite;
}

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

#send-request:active {
    transform: translateY(0);
}

.response-panel {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.03) 0%, transparent 50%);
    position: relative;
}

.response-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--color-primary), transparent);
    opacity: 0.5;
}

.api-response-meta {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.meta-card {
    background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-input) 100%);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 18px 20px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.meta-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--color-primary);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.meta-card:hover {
    border-color: var(--color-primary);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
    transform: translateY(-2px);
}

.meta-card:hover::before {
    transform: scaleX(1);
}

.meta-card span {
    display: block;
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.meta-card strong {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-main);
    display: block;
    background: linear-gradient(135deg, var(--text-main), var(--color-primary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.response-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    margin-bottom: 8px;
    border-bottom: 2px solid var(--border-color);
}

.response-headers .response-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    margin-bottom: 8px;
    border-bottom: 2px solid var(--border-color);
}

.response-label {
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 10px;
}

.response-label i {
    color: var(--color-primary);
    font-size: 1.1em;
    background: rgba(59, 130, 246, 0.1);
    padding: 6px;
    border-radius: 6px;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.response-viewer {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--code-bg);
    overflow: hidden;
    transition: border-color 0.2s ease;
    position: relative;
}

.response-viewer:hover {
    border-color: var(--border-hover);
}

.response-viewer .CodeMirror {
    height: 360px;
    border: none;
    background: var(--code-bg) !important;
}

.response-viewer .CodeMirror-scroll {
    overflow-x: auto !important;
    overflow-y: auto !important;
}

.response-viewer.compact .CodeMirror {
    height: 220px;
}

.response-visual {
    display: none;
    padding: 16px;
    background: var(--bg-card);
    border-top: 1px solid var(--border-color);
    min-height: 180px;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.response-visual.show {
    display: flex;
}

.response-visual img {
    max-width: 100%;
    max-height: 420px;
    border-radius: var(--radius-md);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
}

.response-visual .preview-meta {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Toolbox */
.toolbox-block {
    margin-top: 28px;
    padding: 22px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    background: var(--bg-card);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.toolbox-block-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 16px;
}

.toolbox-block-header h3 {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.toolbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 14px;
}

.toolbox-grid.dense {
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}

.toolbox-card {
    display: flex;
    gap: 12px;
    padding: 14px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-card-hover);
    color: var(--text-main);
    text-decoration: none;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.toolbox-card:hover {
    transform: translateY(-2px);
    border-color: var(--color-primary);
    box-shadow: 0 8px 20px rgba(59, 130, 246, 0.18);
}

.toolbox-card .card-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.1rem;
}

.toolbox-card .card-icon.primary { background: linear-gradient(135deg, #3b82f6, #2563eb); }
.toolbox-card .card-icon.success { background: linear-gradient(135deg, #10b981, #0f9f79); }
.toolbox-card .card-icon.warning { background: linear-gradient(135deg, #f59e0b, #d97706); }
.toolbox-card .card-icon.info { background: linear-gradient(135deg, #06b6d4, #0891b2); }
.toolbox-card .card-icon.dark { background: linear-gradient(135deg, #475569, #1f2937); }

.toolbox-card .card-meta strong {
    display: block;
    font-size: 1rem;
    margin-bottom: 4px;
}

.toolbox-card .card-meta span {
    display: block;
    color: var(--text-muted);
    font-size: 0.92rem;
}

.toolbox-card .card-tags {
    margin-top: 8px;
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.toolbox-hint {
    margin-top: 14px;
    color: var(--text-muted);
    font-size: 0.92rem;
}

.toolbox-hint.small {
    font-size: 0.85rem;
    line-height: 1.5;
}

.toolbox-hint.centered-hint {
    text-align: center;
    margin-top: 10px;
}

.toolbox-panels {
    margin-top: 18px;
}

.toolbox-panel {
    display: none;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 18px;
    background: var(--bg-card);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.toolbox-panel.active {
    display: block;
}

.panel-heading {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

.panel-heading h3 {
    margin: 0;
    display: flex;
    gap: 8px;
    align-items: center;
}

.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    background: var(--bg-input);
    color: var(--text-main);
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

.back-btn:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
}

.panel-body.grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 16px;
    align-items: start;
}

.panel-card {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 14px;
    background: var(--bg-card-hover);
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.panel-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--border-color);
    position: relative;
}

.panel-card-header::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 60px;
    height: 2px;
    background: linear-gradient(90deg, var(--color-primary) 0%, transparent 100%);
}

.panel-card-header strong {
    font-size: 1rem;
}

.panel-card textarea {
    width: 100%;
    background: var(--bg-body);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 10px;
    color: var(--text-main);
    font-family: 'JetBrains Mono', monospace;
    margin-bottom: 8px;
}

.panel-card input[type="text"],
.panel-card input[type="number"] {
    width: 100%;
    background: var(--bg-body);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 10px;
    color: var(--text-main);
    margin-bottom: 8px;
}

.button-row {
    display: flex;
    gap: 10px;
    margin-bottom: 8px;
}

.flex-row {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}

.flex-column {
    display: flex;
    flex-direction: column;
}

.file-transfer-upload {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    margin-bottom: 10px;
}

.file-transfer-card {
    position: relative;
    padding-bottom: 64px; /* 给固定按钮留空间 */
}

.file-transfer-upload.drop-zone {
    border: 1px dashed var(--border-color);
    border-radius: var(--radius-md);
    padding: 18px;
    min-height: 140px;
    background: rgba(148, 163, 184, 0.05);
    transition: all 0.2s ease;
}

.file-transfer-upload.drop-zone.drag-hover {
    border-color: var(--color-primary);
    background: rgba(59, 130, 246, 0.08);
    box-shadow: 0 6px 16px rgba(59, 130, 246, 0.18);
}

.file-transfer-upload-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.file-transfer-filename {
    font-size: 0.9rem;
    color: var(--text-muted);
    max-width: 70%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-transfer-actions {
    align-items: center;
}

.file-transfer-list-wrapper {
    max-height: 400px;
    overflow-y: auto;
    overflow-x: hidden;
    margin-top: 4px;
}

.file-transfer-list-wrapper::-webkit-scrollbar {
    width: 6px;
}

.file-transfer-list-wrapper::-webkit-scrollbar-track {
    background: var(--bg-input);
    border-radius: 3px;
}

.file-transfer-list-wrapper::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.4);
    border-radius: 3px;
}

.file-transfer-list-wrapper::-webkit-scrollbar-thumb:hover {
    background: rgba(148, 163, 184, 0.6);
}

.file-transfer-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.file-transfer-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(148, 163, 184, 0.35);
    background: linear-gradient(135deg, var(--bg-input), var(--bg-card));
}

.file-transfer-item-name {
    font-size: 0.9rem;
    color: var(--text-main);
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-transfer-item-meta {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.file-transfer-item .button-primary.slim-btn {
    white-space: nowrap;
}

.file-transfer-controls {
    margin-top: 12px;
    margin-bottom: 8px;
}

.file-transfer-search-wrapper {
    position: relative;
    margin-bottom: 8px;
}

.file-transfer-search-wrapper .fa-search {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.85rem;
    z-index: 1;
    pointer-events: none; /* 保持这个设置 */
    line-height: 1;
}

.file-transfer-search-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-input);
    color: var(--text-main);
    font-size: 0.88rem;
    line-height: 1.5;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
    text-indent: 24px; /* 让文本向右缩进，给图标留出空间 */
}

.file-transfer-search-input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

.status-line {
    margin-top: 8px;
}

.file-transfer-hint {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.file-transfer-selected-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 10px 0 6px;
}

.file-chip {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    background: rgba(59, 130, 246, 0.08);
    border: 1px solid rgba(59, 130, 246, 0.2);
    font-size: 0.88rem;
    color: var(--text-main);
    max-width: 100%;
}

.file-chip-name {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-chip-remove {
    border: none;
    background: transparent;
    color: var(--text-muted);
    padding: 4px;
    cursor: pointer;
    font-size: 0.85rem;
}

.file-chip-remove:hover {
    color: var(--color-danger);
    transform: none;
}

.file-upload-btn-wrap {
    position: absolute;
    right: 12px;
    bottom: 12px;
}

.file-transfer-progress {
    width: 100%;
    background: rgba(148, 163, 184, 0.12);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    overflow: hidden;
    margin: 8px 0;
}

.file-transfer-progress-bar {
    width: 0%;
    height: 10px;
    background: linear-gradient(135deg, var(--color-primary), #8b5cf6);
    color: #fff;
    font-size: 0.75rem;
    text-align: right;
    padding-right: 6px;
    line-height: 10px;
    transition: width 0.2s ease;
}

.chip-muted {
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.15);
    color: var(--text-muted);
    font-size: 0.78rem;
}

.button-primary.slim-btn,
.api-ghost-btn.slim-btn {
    padding: 8px 12px;
    font-size: 0.92rem;
}

.favicon-preview {
    display: flex;
    align-items: center;
    gap: 16px;
}

#favicon-canvas {
    border: 1px dashed var(--border-color);
    background: var(--bg-body);
    border-radius: var(--radius-sm);
}

#favicon-preview-box {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.response-buttons {
    display: flex;
    gap: 8px;
}

.header-list {
    border: 1px dashed var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: var(--bg-input);
    transition: all 0.3s ease;
}

.header-list:hover {
    border-color: var(--color-primary);
    border-style: solid;
    background: var(--bg-card);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.1);
}

.header-list .header-item {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
    border-bottom: 1px solid rgba(148, 163, 184, 0.2);
    padding: 12px;
    padding-bottom: 12px;
    min-width: 0;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
    margin: 0 -4px;
}

.header-list .header-item:hover {
    background: var(--bg-card);
    border-bottom-color: var(--color-primary);
    transform: translateX(4px);
}

.header-list .header-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.header-item span {
    color: var(--text-muted);
    font-size: 0.9rem;
    flex-shrink: 0;
    white-space: nowrap;
}

.header-item code {
    font-family: 'JetBrains Mono', monospace;
    background: linear-gradient(135deg, rgba(148, 163, 184, 0.15), rgba(148, 163, 184, 0.08));
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    color: var(--text-main);
    word-break: break-all;
    word-wrap: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
    flex: 1;
    min-width: 0;
    border: 1px solid rgba(148, 163, 184, 0.2);
    transition: all 0.2s ease;
}

.header-item:hover code {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.15), rgba(59, 130, 246, 0.08));
    border-color: rgba(59, 130, 246, 0.3);
    color: var(--color-primary);
}

.header-list .empty {
    margin: 0;
    color: var(--text-muted);
    text-align: center;
}

.code-toggle-row {
    display: flex;
    justify-content: flex-end;
    margin-top: 12px;
    padding-top: 8px;
    border-top: 1px solid var(--border-color);
}

.code-expand-btn {
    background: var(--bg-input);
    border: 1px dashed var(--border-color);
    color: var(--text-muted);
    font-size: 0.85rem;
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    display: none;
    transition: all 0.2s ease;
    font-weight: 500;
}

.code-expand-btn:hover {
    color: var(--color-primary);
    border-color: var(--color-primary);
    border-style: solid;
    background: var(--bg-card);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.15);
}

.CodeMirror.code-collapsed {
    position: relative;
}

.CodeMirror.code-collapsed .CodeMirror-scroll {
    max-height: 320px;
    overflow: hidden;
}

.CodeMirror.code-collapsed::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 60px;
    pointer-events: none;
    background: linear-gradient(to bottom, transparent, var(--bg-body));
}

@media (max-width: 1024px) {
    .api-debugger-heading {
        flex-direction: column;
        align-items: flex-start;
    }

    .api-request-bar {
        grid-template-columns: 1fr;
    }
}

/* Primary Action Buttons */
button[id$="btn"]:not(.expand-toggle-btn),
/* Target IDs ending in btn */
#convert-curl,
#convert-timestamp {
    background: var(--color-primary);
    color: white;
    border: 1px solid transparent;
    box-shadow: 0 4px 6px rgba(59, 130, 246, 0.25);
}

button[id$="btn"]:not(.expand-toggle-btn):hover,
#convert-curl:hover,
#convert-timestamp:hover {
    background: var(--color-primary-hover);
    box-shadow: 0 6px 12px rgba(59, 130, 246, 0.35);
}

button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* --- FANCY LOADING ANIMATIONS --- */

@keyframes btn-gradient-flow {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

@keyframes btn-pulse-glow {
    0% {
        box-shadow: 0 0 0 0 rgba(97, 218, 251, 0.7);
    }

    70% {
        box-shadow: 0 0 0 12px rgba(97, 218, 251, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(97, 218, 251, 0);
    }
}

@keyframes btn-scan-line {
    0% {
        left: -100%;
    }

    100% {
        left: 200%;
    }
}

.btn-loading-fancy {
    background: linear-gradient(270deg, var(--color-primary), #8b5cf6, #ec4899, var(--color-primary)) !important;
    background-size: 300% 300% !important;
    animation: btn-gradient-flow 2s ease infinite, btn-pulse-glow 1.5s infinite !important;
    border-color: transparent !important;
    color: white !important;
    pointer-events: none;
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.5) !important;
}

/* Scan line effect */
.btn-loading-fancy::after {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(to right, transparent, rgba(255, 255, 255, 0.4), transparent);
    transform: skewX(-20deg);
    animation: btn-scan-line 1s linear infinite;
}

/* --- Tool Specifics --- */

/* 1. cURL Converter */
.curl-inputs-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 24px;
}

#curl-converter textarea {
    min-height: 180px;
    font-size: 0.9em;
}

.language-selector {
    background: var(--bg-input);
    padding: 15px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    display: inline-flex;
    align-items: center;
    gap: 15px;
    margin: 20px 0;
}

/* Output Tabs */
.output-switcher {
    display: flex;
    gap: 4px;
    margin-bottom: -1px;
    /* Overlap border */
    position: relative;
    z-index: 5;
}

.switch-btn {
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-muted);
    border-radius: 0;
    padding: 12px 20px;
}

.switch-btn:hover {
    color: var(--text-main);
    background: transparent;
    transform: none;
}

.switch-btn.active {
    color: var(--color-primary);
    border-bottom-color: var(--color-primary);
}

/* Code Editor Container */
.output-box {
    position: relative;
    border: 1px solid var(--border-color);
    border-radius: 0 var(--radius-sm) var(--radius-sm) var(--radius-sm);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.CodeMirror {
    height: auto !important;
    min-height: 200px;
    font-family: 'JetBrains Mono', 'Fira Code', monospace !important;
    font-size: 14px !important;
    line-height: 1.6 !important;
    background-color: var(--code-bg) !important;
}

/* 美化CodeMirror滚动条 */
.CodeMirror-scrollbar-filler {
    background: transparent;
}

.CodeMirror-scroll::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.CodeMirror-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.CodeMirror-scroll::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.3);
    border-radius: 4px;
    transition: background 0.2s ease;
}

.CodeMirror-scroll::-webkit-scrollbar-thumb:hover {
    background: rgba(148, 163, 184, 0.5);
}

/* 确保横向滚动条可见 */
.CodeMirror-scroll {
    overflow-x: auto !important;
    overflow-y: auto !important;
}

.cm-s-material-darker.CodeMirror {
    background-color: #0d1117 !important;
    /* Github Dark dim-ish */
}

/* Copy Button */
.copy-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 10;
    width: 36px !important;
    height: 36px !important;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--text-muted);
}

.copy-btn:hover {
    background: var(--color-primary);
    color: white;
    border-color: transparent;
}

.output-extra-actions {
    display: flex;
    justify-content: flex-end;
    margin: 12px 0 8px;
}

.output-extra-actions .slim-btn {
    padding: 8px 18px;
    font-size: 0.9rem;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-sm);
}

/* Custom File Upload Button */
.button-like-label {
    background-color: var(--bg-input);
    color: var(--text-muted);
    border: 1px solid var(--border-color);
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
}

.button-like-label:hover {
    background-color: var(--bg-card-hover);
    border-color: var(--text-muted);
    color: var(--text-main);
}

/* Diff Table */
#diff-container {
    margin-top: 40px;
    background: var(--bg-input);
    border-radius: var(--radius-md);
    padding: 20px;
    border: 1px solid var(--border-color);
}

.diff-table-wrapper {
    overflow-x: auto;
}

#diff-table {
    width: 100%;
    table-layout: fixed;
    border-collapse: separate;
    border-spacing: 0;
}

#diff-table th {
    text-align: left;
    padding: 12px 16px;
    border-bottom: 2px solid var(--border-color);
    color: var(--text-muted);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

#diff-table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-color);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9rem;
    vertical-align: top;
}

#diff-table tr:last-child td {
    border-bottom: none;
}

#diff-table td:first-child {
    color: var(--color-primary);
    font-weight: 600;
}

.diff-value {
    display: block;
    padding: 10px 12px;
    background: rgba(148, 163, 184, 0.08);
    border: 1px dashed var(--border-color);
    border-radius: var(--radius-sm);
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 140px;
    overflow: auto;
    line-height: 1.5;
}

.diff-value::-webkit-scrollbar {
    width: 4px;
    height: 4px;
}

.diff-value::-webkit-scrollbar-thumb {
    background: var(--color-primary);
    border-radius: 4px;
}

.diff-value::-webkit-scrollbar-track {
    background: transparent;
}

.diff-value.diff-empty {
    color: var(--text-muted);
    font-style: italic;
    text-align: center;
}

/* 2. Timestamp Converter */
#timestamp-converter .input-group {
    display: flex;
    gap: 12px;
    background: var(--bg-input);
    padding: 8px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

#timestamp-converter input {
    border: none;
    background: transparent;
    box-shadow: none;
    font-family: 'JetBrains Mono', monospace;
}

#timestamp-converter button {
    flex-shrink: 0;
    margin: 0;
    border-radius: var(--radius-sm);
}

.result-box {
    margin-top: 20px;
    padding: 20px;
    background: var(--bg-input);
    border-radius: var(--radius-md);
    border-left: 4px solid var(--color-primary);
    font-family: 'JetBrains Mono', monospace;
    min-height: 64px;
    display: flex;
    align-items: center;
    font-size: 1.1rem;
    color: var(--text-main);
}

/* 3. JSON Extractor */
#field-summary {
    display: inline-block;
    padding: 4px 12px;
    background: var(--bg-input);
    border-radius: 20px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

#fields-config-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
    background: transparent;
    border: none;
    padding: 0;
}

.field-item {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 16px;
    transition: all 0.2s;
}

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

.field-main {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

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

.field-item .original-name {
    font-weight: 600;
    color: var(--text-main);
    font-family: 'JetBrains Mono', monospace;
}

.field-item .rename-input {
    padding: 6px 10px;
    font-size: 0.85rem;
    border: 1px solid transparent;
    background: var(--bg-body);
}

.field-item .rename-input:focus {
    border-color: var(--color-primary);
    background: var(--bg-card);
}

.field-meta {
    padding-left: 30px;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.field-item-hidden {
    display: none;
}

/* Preview Table Enhanced */
.preview-table-wrapper {
    background: var(--bg-input);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    overflow: auto;
    position: relative;
}

#preview-table {
    width: 100%;
    border-collapse: collapse;
    /* Better for borders */
    font-size: 0.9em;
    table-layout: auto;
    /* Allow auto width but constrained by max-width cells */
}

#preview-table th {
    background: var(--bg-card);
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    text-align: left;
    padding: 12px 16px;
    position: sticky;
    top: 0;
    z-index: 2;
    box-shadow: 0 1px 0 var(--border-color);
    white-space: nowrap;
}

#preview-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-main);
    font-family: 'JetBrains Mono', monospace;
    max-width: 300px;
    /* Limit cell width */
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: background-color 0.1s;
}

#preview-table tr:hover td {
    background-color: var(--bg-card-hover);
}

/* Hidden Rows Logic */
.hidden-row {
    display: none;
}

.expand-toggle-container {
    margin-top: 15px;
    text-align: center;
}

/* Expand Button */
.expand-toggle-btn {
    display: block;
    width: 100%;
    background: transparent;
    border: 1px dashed var(--border-color);
    color: var(--text-muted);
    padding: 12px;
    text-align: center;
    cursor: pointer;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.expand-toggle-btn:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
    background: rgba(59, 130, 246, 0.05);
}

.expand-toggle-btn i {
    margin-right: 6px;
}

#ai-helper {
    display: flex;
    flex-direction: column;
    flex: 1; /* Changed from height: 100% to flex: 1 */
    min-height: 0; /* Crucial: allows flex child to shrink below content size */
    overflow: hidden; /* Crucial: contains content */
}

/* 4. AI Assistant */
.ai-panel {
    flex: 1;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.ai-history-container {
    flex: 1;
    background: transparent;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 30px;
    overflow-y: auto;
    min-height: 0;
}

.ai-thinking {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 12px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px 16px 16px 4px;
    width: fit-content;
    margin-bottom: 16px;
    animation: slideUp 0.3s ease-out;
}

.dot {
    width: 6px;
    height: 6px;
    background: var(--text-muted);
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out both;
}

.dot:nth-child(1) {
    animation-delay: -0.32s;
}

.dot:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes bounce {

    0%,
    80%,
    100% {
        transform: scale(0);
    }

    40% {
        transform: scale(1);
    }
}

.ai-message {
    display: flex;
    gap: 16px;
    animation: slideUp 0.3s ease-out;
    align-self: flex-start;
    /* Default to left alignment */
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ai-message.user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.ai-message.assistant {
    align-self: flex-start;
    max-width: 85%;
}

.ai-message .avatar {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    box-shadow: var(--shadow-sm);
    flex-shrink: 0;
}

.ai-message.user .avatar {
    background: var(--chat-user-bg);
    color: var(--chat-user-text);
    border: none;
}

.ai-message.assistant .avatar {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--color-primary);
}

.ai-message .content {
    padding: 12px 20px;
    border-radius: 20px;
    font-size: 0.98rem;
    line-height: 1.6;
    box-shadow: var(--shadow-md);
    position: relative;
    max-width: 100%;
    word-wrap: break-word;
}

.ai-message.user .content {
    background: var(--chat-user-bg);
    color: var(--chat-user-text);
    border-radius: 20px 4px 20px 20px;
}

.ai-message.assistant .content {
    background: var(--chat-ai-bg);
    color: var(--chat-ai-text);
    border: 1px solid var(--border-color);
    border-radius: 4px 20px 20px 20px;
}


/* Styling for code blocks rendered from Markdown */
.ai-message .content pre {
    background-color: #1e2331;
    padding: 16px;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(148, 163, 184, 0.25);
    box-shadow: inset 0 0 0 1px rgba(30, 41, 59, 0.55);
    overflow-x: auto;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9em;
    margin: 12px 0;
    position: relative;
    color: #e5eaf5;
}

body.light-theme .ai-message .content pre {
    background-color: #f1f3f6;
    border-color: rgba(148, 163, 184, 0.35);
    box-shadow: inset 0 0 0 1px rgba(226, 232, 240, 0.6);
    color: #0f172a;
}

.ai-message .content pre .copy-code-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--bg-body);
    color: var(--text-muted);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    width: 32px;
    height: 32px;
    padding: 0;
    opacity: 0;
    transition: opacity 0.2s, background-color 0.2s, color 0.2s;
    cursor: pointer;
}

.ai-message .content pre:hover .copy-code-btn {
    opacity: 1;
}

.ai-message .content pre .copy-code-btn:hover {
    background: var(--color-primary);
    color: white;
    border-color: transparent;
}


.ai-message .content code {
    font-family: 'JetBrains Mono', monospace;
    background-color: var(--bg-input);
    padding: 2px 5px;
    border-radius: 4px;
    font-size: 0.9em;
}

.ai-message .content pre code {
    background-color: transparent;
    padding: 0;
    border-radius: 0;
}

.ai-input-container {
    padding: 10px;
    background: var(--bg-card);
    border-top: 1px solid var(--border-color);
}

.ai-input-wrapper {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 6px 6px 6px 10px;
    /* Reduced left padding */
    display: flex;
    align-items: flex-end;
    transition: border-color 0.2s;
    margin-top: 10px;
    margin-bottom: -18px;
}

.ai-input-wrapper:focus-within {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.ai-input-wrapper textarea {
    background: transparent;
    border: none;
    padding: 10px 0;
    max-height: 120px;
    box-shadow: none;
}

.ai-input-wrapper textarea:focus {
    box-shadow: none;
}

#ai-send-btn {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    padding: 0;
    margin-left: 10px;
}

/* --- Footer --- */
footer {
    margin-top: auto;
    margin-bottom: auto;
    padding: 3px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.75rem;
    border-top: none;
}

/* Responsive Tweaks */
@media (max-width: 1024px) {
    .container {
        padding: 15px;
    }

    header {
        top: 5px;
    }
}


@media (max-width: 768px) {
    .header-content {
        padding: 0 15px;
    }

    header h1 span {
        display: none;
    }

    .header-right {
        gap: 10px;
    }

    /* Mobile Navigation */
    nav {
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        width: 280px;
        background: linear-gradient(165deg, rgba(15, 23, 42, 0.96), rgba(15, 23, 42, 0.85));
        border-left: 1px solid var(--border-color);
        flex-direction: column;
        padding: 80px 20px 20px;
        transform: translateX(100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 1000;
        gap: 15px;
        border-radius: 0;
        display: flex;
        box-shadow: -30px 0 60px rgba(2, 6, 23, 0.6);
        backdrop-filter: blur(18px);
        -webkit-backdrop-filter: blur(18px);
    }

    body.light-theme nav {
        background: linear-gradient(165deg, rgba(248, 250, 252, 0.98), rgba(226, 232, 240, 0.9));
        box-shadow: -30px 0 60px rgba(15, 23, 42, 0.15);
    }

    nav.is-active {
        transform: translateX(0);
    }

    .nav-link {
        font-size: 1.1rem;
        padding: 14px 16px;
        width: 100%;
        border: 1px solid transparent;
        background: rgba(148, 163, 184, 0.08);
        border-radius: var(--radius-md);
        box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02);
    }

    body.light-theme .nav-link {
        background: rgba(226, 232, 240, 0.75);
        box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.15);
    }

    .nav-link i {
        font-size: 1.2rem;
    }

    .nav-link:hover {
        background: rgba(59, 130, 246, 0.14);
        border-color: rgba(59, 130, 246, 0.35);
        color: var(--text-main);
    }

    .nav-link.active {
        background: rgba(59, 130, 246, 0.2);
        border-color: rgba(59, 130, 246, 0.6);
        color: var(--text-main);
        box-shadow: 0 8px 20px rgba(59, 130, 246, 0.25);
    }

    .menu-toggle {
        display: flex;
    }

    .curl-inputs-container {
        grid-template-columns: 1fr;
    }

    .tool-section {
        padding: 20px;
    }

    .ai-message {
        max-width: 95%;
    }
}

/* --- VS Code Light Theme Overrides --- */
body.light-theme .CodeMirror {
    background-color: #ffffff !important;
    color: #000000 !important;
    border-color: #e2e8f0 !important;
}

body.light-theme .CodeMirror-gutters {
    background-color: #ffffff !important;
    border-right: 1px solid #e2e8f0 !important;
}

body.light-theme .CodeMirror-linenumber {
    color: #237893 !important;
}

/* Syntax Highlighting Colors */
body.light-theme .cm-keyword {
    color: #0000ff !important;
    font-weight: bold;
}

body.light-theme .cm-operator {
    color: #000000 !important;
}

body.light-theme .cm-variable-2 {
    color: #001080 !important;
}

body.light-theme .cm-variable-3 {
    color: #001080 !important;
}

body.light-theme .cm-builtin {
    color: #0000ff !important;
}

body.light-theme .cm-atom {
    color: #0000ff !important;
}

body.light-theme .cm-number {
    color: #098658 !important;
}

body.light-theme .cm-def {
    color: #795e26 !important;
}

body.light-theme .cm-string {
    color: #a31515 !important;
}

body.light-theme .cm-string-2 {
    color: #a31515 !important;
}

body.light-theme .cm-comment {
    color: #008000 !important;
    font-style: italic;
}

body.light-theme .cm-variable {
    color: #001080 !important;
}

body.light-theme .cm-tag {
    color: #800000 !important;
}

body.light-theme .cm-attribute {
    color: #ff0000 !important;
}

body.light-theme .cm-property {
    color: #001080 !important;
}

body.light-theme .cm-meta {
    color: #800000 !important;
}

/* Selection and Cursor */
body.light-theme .CodeMirror-cursor {
    border-left: 1px solid #000000 !important;
}

body.light-theme .CodeMirror-selected {
    background: #add6ff !important;
}

body.light-theme .CodeMirror-line::selection,
body.light-theme .CodeMirror-line>span::selection,
body.light-theme .CodeMirror-line>span>span::selection {
    background: #add6ff !important;
}

/* Active Line */
body.light-theme .CodeMirror-activeline-background {
    background: #e8f2ff !important;
}

body.light-theme .CodeMirror-matchingbracket {
    color: #000000 !important;
    outline: 1px solid #bfbfbf;
    background-color: transparent !important;
}

/* Model Selector */
.model-selector {
    display: flex;
    gap: 4px;
    padding: 4px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 18px;
    margin-right: 8px;
    align-self: center;
    height: fit-content;
}

.model-btn {
    flex: 0 0 auto;
    width: 32px;
    height: 32px;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 50%;
    color: var(--text-muted);
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.model-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    transform: none;
}

.model-btn.active {
    background: var(--color-primary);
    color: white;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.25);
}

.model-btn i {
    font-size: 1rem;
}

@media (max-width: 768px) {
    .model-selector {
        padding: 3px;
    }

    .model-btn {
        width: 28px;
        height: 28px;
        font-size: 0.9rem;
    }
}

.preview-header .button-primary {
    padding: 6px 14px;
    font-size: 0.875rem;
    height: auto;
}

.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    background-color: var(--bg-card);
    min-width: 160px;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
    z-index: 100;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    padding: 5px 0;
    animation: fadeIn 0.2s ease-out;
}

.dropdown-content.show {
    display: block;
}

.dropdown-content a {
    color: var(--text-color);
    padding: 10px 15px;
    text-decoration: none;
    display: block;
    font-size: 0.9rem;
}

.dropdown-content a:hover {
    background-color: var(--bg-hover);
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000; /* 高于导航栏 (1200) 和侧边栏 (1000) */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

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

.modal-content {
    background-color: var(--bg-card);
    padding: 30px;
    border-radius: var(--radius-md);
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    width: 100%;
    max-width: 600px;
    transform: scale(0.95);
    transition: transform 0.3s ease;
    border: 1px solid var(--border-color);
}

.modal-content textarea {
    width: 100%;
    padding: 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    background: var(--bg-input);
    color: var(--text-main);
    font-family: 'JetBrains Mono', 'Consolas', monospace;
    font-size: 0.85rem;
    line-height: 1.5;
    resize: vertical;
    margin-bottom: 16px;
}

.modal-content textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.modal-overlay.show .modal-content {
    transform: scale(1);
}

.modal-content h4 {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 1.25rem;
}

.modal-content p {
    margin-top: 0;
    margin-bottom: 20px;
    color: var(--text-muted);
}

.modal-actions {
    margin-top: 30px;
    display: flex;
    justify-content: flex-end;
    gap: 15px;
}

.modal-actions button {
    padding: 10px 20px;
    height: auto;
}

.button-secondary {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-color);
}
.button-secondary:hover {
    background: var(--bg-hover);
}

/* Train Booking Styles */
.train-status-display {
    padding: 20px;
    border-radius: var(--radius-md);
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

/* ✨ 央视风格加载骨架屏 */
.train-status-display.loading {
    background: linear-gradient(
        90deg,
        var(--bg-input) 0%,
        rgba(var(--color-primary-rgb, 59, 130, 246), 0.05) 50%,
        var(--bg-input) 100%
    );
    background-size: 200% 100%;
    animation: skeleton-cctv-shimmer 2s ease-in-out infinite;
}

@keyframes skeleton-cctv-shimmer {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

.train-status-item {
    width: 100%;
    padding: 18px 22px;
    border-radius: var(--radius-md);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    transition: all 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
}

.train-status-item.status-pending {
    border-color: rgba(148, 163, 184, 0.3);
    background: linear-gradient(135deg, 
        rgba(148, 163, 184, 0.08) 0%, 
        rgba(148, 163, 184, 0.04) 100%);
    box-shadow: 0 2px 12px rgba(148, 163, 184, 0.1);
}

/* 🌟 粒子扩散效果 - 等待状态 */
.train-status-item.status-pending::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 50%, rgba(255, 255, 255, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 50%, rgba(255, 255, 255, 0.15) 0%, transparent 50%);
    background-size: 200% 100%;
    animation: status-particle-wave 3s ease-in-out infinite;
    opacity: 0.7;
}

/* 🌊 波纹脉冲 */
.train-status-item.status-pending::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 2px solid rgba(148, 163, 184, 0.3);
    transform: translate(-50%, -50%);
    animation: status-ripple-pulse 2.5s ease-out infinite;
}

@keyframes status-particle-wave {
    0%, 100% {
        background-position: 0% 50%;
        opacity: 0.5;
    }
    50% {
        background-position: 100% 50%;
        opacity: 0.8;
    }
}

@keyframes status-ripple-pulse {
    0% {
        width: 30px;
        height: 30px;
        opacity: 1;
        border-width: 2px;
    }
    100% {
        width: 150px;
        height: 150px;
        opacity: 0;
        border-width: 1px;
    }
}

.train-status-item.status-running {
    border-color: rgba(59, 130, 246, 0.5);
    background: linear-gradient(135deg, 
        rgba(59, 130, 246, 0.15) 0%, 
        rgba(59, 130, 246, 0.08) 100%);
    box-shadow: 0 4px 24px rgba(59, 130, 246, 0.2),
                0 0 0 1px rgba(59, 130, 246, 0.15),
                inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

/* 🌟 能量波动 - 多层次扫描线 */
.train-status-item.status-running::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        0deg,
        transparent 0px,
        transparent 2px,
        rgba(59, 130, 246, 0.05) 2px,
        rgba(59, 130, 246, 0.05) 4px
    );
    animation: status-scan-lines 8s linear infinite;
    z-index: 1;
    pointer-events: none;
}

/* 🔵 能量脉冲核心 */
.train-status-item.status-running::after {
    content: '';
    position: absolute;
    top: 0;
    left: -50%;
    width: 50%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(59, 130, 246, 0.08) 20%,
        rgba(59, 130, 246, 0.20) 40%,
        rgba(59, 130, 246, 0.35) 50%,
        rgba(59, 130, 246, 0.20) 60%,
        rgba(59, 130, 246, 0.08) 80%,
        transparent 100%
    );
    animation: status-energy-sweep 2.5s cubic-bezier(0.4, 0, 0.2, 1) infinite;
    z-index: 2;
    pointer-events: none;
}

@keyframes status-scan-lines {
    0% {
        transform: translateY(0);
    }
    100% {
        transform: translateY(4px);
    }
}

@keyframes status-energy-sweep {
    0% {
        left: -50%;
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        left: 100%;
        opacity: 0;
    }
}

/* 🌟 科技感进度条 */
.train-status-item.status-running {
    position: relative;
}

.train-status-item.status-running .train-status-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    width: 100%;
    background: rgba(59, 130, 246, 0.12);
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    overflow: hidden;
}

/* 🔵 双层进度光束 */
.train-status-item.status-running .train-status-progress::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 30%;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(59, 130, 246, 0.5) 20%,
        rgba(59, 130, 246, 1) 50%,
        rgba(59, 130, 246, 0.5) 80%,
        transparent 100%
    );
    animation: status-progress-primary 1.8s ease-in-out infinite;
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.8);
}

/* ⚡ 快速追踪光束 */
.train-status-item.status-running .train-status-progress::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 15%;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.8) 50%,
        transparent 100%
    );
    animation: status-progress-secondary 1.2s ease-in-out infinite;
    animation-delay: 0.3s;
}

@keyframes status-progress-primary {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(400%);
    }
}

@keyframes status-progress-secondary {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(700%);
    }
}

/* 购票信息细节展示 */
.train-selected-summary {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
}

.train-selected-info-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 12px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.train-selected-info-item:hover {
    border-color: var(--color-primary);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.train-selected-info-item.two-col {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    padding: 8px 12px;
}

.train-selected-info-item.two-col > div {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.train-selected-info-label {
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 4px;
}

.train-selected-info-label::before {
    content: '';
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: var(--color-primary);
    opacity: 0.6;
    flex-shrink: 0;
}

.train-selected-info-value {
    color: var(--text-main);
    font-weight: 600;
    font-size: 0.95rem;
    text-align: right;
    white-space: nowrap;
}

.train-selected-info-item.two-col .train-selected-info-value {
    text-align: left;
}

.train-seat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 8px;
    margin: 12px 0 16px;
}

.train-seat-empty-hint {
    padding: 16px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
    background: var(--bg-input);
    border: 1px dashed var(--border-color);
    border-radius: var(--radius-sm);
    margin: 12px 0 16px;
}

.train-seat-empty-hint i {
    margin-right: 6px;
    opacity: 0.7;
}

.train-seat-card {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    transition: all 0.2s ease;
    cursor: default;
}

.train-seat-card:hover {
    border-color: var(--color-primary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.train-seat-name {
    color: var(--text-main);
    font-weight: 600;
    font-size: 0.85rem;
}

.train-seat-num {
    color: var(--color-primary);
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: 0.5px;
    transition: color 0.3s ease;
}

.train-seat-num.train-seat-available {
    color: #10b981;
    font-weight: 700;
    text-shadow: 0 0 6px rgba(16, 185, 129, 0.25);
}

.train-seat-price {
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 500;
}

/* 购票信息界面美化 */
.train-booking-actions {
    display: flex;
    gap: 12px;
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

.train-booking-actions .button-primary {
    flex: 1;
    padding: 12px 24px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    position: relative;
    overflow: hidden;
}

.train-booking-actions .button-primary::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.train-booking-actions .button-primary:hover::before {
    width: 300px;
    height: 300px;
}

.train-booking-actions .button-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.train-booking-actions .button-primary:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(59, 130, 246, 0.2);
}

.train-booking-actions .button-primary span,
.train-booking-actions .button-primary i {
    position: relative;
    z-index: 1;
}

.train-btn-arrow {
    transition: transform 0.3s ease;
}

.train-booking-actions .button-primary:hover .train-btn-arrow {
    transform: translateX(4px);
}

/* 查询按钮美化 */
.train-query-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, var(--color-primary) 0%, #4f46e5 100%);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.train-query-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.train-query-btn:hover::before {
    width: 300px;
    height: 300px;
}

.train-query-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(59, 130, 246, 0.4);
    background: linear-gradient(135deg, #4f46e5 0%, var(--color-primary) 100%);
}

.train-query-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.train-query-btn span,
.train-query-btn i {
    position: relative;
    z-index: 1;
}

.train-btn-icon {
    animation: train-move 2s ease-in-out infinite;
}

@keyframes train-move {
    0%, 100% {
        transform: translateX(0);
    }
    50% {
        transform: translateX(3px);
    }
}

/* 购票按钮美化 */
.train-booking-btn {
    background: linear-gradient(135deg, var(--color-primary) 0%, #4f46e5 100%);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.train-booking-btn:hover {
    background: linear-gradient(135deg, #4f46e5 0%, var(--color-primary) 100%);
}

/* 预定按钮美化 */
.train-reserve-btn {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.train-reserve-btn:hover {
    background: linear-gradient(135deg, #059669 0%, #10b981 100%);
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.4);
}

/* 座次余票信息区域 */
.train-seat-info-section {
    margin-top: 12px;
    padding: 16px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--bg-card) 0%, rgba(16, 185, 129, 0.02) 100%);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.train-seat-info-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 12px;
    gap: 8px;
    font-size: 1rem;
}

.train-seat-info-header i {
    color: var(--primary-color);
}

.train-passenger-section {
    margin-top: 12px;
    padding: 16px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--bg-card) 0%, rgba(59, 130, 246, 0.02) 100%);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.train-passenger-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 12px;
    gap: 8px;
    font-size: 1rem;
}

.train-passenger-hint {
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 400;
}

.train-passenger-placeholder {
    font-size: 0.9rem;
    line-height: 1.5;
}

.train-passenger-select {
    width: 100%;
    padding: 10px 12px;
    padding-right: 36px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-input);
    color: var(--text-main);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    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='%23666' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 12px;
}

.train-passenger-select:hover {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 1px var(--color-primary-glow);
}

.train-passenger-select:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px var(--color-primary-glow);
}

.train-passenger-detail {
    margin-top: 12px;
    padding: 12px;
    background: var(--bg-input);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
}

.train-passenger-detail-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.train-passenger-detail-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
}

.train-passenger-detail-value {
    font-size: 0.95rem;
    color: var(--text-main);
    font-weight: 600;
}

/* 席别选择优化 */
.seat-type-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    margin-top: 8px;
    margin-bottom: 16px;
}

.seat-type-icon {
    position: absolute;
    left: 12px;
    color: var(--color-primary);
    font-size: 0.95rem;
    pointer-events: none;
    z-index: 1;
}

#train-seat-type,
#train-reserve-seat-type {
    width: 100%;
    padding: 10px 12px 10px 40px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-input);
    color: var(--text-main);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    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='%23666' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 12px;
}

#train-seat-type:hover,
#train-reserve-seat-type:hover {
    border-color: var(--color-primary);
    background: var(--bg-card);
    box-shadow: 0 0 0 1px var(--color-primary-glow);
}

#train-seat-type:focus,
#train-reserve-seat-type:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    background: var(--bg-card);
}

/* 车次输入框美化 */
.train-no-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.train-no-icon {
    position: absolute;
    left: 12px;
    color: var(--color-primary);
    font-size: 0.95rem;
    pointer-events: none;
    z-index: 1;
}

.train-no-input-wrapper input[type="text"] {
    width: 100%;
    padding: 10px 12px 10px 40px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-input);
    color: var(--text-main);
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.train-no-input-wrapper input[type="text"]:hover {
    border-color: var(--color-primary);
    background: var(--bg-card);
}

.train-no-input-wrapper input[type="text"]:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    background: var(--bg-card);
}

/* 日期时间输入框美化 */
.datetime-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    margin-top: 8px;
}

.datetime-icon {
    position: absolute;
    left: 14px;
    color: var(--color-primary);
    font-size: 1rem;
    pointer-events: none;
    z-index: 1;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    filter: drop-shadow(0 0 4px rgba(59, 130, 246, 0.3));
}

.datetime-input-wrapper:hover .datetime-icon {
    color: var(--color-primary);
    transform: scale(1.1);
    filter: drop-shadow(0 0 6px rgba(59, 130, 246, 0.5));
}

.datetime-input-wrapper input[type="datetime-local"]:focus ~ .datetime-icon {
    color: var(--color-primary);
    transform: scale(1.15);
    filter: drop-shadow(0 0 8px rgba(59, 130, 246, 0.6));
}

.datetime-input-wrapper input[type="datetime-local"] {
    width: 100%;
    padding: 12px 16px 12px 44px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--bg-input) 0%, rgba(30, 41, 59, 0.5) 100%);
    color: var(--text-main);
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.datetime-input-wrapper input[type="datetime-local"]:hover {
    border-color: var(--color-primary);
    background: linear-gradient(135deg, var(--bg-card) 0%, rgba(30, 41, 59, 0.7) 100%);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15), 0 0 0 1px rgba(59, 130, 246, 0.1);
    transform: translateY(-1px);
}

.datetime-input-wrapper input[type="datetime-local"]:focus {
    outline: none;
    border-color: var(--color-primary);
    background: linear-gradient(135deg, var(--bg-card) 0%, rgba(30, 41, 59, 0.8) 100%);
    box-shadow: 0 0 0 4px var(--color-primary-glow),
                0 4px 16px rgba(59, 130, 246, 0.25),
                0 0 0 1px var(--color-primary);
    transform: translateY(-1px);
}

.datetime-input-wrapper input[type="datetime-local"]::-webkit-calendar-picker-indicator {
    cursor: pointer;
    opacity: 0;
    position: absolute;
    right: 0;
    width: 100%;
    height: 100%;
}

/* 亮色主题下的时间输入框优化 */
body.light-theme .datetime-input-wrapper input[type="datetime-local"] {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

body.light-theme .datetime-input-wrapper input[type="datetime-local"]:hover {
    background: linear-gradient(135deg, #ffffff 0%, #f1f5f9 100%);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.12), 0 0 0 1px rgba(59, 130, 246, 0.08);
}

body.light-theme .datetime-input-wrapper input[type="datetime-local"]:focus {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15),
                0 4px 16px rgba(59, 130, 246, 0.2),
                0 0 0 1px var(--color-primary);
}

/* 开售时间输入框优化 */
#train-sale-time-wrapper {
    margin-top: 12px;
    margin-bottom: 16px;
}

.train-passenger-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.train-passenger-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 14px;
    border-radius: var(--radius-md);
    border: 2px solid var(--border-color);
    background: var(--bg-card);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: relative;
    overflow: hidden;
}

.train-passenger-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(59, 130, 246, 0.05) 50%,
        transparent 100%
    );
    transition: left 0.4s ease;
}

.train-passenger-item:hover {
    border-color: var(--color-primary);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15),
                0 0 0 1px rgba(59, 130, 246, 0.2);
    transform: translateX(4px);
    background: linear-gradient(135deg, var(--bg-card) 0%, rgba(59, 130, 246, 0.05) 100%);
}

.train-passenger-item:hover::before {
    left: 100%;
}

.train-passenger-item input[type="radio"] {
    margin-top: 4px;
}

.train-passenger-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.train-passenger-name-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
}

.train-passenger-name {
    font-weight: 600;
    color: var(--text-main);
}

.train-passenger-type {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.train-passenger-sub {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.train-status-item.status-success {
    border-color: rgba(16, 185, 129, 0.4);
    background: linear-gradient(135deg, 
        rgba(16, 185, 129, 0.12) 0%, 
        rgba(16, 185, 129, 0.06) 100%);
    box-shadow: 0 4px 20px rgba(16, 185, 129, 0.2),
                0 0 0 1px rgba(16, 185, 129, 0.1);
    animation: status-success-fade-in 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* ✅ 成功状态 - 扩散光环 */
.train-status-item.status-success::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 2px solid rgba(16, 185, 129, 0.4);
    transform: translate(-50%, -50%);
    animation: status-success-ring 2s ease-out infinite;
}

/* ✨ 成功光芒 */
.train-status-item.status-success::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(
        circle at center,
        rgba(16, 185, 129, 0.15) 0%,
        rgba(16, 185, 129, 0.08) 30%,
        transparent 60%
    );
    animation: status-success-glow 3s ease-in-out infinite;
    pointer-events: none;
}

@keyframes status-success-ring {
    0% {
        width: 60px;
        height: 60px;
        opacity: 1;
    }
    100% {
        width: 180px;
        height: 180px;
        opacity: 0;
    }
}

@keyframes status-success-glow {
    0%, 100% {
        opacity: 0.5;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(1.05);
    }
}

.train-status-item.status-failed,
.train-status-item.status-error {
    border-color: rgba(239, 68, 68, 0.4);
    background: linear-gradient(135deg, 
        rgba(239, 68, 68, 0.12) 0%, 
        rgba(239, 68, 68, 0.06) 100%);
    box-shadow: 0 4px 20px rgba(239, 68, 68, 0.2),
                0 0 0 1px rgba(239, 68, 68, 0.1);
    animation: status-error-fade-in 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* ❌ 失败状态 - 警示闪烁 */
.train-status-item.status-failed::before,
.train-status-item.status-error::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(239, 68, 68, 0.08);
    animation: status-error-flash 2s ease-in-out infinite;
}

/* ⚠️ 错误辐射 */
.train-status-item.status-failed::after,
.train-status-item.status-error::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 2px solid rgba(239, 68, 68, 0.5);
    transform: translate(-50%, -50%);
    animation: status-error-radiate 1.5s ease-out infinite;
}

@keyframes status-error-flash {
    0%, 100% {
        opacity: 0.3;
    }
    15%, 35% {
        opacity: 1;
    }
    50%, 70% {
        opacity: 0.3;
    }
}

@keyframes status-error-radiate {
    0% {
        width: 50px;
        height: 50px;
        opacity: 1;
        border-width: 2px;
    }
    100% {
        width: 150px;
        height: 150px;
        opacity: 0;
        border-width: 1px;
    }
}

/* 丝滑的状态动画 */
/* ✨ 央视风格流光动画 */
@keyframes status-smooth-shimmer {
    0% {
        left: -150%;
        opacity: 0;
    }
    20% {
        opacity: 1;
    }
    80% {
        opacity: 1;
    }
    100% {
        left: 150%;
        opacity: 0;
    }
}

@keyframes status-smooth-flow {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

/* 旧的 status-breathe 动画已被 status-cctv-breathe 替换 */


@keyframes status-success-fade-in {
    0% {
        opacity: 0;
        transform: translateY(-10px) scale(0.98);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes status-success-ripple {
    0%, 100% {
        opacity: 0.3;
        transform: scale(1);
    }
    50% {
        opacity: 0.5;
        transform: scale(1.08);
    }
}

@keyframes status-error-fade-in {
    0% {
        opacity: 0;
        transform: translateY(-8px) scale(0.98);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.train-status-label {
    font-weight: 600;
    font-size: 1.05rem;
    color: var(--text-main);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
    z-index: 1;
}

.train-status-label::before {
    content: '';
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.train-status-item.status-pending .train-status-label::before {
    background: rgba(148, 163, 184, 0.9);
    box-shadow: 0 0 0 0 rgba(148, 163, 184, 0.4);
    animation: status-dot-smooth-pulse 2s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

.train-status-item.status-running .train-status-label::before {
    background: rgba(59, 130, 246, 1);
    box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.6);
    animation: status-dot-running-pulse 1.8s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

.train-status-item.status-success .train-status-label::before {
    background: rgba(16, 185, 129, 1);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.6);
    animation: status-dot-success-pulse 2s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

.train-status-item.status-failed .train-status-label::before,
.train-status-item.status-error .train-status-label::before {
    background: rgba(239, 68, 68, 1);
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.6);
    animation: status-dot-error-pulse 2s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

/* 🌟 状态指示点动画 - 科技风格 */
@keyframes status-dot-smooth-pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(148, 163, 184, 0.4);
    }
    50% {
        transform: scale(1.15);
        box-shadow: 0 0 0 5px rgba(148, 163, 184, 0);
    }
}

/* ⚡ 运行中 - 能量脉冲 */
@keyframes status-dot-running-pulse {
    0% {
        transform: scale(1);
        box-shadow: 
            0 0 0 0 rgba(59, 130, 246, 0.7),
            0 0 8px rgba(59, 130, 246, 0.3);
    }
    25% {
        transform: scale(1.25);
        box-shadow: 
            0 0 0 4px rgba(59, 130, 246, 0.3),
            0 0 15px rgba(59, 130, 246, 0.5);
    }
    50% {
        transform: scale(1);
        box-shadow: 
            0 0 0 8px rgba(59, 130, 246, 0),
            0 0 20px rgba(59, 130, 246, 0.6);
    }
    75% {
        transform: scale(1.25);
        box-shadow: 
            0 0 0 4px rgba(59, 130, 246, 0.3),
            0 0 15px rgba(59, 130, 246, 0.5);
    }
    100% {
        transform: scale(1);
        box-shadow: 
            0 0 0 0 rgba(59, 130, 246, 0.7),
            0 0 8px rgba(59, 130, 246, 0.3);
    }
}

/* ✅ 成功 - 扩散波纹 */
@keyframes status-dot-success-pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.6);
    }
    50% {
        transform: scale(1.12);
        box-shadow: 0 0 0 6px rgba(16, 185, 129, 0);
    }
}

/* ❌ 错误 - 警示闪烁 */
@keyframes status-dot-error-pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.6);
    }
    15% {
        transform: scale(1.2);
        box-shadow: 0 0 0 6px rgba(239, 68, 68, 0);
    }
    30% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.6);
    }
    45% {
        transform: scale(1.2);
        box-shadow: 0 0 0 6px rgba(239, 68, 68, 0);
    }
    60% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.6);
    }
}

.train-status-item.status-pending .train-status-label {
    color: var(--text-muted);
}

.train-status-item.status-running .train-status-label {
    color: var(--color-primary);
}

.train-status-item.status-success .train-status-label {
    color: var(--color-success);
}

.train-status-item.status-failed .train-status-label,
.train-status-item.status-error .train-status-label {
    color: var(--color-danger);
}

.train-status-message {
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.6;
    word-wrap: break-word;
    position: relative;
    z-index: 1;
    padding-left: 22px;
    animation: status-message-fade-in 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

@keyframes status-message-fade-in {
    0% {
        opacity: 0;
        transform: translateY(5px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.train-status-item.status-success .train-status-message {
    color: var(--color-success);
    opacity: 0.9;
}

.train-status-item.status-failed .train-status-message,
.train-status-item.status-error .train-status-message {
    color: var(--color-danger);
    opacity: 0.9;
}

.train-log-display {
    margin-top: 15px;
}

.train-log-display textarea {
    width: 100%;
    padding: 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    background: var(--code-bg);
    color: var(--text-main);
    font-family: 'JetBrains Mono', 'Consolas', monospace;
    font-size: 0.85rem;
    line-height: 1.5;
    resize: vertical;
}

.train-log-display textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}


/* Train Booking Enhanced Styles */
.train-step {
    margin-bottom: 24px;
}

.train-query-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

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

.train-query-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.inline-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    color: var(--text-main);
}

.inline-label i {
    color: var(--color-primary);
    font-size: 0.9rem;
}

/* 日期选择器美化 */
.date-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.date-icon {
    position: absolute;
    left: 12px;
    color: var(--color-primary);
    font-size: 1rem;
    pointer-events: none;
    z-index: 1;
}

.date-input-wrapper input[type="date"] {
    width: 100%;
    padding: 10px 12px 10px 40px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-input);
    color: var(--text-main);
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.3s ease;
    cursor: pointer;
}

.date-input-wrapper input[type="date"]:hover {
    border-color: var(--color-primary);
    background: var(--bg-card);
}

.date-input-wrapper input[type="date"]:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    background: var(--bg-card);
}

.date-input-wrapper input[type="date"]::-webkit-calendar-picker-indicator {
    cursor: pointer;
    opacity: 0;
    position: absolute;
    right: 0;
    width: 100%;
    height: 100%;
}

.station-search-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.station-input-icon {
    position: absolute;
    left: 12px;
    color: var(--color-primary);
    font-size: 0.95rem;
    pointer-events: none;
    z-index: 1;
}

.station-search-wrapper input[type="text"] {
    width: 100%;
    padding: 10px 12px 10px 40px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-input);
    color: var(--text-main);
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.station-search-wrapper input[type="text"]:hover {
    border-color: var(--color-primary);
    background: var(--bg-card);
}

.station-search-wrapper input[type="text"]:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    background: var(--bg-card);
}

.station-search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 100;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    margin-top: 4px;
    max-height: 200px;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    display: none;
}

.station-search-results.show {
    display: block;
}

.station-search-item {
    padding: 10px 14px;
    cursor: pointer;
    transition: background 0.2s ease;
    border-bottom: 1px solid var(--border-color);
}

.station-search-item:last-child {
    border-bottom: none;
}

.station-search-item:hover {
    background: var(--bg-input);
}

.station-search-item-name {
    font-weight: 600;
    color: var(--text-main);
    font-size: 0.95rem;
}

.station-search-item-code {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.train-list-container {
    margin-top: 16px;
}

/* 筛选器样式 */
.train-filter-container {
    background: linear-gradient(135deg, var(--bg-card) 0%, rgba(59, 130, 246, 0.03) 100%);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.train-filter-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
    align-items: start;
}

.train-filter-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
    justify-content: flex-start;
}

.filter-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 6px;
    height: 20px;
    line-height: 20px;
    margin-bottom: 2px;
}

.filter-label i {
    color: var(--color-primary);
    font-size: 0.8rem;
}

.filter-select {
    width: 100%;
    padding: 10px 12px;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-input);
    color: var(--text-main);
    font-size: 0.9rem;
    line-height: 1.4;
    height: 40px;
    box-sizing: border-box;
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-select:hover {
    border-color: var(--color-primary);
    background: var(--bg-card);
}

.filter-select:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    background: var(--bg-card);
}

/* 车次搜索框样式 */
.train-search-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.train-search-icon {
    position: absolute;
    left: 12px;
    color: var(--color-primary);
    font-size: 0.9rem;
    pointer-events: none;
    z-index: 1;
}

.filter-input {
    width: 100%;
    padding: 10px 12px 10px 36px;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-input);
    color: var(--text-main);
    font-size: 0.9rem;
    line-height: 1.4;
    height: 40px;
    box-sizing: border-box;
    transition: all 0.2s ease;
}

.filter-input:hover {
    border-color: var(--color-primary);
    background: var(--bg-card);
}

.filter-input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    background: var(--bg-card);
}

.filter-input::placeholder {
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* 筛选器中的按钮样式统一 */
.train-filter-item .button-secondary.slim-btn {
    height: 40px;
    padding: 10px 16px;
    font-size: 0.9rem;
    line-height: 1.4;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: auto;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    background: linear-gradient(135deg, var(--bg-input) 0%, var(--bg-card) 100%);
    border: 1.5px solid var(--border-color);
    color: var(--text-main);
    font-weight: 500;
}

.train-filter-item .button-secondary.slim-btn:hover {
    background: linear-gradient(135deg, var(--color-primary) 0%, #4f46e5 100%);
    border-color: var(--color-primary);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.train-filter-item .button-secondary.slim-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(59, 130, 246, 0.2);
}

.train-filter-item .button-secondary.slim-btn i {
    transition: transform 0.3s ease;
}

/* 重置按钮动画效果 */
.train-filter-item .button-secondary.slim-btn.reset-animation {
    animation: reset-pulse 0.6s ease-out;
}

.train-filter-item .button-secondary.slim-btn.reset-animation i {
    animation: reset-rotate 0.6s ease-out;
}

@keyframes reset-pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 2px 6px rgba(59, 130, 246, 0.2);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 4px 16px rgba(59, 130, 246, 0.4);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 2px 6px rgba(59, 130, 246, 0.2);
    }
}

@keyframes reset-rotate {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(-360deg);
    }
}

@media (max-width: 768px) {
    .train-filter-row {
        grid-template-columns: 1fr;
    }
}

.train-item {
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 10px;
    margin-bottom: 8px;
    background: linear-gradient(135deg, var(--bg-card) 0%, rgba(59, 130, 246, 0.02) 100%);
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    cursor: default;
    position: relative;
    overflow: hidden;
}

.train-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(59, 130, 246, 0.05) 50%,
        transparent 100%
    );
    transition: left 0.5s ease;
}

.train-item:hover::before {
    left: 100%;
}

.train-item:hover {
    border-color: var(--color-primary);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.2),
                0 0 0 1px rgba(59, 130, 246, 0.1);
    transform: translateY(-3px);
    background: linear-gradient(135deg, var(--bg-card) 0%, rgba(59, 130, 246, 0.05) 100%);
}

.train-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2px;
    flex-wrap: wrap;
    gap: 4px;
}

.train-item-title {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1;
    min-width: 180px;
}

.train-icon {
    color: var(--color-primary);
    font-size: 0.85rem;
}

.route-icon {
    color: var(--color-primary);
    font-size: 0.7rem;
    margin-right: 3px;
}

.route-arrow {
    color: var(--text-muted);
    font-size: 0.65rem;
    margin: 0 4px;
}

.train-header-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}


.train-no {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--color-primary);
}

.train-route {
    font-size: 0.8rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
}

.train-status-badge {
    padding: 2px 8px;
    border-radius: 8px;
    font-size: 0.7rem;
    font-weight: 600;
}

.train-status-badge.sale {
    background: rgba(16, 185, 129, 0.15);
    color: var(--color-success);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.train-status-badge.sold_out {
    background: rgba(239, 68, 68, 0.15);
    color: var(--color-danger);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.train-status-badge.pending {
    background: rgba(245, 158, 11, 0.15);
    color: var(--color-warning);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.train-item-body {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
    gap: 6px;
    margin-bottom: 2px;
}

.train-time-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.train-time {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 4px;
}

.time-icon {
    font-size: 0.65rem;
    color: var(--color-primary);
}

.train-station {
    font-size: 0.75rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 3px;
}

.station-icon {
    font-size: 0.65rem;
    color: var(--text-muted);
}

.train-duration {
    text-align: center;
    padding: 4px;
    background: var(--bg-input);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    color: var(--text-muted);
}

.train-duration-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2px;
    min-width: 80px;
}

.duration-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    line-height: 1;
}

.duration-value {
    font-size: 1rem;
    font-weight: 700;
    color: var(--primary-color);
    line-height: 1.1;
    margin: 1px 0;
}

.duration-decoration {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    opacity: 0.5;
    font-size: 0.8rem;
    margin-top: 1px;
}

/* ✨ 底部区域：包含座位信息和操作按钮 */
.train-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 2px;
    padding-top: 2px;
    border-top: 1px solid var(--border-color);
}

/* ✨ 座位区域 - 自适应布局 */
.train-seats {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    flex: 1;
}

/* 移除之前的媒体查询，改为在 footer 层面控制 */
.train-seat-item {
    text-align: center;
    padding: 2px 4px;
    background: var(--bg-input);
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
    min-height: 32px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    flex: 1 1 65px;
}

.train-seat-item.has-ticket {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.15) 0%, rgba(16, 185, 129, 0.08) 100%);
    border: 2px solid rgba(16, 185, 129, 0.4);
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.15);
    animation: seat-pulse 2s ease-in-out infinite;
}

.train-seat-item.has-ticket:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25);
}

@keyframes seat-pulse {
    0%, 100% {
        box-shadow: 0 2px 8px rgba(16, 185, 129, 0.15);
    }
    50% {
        box-shadow: 0 2px 12px rgba(16, 185, 129, 0.25);
    }
}

.train-seat-item.no-ticket {
    background: rgba(148, 163, 184, 0.08);
    border: 1px solid rgba(148, 163, 184, 0.2);
    opacity: 0.6;
}

.train-seat-name {
    font-size: 0.65rem;
    color: var(--text-muted);
    margin-bottom: 2px;
    line-height: 1.1;
    word-break: keep-all;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
}

.seat-icon {
    font-size: 0.6rem;
}

.train-seat-item.has-ticket .seat-icon {
    color: var(--color-success);
}

.train-seat-item.no-ticket .seat-icon {
    color: var(--text-muted);
}

.train-seat-num {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-main);
    margin: 1px 0;
}

.train-seat-item.has-ticket .train-seat-num {
    color: var(--color-success);
}

.train-seat-item.no-ticket .train-seat-num {
    color: var(--text-muted);
    font-weight: 400;
}

.train-seat-price {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.train-selected-info {
    padding: 16px;
    background: linear-gradient(135deg, var(--bg-card) 0%, rgba(59, 130, 246, 0.03) 100%);
    border-radius: var(--radius-md);
    margin-bottom: 16px;
    border: 2px solid var(--border-color);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

.train-selected-info::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--color-primary) 0%, #4f46e5 100%);
}

/* ✨ 车票查询结果按钮样式 - 紧凑布局 */
.train-item-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-shrink: 0;
}

/* ✨ 优化按钮样式 - 更现代更紧凑 */
.train-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 18px;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: relative;
    overflow: hidden;
    min-width: 90px;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.train-action-btn i {
    font-size: 0.875rem;
    transition: transform 0.3s ease;
}

.train-action-btn:hover i {
    transform: scale(1.1);
}

/* ✨ 波纹效果 */
.train-action-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.35);
    transform: translate(-50%, -50%);
    transition: width 0.5s ease, height 0.5s ease;
}

.train-action-btn:hover::before {
    width: 200px;
    height: 200px;
}

.train-action-btn span {
    position: relative;
    z-index: 1;
}

.train-action-btn i {
    position: relative;
    z-index: 1;
}

/* ✨ 购买按钮 - 现代蓝色渐变 + 光泽效果 */
.train-buy-btn {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    box-shadow: 0 2px 10px rgba(59, 130, 246, 0.35),
                0 0 0 1px rgba(59, 130, 246, 0.1);
    position: relative;
}

/* ✨ 按钮光泽效果 */
.train-buy-btn::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.3) 50%,
        transparent 100%
    );
    transition: left 0.6s ease;
    pointer-events: none;
    z-index: 2;
}

.train-buy-btn:hover::after {
    left: 150%;
}

.train-buy-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.45),
                0 0 0 1px rgba(59, 130, 246, 0.2),
                0 0 20px rgba(59, 130, 246, 0.15);
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
}

.train-buy-btn:active {
    transform: translateY(0);
    box-shadow: 0 1px 4px rgba(59, 130, 246, 0.3);
}

/* ✨ 预定按钮 - 现代绿色渐变 + 光泽效果 */
.train-book-btn {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    box-shadow: 0 2px 10px rgba(16, 185, 129, 0.35),
                0 0 0 1px rgba(16, 185, 129, 0.1);
    position: relative;
}

/* ✨ 按钮光泽效果 */
.train-book-btn::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.3) 50%,
        transparent 100%
    );
    transition: left 0.6s ease;
    pointer-events: none;
    z-index: 2;
}

.train-book-btn:hover::after {
    left: 150%;
}

.train-book-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(16, 185, 129, 0.45),
                0 0 0 1px rgba(16, 185, 129, 0.2),
                0 0 20px rgba(16, 185, 129, 0.15);
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
}

.train-book-btn:active {
    transform: translateY(0);
    box-shadow: 0 1px 4px rgba(16, 185, 129, 0.3);
}

/* ✨ 响应式设计 - 移动端优化 */
@media (max-width: 768px) {
    /* 移动端：Footer 垂直排列 */
    .train-footer {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    /* 移动端：按钮回到底部 */
    .train-item-actions {
        justify-content: flex-end;
        margin-top: 0;
        padding: 0;
        border-top: none;
        width: 100%;
    }
    
    /* 移动端：座位区域不需要右侧padding */
    .train-seats {
        padding-right: 0;
        width: 100%;
    }
    
    .train-action-btn {
        flex: 1;
        min-width: auto;
        max-width: 140px;
        padding: 8px 14px;
        font-size: 0.8125rem;
    }
}

@media (max-width: 480px) {
    /* 超小屏幕：按钮全宽 */
    .train-item-actions {
        flex-direction: column;
        gap: 8px;
    }
    
    .train-action-btn {
        width: 100%;
        max-width: none;
    }
}

/* 分页控件样式 */
.pagination-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
    align-items: center;
    padding: 20px;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

/* 成功动画样式 - 简化版本 */
.success-animation {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 20px 0;
    min-height: 120px;
}

.success-checkmark-wrapper {
    position: relative;
    width: 100px;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.success-checkmark-circle {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    animation: success-circle-scale 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    box-shadow: 0 4px 20px rgba(16, 185, 129, 0.4),
                0 0 0 0 rgba(16, 185, 129, 0.5);
}

.success-checkmark-circle::before {
    content: '';
    position: absolute;
    top: -4px;
    left: -4px;
    right: -4px;
    bottom: -4px;
    border-radius: 50%;
    border: 3px solid rgba(16, 185, 129, 0.3);
    animation: success-circle-ring 0.8s ease-out 0.3s both;
}

.success-checkmark-circle::after {
    content: '';
    position: absolute;
    top: -8px;
    left: -8px;
    right: -8px;
    bottom: -8px;
    border-radius: 50%;
    border: 2px solid rgba(16, 185, 129, 0.2);
    animation: success-circle-ring-2 1s ease-out 0.5s both;
}

.success-checkmark-icon {
    font-size: 40px;
    color: white;
    z-index: 1;
    position: relative;
    animation: success-checkmark-draw 0.5s ease-out 0.3s both;
    transform-origin: center;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* 成功模态框特殊样式 */
#train-reserve-success-modal .modal-content {
    animation: modal-success-fade-in 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    background: linear-gradient(135deg, var(--bg-card) 0%, rgba(16, 185, 129, 0.02) 100%);
    border: 2px solid rgba(16, 185, 129, 0.2);
}

@keyframes modal-success-fade-in {
    0% {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes success-circle-scale {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.15);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes success-circle-ring {
    0% {
        transform: scale(0.8);
        opacity: 1;
    }
    100% {
        transform: scale(1.5);
        opacity: 0;
    }
}

@keyframes success-circle-ring-2 {
    0% {
        transform: scale(0.8);
        opacity: 1;
    }
    100% {
        transform: scale(1.8);
        opacity: 0;
    }
}

@keyframes success-checkmark-draw {
    0% {
        transform: scale(0) rotate(-45deg);
        opacity: 0;
    }
    50% {
        transform: scale(1.2) rotate(5deg);
    }
    100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

@media (min-width: 768px) {
    .pagination-container {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
}

.pagination-info {
    font-size: 0.9rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.pagination-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
}

.pagination-pages {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
    justify-content: center;
}

.pagination-page-btn {
    min-width: 36px;
    height: 36px;
    padding: 0 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-input);
    color: var(--text-main);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.pagination-page-btn.active {
    background: var(--color-primary);
    color: white;
    border-color: var(--color-primary);
    font-weight: 600;
}

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

.pagination-ellipsis {
    padding: 0 8px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* ========== 登录弹窗美化样式 ========== */

.train-login-modal {
    padding: 0;
    overflow: hidden;
    max-width: 480px;
    max-height: 85vh; /* 限制最大高度为视口高度的85% */
    width: 100%;
    display: flex;
    flex-direction: column;
    margin: auto;
}

.train-login-header {
    text-align: center;
    padding: 24px 24px 20px;
    background: linear-gradient(135deg, var(--color-primary) 0%, hsl(var(--primary-hue), var(--primary-sat), 50%) 100%);
    color: white;
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}

.train-login-header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    animation: pulse 3s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(1.1); opacity: 0.8; }
}

.train-login-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 12px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.3);
    position: relative;
    z-index: 1;
}

.train-login-header h4 {
    margin: 0 0 6px;
    font-size: 1.3rem;
    font-weight: 600;
    position: relative;
    z-index: 1;
}

.train-login-subtitle {
    margin: 0;
    font-size: 0.85rem;
    opacity: 0.95;
    position: relative;
    z-index: 1;
    line-height: 1.4;
}

.train-login-body {
    padding: 24px;
    min-height: 280px;
    max-height: calc(85vh - 200px); /* 减去头部和底部按钮的高度 */
    display: flex;
    align-items: center;
    justify-content: center;
    overflow-y: auto;
    flex: 1;
    flex-shrink: 1;
}

/* 加载动画 */
.train-qr-loading {
    text-align: center;
    padding: 30px 20px;
}

.train-spinner {
    width: 40px;
    height: 40px;
    margin: 0 auto 16px;
    /* 注意：--primary-hue/--primary-sat/--primary-lit 是 HSL 值，不能用于 rgba() */
    border: 3px solid hsla(var(--primary-hue), var(--primary-sat), var(--primary-lit), 0.2);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.train-loading-text {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin: 0;
}

/* 二维码容器 */
.train-qr-container {
    width: 100%;
    animation: fadeInUp 0.4s ease-out;
}

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

.train-qr-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.train-qr-frame {
    position: relative;
    padding: 16px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    border: 2px solid var(--color-primary);
    overflow: hidden;
}

.train-qr-image {
    display: block;
    width: 200px;
    height: 200px;
    border-radius: 8px;
}

.train-qr-scan-line {
    position: absolute;
    top: 16px;
    left: 16px;
    right: 16px;
    height: 2px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        var(--color-primary) 20%, 
        var(--color-primary) 80%, 
        transparent 100%);
    animation: scanLine 2s ease-in-out infinite;
    box-shadow: 0 0 8px var(--color-primary-glow);
}

@keyframes scanLine {
    0%, 100% {
        top: 16px;
        opacity: 1;
    }
    50% {
        top: calc(100% - 18px);
        opacity: 0.8;
    }
}

.train-qr-status-wrapper {
    text-align: center;
    width: 100%;
}

.train-qr-status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: var(--text-main);
    font-size: 0.9rem;
    font-weight: 500;
    margin: 0 0 8px;
    padding: 10px 16px;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.train-qr-status i {
    font-size: 1.1rem;
    color: var(--color-primary);
}

.train-qr-status-detail {
    font-size: 0.85rem;
    color: var(--text-muted);
    min-height: 20px;
    transition: all 0.3s ease;
}

.train-qr-status-detail.status-waiting {
    color: var(--text-muted);
}

.train-qr-status-detail.status-scanned {
    color: var(--color-warning);
    font-weight: 500;
}

.train-qr-status-detail.status-success {
    color: var(--color-success);
    font-weight: 500;
}

/* 错误提示 */
.train-qr-error {
    text-align: center;
    padding: 30px 20px;
    animation: fadeInUp 0.4s ease-out;
}

.train-error-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 16px;
    background: rgba(239, 68, 68, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: var(--color-danger);
}

.train-error-msg {
    color: var(--text-main);
    font-size: 0.95rem;
    margin: 0 0 24px;
    line-height: 1.6;
}

.train-retry-btn {
    margin: 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

/* 登录状态 */
.train-login-status {
    text-align: center;
    padding: 30px 20px;
    animation: fadeInUp 0.4s ease-out;
}

.train-success-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 20px;
    background: linear-gradient(135deg, var(--color-success) 0%, #059669 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    color: white;
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.3);
    animation: scaleIn 0.5s ease-out;
}

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

.train-status-msg {
    color: var(--text-main);
    font-size: 1rem;
    font-weight: 500;
    margin: 0;
    line-height: 1.6;
}

/* 手动输入模式 */
.train-manual-login {
    width: 100%;
    animation: fadeInUp 0.4s ease-out;
}

.train-manual-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}

.train-manual-header i {
    font-size: 1.2rem;
    color: var(--color-primary);
}

.train-manual-header h5 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-main);
}

.train-manual-hint {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin: 0 0 20px;
    line-height: 1.6;
}

.train-manual-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.train-manual-form .inline-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    margin-bottom: 8px;
}

.train-manual-form .inline-label i {
    color: var(--color-primary);
    font-size: 0.9rem;
}

.train-manual-form textarea {
    width: 100%;
    padding: 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    background: var(--bg-input);
    color: var(--text-main);
    font-family: 'JetBrains Mono', 'Consolas', monospace;
    font-size: 0.85rem;
    line-height: 1.5;
    resize: vertical;
    transition: all 0.3s ease;
}

.train-manual-form textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px var(--color-primary-glow);
}

/* 按钮样式优化 */
.train-login-actions {
    padding: 16px 24px;
    background: var(--bg-card);
    border-top: 1px solid var(--border-color);
    margin-top: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.train-switch-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9rem;
}

/* 响应式设计 */
@media (max-width: 640px) {
    .train-login-modal {
        max-width: 95vw;
        max-height: 90vh;
        margin: 10px;
    }
    
    .train-login-header {
        padding: 20px 16px 16px;
    }
    
    .train-login-icon {
        width: 48px;
        height: 48px;
        font-size: 20px;
        margin-bottom: 10px;
    }
    
    .train-login-header h4 {
        font-size: 1.2rem;
        margin-bottom: 4px;
    }
    
    .train-login-subtitle {
        font-size: 0.8rem;
    }
    
    .train-login-body {
        padding: 20px 16px;
        min-height: 240px;
        max-height: calc(90vh - 180px);
    }
    
    .train-qr-image {
        width: 180px;
        height: 180px;
    }
    
    .train-qr-frame {
        padding: 12px;
    }
    
    .train-qr-scan-line {
        top: 12px;
        left: 12px;
        right: 12px;
    }
    
    @keyframes scanLine {
        0%, 100% {
            top: 12px;
        }
        50% {
            top: calc(100% - 14px);
        }
    }
    
    .train-login-actions {
        padding: 12px 16px;
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .train-login-actions button {
        flex: 1;
        min-width: 100px;
        padding: 8px 16px;
        font-size: 0.9rem;
    }
}

/* ========== 额外美化样式 ========== */

/* 分页控件美化 */
.pagination-container {
    background: linear-gradient(135deg, var(--bg-card) 0%, rgba(59, 130, 246, 0.02) 100%);
    border: 2px solid var(--border-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.pagination-page-btn {
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: relative;
    overflow: hidden;
}

.pagination-page-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(59, 130, 246, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.4s, height 0.4s;
}

.pagination-page-btn:hover:not(:disabled)::before {
    width: 100px;
    height: 100px;
}

.pagination-page-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(59, 130, 246, 0.2);
}

.pagination-page-btn.active {
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

/* 任务队列美化 */
#task-queue-not-logged {
    background: linear-gradient(135deg, var(--bg-card) 0%, rgba(59, 130, 246, 0.02) 100%);
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-md);
    padding: 60px 40px;
}

#task-queue-not-logged i {
    animation: lock-pulse 2s ease-in-out infinite;
}

@keyframes lock-pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 0.7;
    }
    50% {
        transform: scale(1.1);
        opacity: 1;
    }
}

/* 车次状态徽章增强 */
.train-status-badge {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.train-status-badge::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.3) 50%,
        transparent 100%
    );
    transition: left 0.5s ease;
}

.train-status-badge:hover::before {
    left: 100%;
}

.train-status-badge.sale {
    animation: badge-glow-green 2s ease-in-out infinite;
}

@keyframes badge-glow-green {
    0%, 100% {
        box-shadow: 0 0 0 rgba(16, 185, 129, 0);
    }
    50% {
        box-shadow: 0 0 8px rgba(16, 185, 129, 0.4);
    }
}

/* 时间信息美化 */
.train-time {
    position: relative;
    padding-left: 20px;
}

.train-time::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--color-primary);
    box-shadow: 0 0 6px rgba(59, 130, 246, 0.4);
}

.train-station {
    position: relative;
    padding-left: 16px;
}

.train-station::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-muted);
    border: 2px solid var(--bg-card);
}

/* 筛选器增强 */
.filter-select {
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: relative;
}

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

.filter-select:focus {
    transform: translateY(-1px);
}

/* 查询结果计数徽章 */
#train-query-count {
    animation: count-bounce 0.5s ease-out;
}

@keyframes count-bounce {
    0% {
        transform: scale(0.8);
        opacity: 0;
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* 加载提示美化 - 静态样式 (移除所有动画) */
.toolbox-hint.centered-hint {
    padding: 60px 20px;
    background: linear-gradient(135deg, 
        var(--bg-card) 0%, 
        rgba(59, 130, 246, 0.03) 50%,
        var(--bg-card) 100%);
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-md);
    text-align: center;
    color: var(--text-muted);
    font-size: 0.95rem;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 15px;
    transition: all 0.3s ease;
}

/* 添加一个静态图标 */
.toolbox-hint.centered-hint::before {
    content: '\f0c6'; /* fa-paperclip or similar icon, using FontAwesome code */
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    font-size: 2rem;
    color: var(--text-muted);
    opacity: 0.3;
    margin-bottom: 5px;
    /* 确保没有动画 */
    animation: none !important;
    position: static;
    transform: none;
    border: none;
    width: auto;
    height: auto;
}

.toolbox-hint.centered-hint:hover {
    border-color: var(--color-primary);
    background: rgba(59, 130, 246, 0.02);
}

/* 彻底移除旧的旋转圆环样式 */
/* .toolbox-hint.centered-hint::before { display: none; } - 已被上面的样式覆盖 */


/* 输入框聚焦动画增强 */
input:focus,
select:focus,
textarea:focus {
    animation: input-focus-pulse 0.3s ease-out;
}

@keyframes input-focus-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.4);
    }
    100% {
        box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    }
}

/* 按钮点击波纹效果 */
.button-primary,
.button-secondary,
.train-action-btn {
    position: relative;
    overflow: hidden;
}

.button-primary:active::after,
.button-secondary:active::after,
.train-action-btn:active::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    transform: translate(-50%, -50%);
    animation: ripple 0.6s ease-out;
}

@keyframes ripple {
    to {
        width: 300px;
        height: 300px;
        opacity: 0;
    }
}

/* 卡片悬停效果增强 */
.panel-card {
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: relative;
}

.panel-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

/* 任务状态显示增强 */
.train-status-display {
    background: linear-gradient(135deg, var(--bg-input) 0%, rgba(59, 130, 246, 0.02) 100%);
    border: 2px solid var(--border-color);
}

/* 日志显示美化 */
.train-log-display textarea {
    background: linear-gradient(135deg, var(--code-bg) 0%, rgba(59, 130, 246, 0.01) 100%);
    border: 2px solid var(--border-color);
    transition: all 0.3s ease;
}

.train-log-display textarea:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1),
                inset 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* ========== 高级居中弹窗样式 ========== */
.advanced-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

.advanced-modal-overlay.hide {
    opacity: 0;
    visibility: hidden;
}

.advanced-modal {
    width: 90%;
    max-width: 480px;
    transform: scale(0.8) translateY(20px);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

.advanced-modal-overlay.hide .advanced-modal {
    transform: scale(0.8) translateY(20px);
}

.advanced-modal-content {
    background: linear-gradient(135deg, var(--bg-card) 0%, rgba(59, 130, 246, 0.02) 100%);
    border-radius: 20px;
    padding: 40px 32px 32px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3),
                0 8px 24px rgba(0, 0, 0, 0.2),
                inset 0 1px 0 rgba(255, 255, 255, 0.1);
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
}

.advanced-modal-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, 
        var(--color-primary) 0%, 
        #8b5cf6 50%, 
        var(--color-primary) 100%);
    background-size: 200% 100%;
    animation: gradient-shift 3s ease infinite;
}

@keyframes gradient-shift {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

.advanced-modal-icon-wrapper {
    display: flex;
    justify-content: center;
    margin-bottom: 24px;
}

.advanced-modal-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    border: 3px solid;
    position: relative;
    animation: icon-pulse 2s ease-in-out infinite;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.advanced-modal-icon::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: inherit;
    opacity: 0.3;
    animation: ripple 2s ease-out infinite;
}

@keyframes icon-pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

@keyframes ripple {
    0% {
        transform: scale(1);
        opacity: 0.3;
    }
    100% {
        transform: scale(1.5);
        opacity: 0;
    }
}

.advanced-modal-icon-wrapper.warning .advanced-modal-icon {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.15) 0%, rgba(245, 158, 11, 0.08) 100%);
    border-color: rgba(245, 158, 11, 0.4);
    color: #f59e0b;
}

.advanced-modal-icon-wrapper.error .advanced-modal-icon {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.15) 0%, rgba(239, 68, 68, 0.08) 100%);
    border-color: rgba(239, 68, 68, 0.4);
    color: #ef4444;
}

.advanced-modal-icon-wrapper.success .advanced-modal-icon {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.15) 0%, rgba(16, 185, 129, 0.08) 100%);
    border-color: rgba(16, 185, 129, 0.4);
    color: #10b981;
}

.advanced-modal-icon-wrapper.info .advanced-modal-icon {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.15) 0%, rgba(59, 130, 246, 0.08) 100%);
    border-color: rgba(59, 130, 246, 0.4);
    color: #3b82f6;
}

.advanced-modal-body {
    text-align: center;
    margin-bottom: 32px;
}

.advanced-modal-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-color);
    margin: 0 0 16px 0;
    letter-spacing: -0.5px;
}

.advanced-modal-message {
    font-size: 15px;
    line-height: 1.6;
    color: var(--text-muted);
    margin: 0;
    padding: 0 8px;
}

.advanced-modal-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
}

.advanced-modal-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 32px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    min-width: 140px;
}

.advanced-modal-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.advanced-modal-btn:hover::before {
    width: 300px;
    height: 300px;
}

.advanced-modal-btn-primary {
    background: linear-gradient(135deg, var(--color-primary) 0%, #4f46e5 100%);
    color: white;
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.4);
}

.advanced-modal-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(59, 130, 246, 0.5);
    background: linear-gradient(135deg, #4f46e5 0%, var(--color-primary) 100%);
}

.advanced-modal-btn-primary:active {
    transform: translateY(0);
}

.advanced-modal-btn span,
.advanced-modal-btn i {
    position: relative;
    z-index: 1;
}

/* ========== Toast通知样式（保留用于其他场景） ========== */
.toast-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    min-width: 360px;
    max-width: 480px;
    background: linear-gradient(135deg, var(--bg-card) 0%, rgba(59, 130, 246, 0.05) 100%);
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--color-warning);
    border-radius: 12px;
    padding: 20px 24px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12),
                0 2px 8px rgba(0, 0, 0, 0.08);
    z-index: 10000;
    opacity: 0;
    transform: translateX(400px) scale(0.9);
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.toast-notification.show {
    opacity: 1;
    transform: translateX(0) scale(1);
}

.toast-notification.hide {
    opacity: 0;
    transform: translateX(400px) scale(0.9);
}

.toast-notification.warning {
    border-left-color: #f59e0b;
    background: linear-gradient(135deg, 
        rgba(245, 158, 11, 0.1) 0%, 
        rgba(245, 158, 11, 0.05) 100%);
}

.toast-notification.error {
    border-left-color: var(--color-danger);
    background: linear-gradient(135deg, 
        rgba(239, 68, 68, 0.1) 0%, 
        rgba(239, 68, 68, 0.05) 100%);
}

.toast-notification.success {
    border-left-color: var(--color-success);
    background: linear-gradient(135deg, 
        rgba(16, 185, 129, 0.1) 0%, 
        rgba(16, 185, 129, 0.05) 100%);
}

.toast-notification.info {
    border-left-color: var(--color-primary);
    background: linear-gradient(135deg, 
        rgba(59, 130, 246, 0.1) 0%, 
        rgba(59, 130, 246, 0.05) 100%);
}

.toast-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.toast-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
    background: linear-gradient(135deg, 
        rgba(245, 158, 11, 0.2) 0%, 
        rgba(245, 158, 11, 0.1) 100%);
    color: #f59e0b;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.2);
}

.toast-notification.warning .toast-icon {
    background: linear-gradient(135deg, 
        rgba(245, 158, 11, 0.2) 0%, 
        rgba(245, 158, 11, 0.1) 100%);
    color: #f59e0b;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.2);
}

.toast-notification.error .toast-icon {
    background: linear-gradient(135deg, 
        rgba(239, 68, 68, 0.2) 0%, 
        rgba(239, 68, 68, 0.1) 100%);
    color: var(--color-danger);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.2);
}

.toast-notification.success .toast-icon {
    background: linear-gradient(135deg, 
        rgba(16, 185, 129, 0.2) 0%, 
        rgba(16, 185, 129, 0.1) 100%);
    color: var(--color-success);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
}

.toast-notification.info .toast-icon {
    background: linear-gradient(135deg, 
        rgba(59, 130, 246, 0.2) 0%, 
        rgba(59, 130, 246, 0.1) 100%);
    color: var(--color-primary);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
}

.toast-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-color);
    margin: 0;
    flex: 1;
}

.toast-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 18px;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toast-close:hover {
    background: var(--bg-hover);
    color: var(--text-color);
    transform: rotate(90deg);
}

.toast-body {
    color: var(--text-muted);
    font-size: 14px;
    line-height: 1.6;
    margin: 0;
    padding-left: 52px;
}

/* ========== 高级加载动画样式 ========== */
.advanced-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    gap: 24px;
}

.advanced-spinner {
    width: 64px;
    height: 64px;
    position: relative;
}

.advanced-spinner::before,
.advanced-spinner::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    border: 4px solid transparent;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.advanced-spinner::before {
    border-top-color: var(--color-primary);
    border-right-color: var(--color-primary);
    animation: advanced-spin 1s linear infinite;
}

.advanced-spinner::after {
    border-bottom-color: var(--color-primary);
    border-left-color: var(--color-primary);
    animation: advanced-spin 1s linear infinite reverse;
    opacity: 0.5;
}

@keyframes advanced-spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.advanced-loading-text {
    font-size: 15px;
    color: var(--text-muted);
    font-weight: 500;
    letter-spacing: 0.5px;
    position: relative;
    padding-left: 24px;
}

.advanced-loading-text::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--color-primary);
    animation: pulse-dot 1.5s ease-in-out infinite;
}

@keyframes pulse-dot {
    0%, 100% {
        transform: translateY(-50%) scale(1);
        opacity: 1;
    }
    50% {
        transform: translateY(-50%) scale(1.2);
        opacity: 0.7;
    }
}

/* 改进的centered-hint样式 */
.toolbox-hint.centered-hint {
    padding: 50px 20px;
    background: linear-gradient(135deg, 
        var(--bg-card) 0%, 
        rgba(59, 130, 246, 0.03) 50%,
        var(--bg-card) 100%);
    border: 2px dashed var(--border-color);
    border-radius: 16px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.95rem;
    position: relative;
    overflow: hidden;
}

/* 移除 centered-hint 的加载动画，避免误导用户 */

@keyframes shimmer {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}