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

:root {
    --primary: #6366f1;
    --primary-light: #eef2ff;
    --primary-hover: #4f46e5;
    --bg-body: #f3f4f6;
    --bg-sidebar: #ffffff;
    --bg-card: #ffffff;
    --text-main: #1f2937;
    --text-sub: #9ca3af;
    --border: #f3f4f6;
    --shadow-card: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --radius-l: 16px;
    --radius-m: 10px;
}

html[data-theme="dark"] {
    --primary: #818cf8;
    --primary-light: rgba(129, 140, 248, 0.10);
    --primary-hover: #6366f1;
    --bg-body: #0b1220;
    --bg-sidebar: #0f172a;
    --bg-card: #111c33;
    --text-main: #e5e7eb;
    --text-sub: #9ca3af;
    --border: rgba(148, 163, 184, 0.14);
    --shadow-card: 0 10px 15px -3px rgba(0, 0, 0, 0.35), 0 4px 6px -2px rgba(0, 0, 0, 0.25);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    height: 100vh;
    overflow: hidden;
}

/* iOS 主屏幕全屏模式安全区适配（避免刘海/灵动岛遮挡） */
html.is-standalone-ios .app-container,
html.is-standalone-ios .login-wrapper {
    padding-top: calc(constant(safe-area-inset-top) + 10px);
    padding-top: calc(env(safe-area-inset-top) + 10px);
    padding-bottom: constant(safe-area-inset-bottom);
    padding-bottom: env(safe-area-inset-bottom);
}

html.is-standalone-ios .toast-container {
    top: calc(constant(safe-area-inset-top) + 24px);
    top: calc(env(safe-area-inset-top) + 24px);
}

.theme-toggle-btn {
    width: auto;
    padding: 0 12px;
    gap: 8px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-main);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    transition: all 0.2s;
}

#theme-toggle-text {
    font-size: 0.9rem;
    font-weight: 500;
    color: #6b7280;
}

html:not([data-theme="dark"]) #theme-toggle-text {
    color: #6b7280;
}

.theme-toggle-btn:hover {
    border-color: rgba(129, 140, 248, 0.45);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
    transform: translateY(-1px);
}

/* 登录页面专用样式 */
.login-wrapper {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    position: relative;
}

html[data-theme="dark"] .login-wrapper {
    background: linear-gradient(135deg, #0b1220 0%, #1a1f35 100%);
}

.login-card {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    width: 90%;
    max-width: 400px;
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
    text-align: center;
}

html[data-theme="dark"] .login-card {
    background: rgba(17, 28, 51, 0.85);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4);
}

.login-logo {
    font-size: 3.5rem;
    margin-bottom: 10px;
    background: linear-gradient(to right, #6366f1, #8b5cf6);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
}

.login-title {
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 5px;
    color: #333;
}

html[data-theme="dark"] .login-title {
    color: rgba(229, 231, 235, 0.95);
}

.login-subtitle {
    color: #888;
    font-size: 0.9rem;
    margin-bottom: 30px;
}

html[data-theme="dark"] .login-subtitle {
    color: rgba(229, 231, 235, 0.60);
}

.login-form-group {
    margin-bottom: 20px;
    text-align: left;
}

.login-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    color: #555;
}

html[data-theme="dark"] .login-label {
    color: rgba(229, 231, 235, 0.85);
}

.login-input {
    width: 100%;
    padding: 14px;
    border: 2px solid #eee;
    border-radius: 10px;
    background: #f9f9f9;
    font-size: 1rem;
    transition: 0.3s;
    color: #333;
}

html[data-theme="dark"] .login-input {
    border-color: rgba(148, 163, 184, 0.25);
    background: rgba(15, 23, 42, 0.55);
    color: rgba(229, 231, 235, 0.95);
}

.login-input:focus {
    border-color: var(--primary);
    background: #fff;
    outline: none;
}

html[data-theme="dark"] .login-input:focus {
    background: rgba(15, 23, 42, 0.75);
}

.login-btn {
    width: 100%;
    padding: 14px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 5px 15px rgba(99, 102, 241, 0.3);
    transition: transform 0.2s;
}

.login-btn:active {
    transform: scale(0.98);
}

/* 主界面布局 */
.app-container {
    display: flex;
    height: 100vh;
    width: 100vw;
}

.sidebar {
    width: 250px;
    background: var(--bg-sidebar);
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--border);
    z-index: 50;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.brand {
    padding: 30px 24px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-icon {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    border-radius: 10px;
    color: white;
    font-weight: 800;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(99, 102, 241, 0.3);
}

.brand-text {
    font-size: 1.22rem;
    font-weight: 800;
    color: var(--text-main);
    letter-spacing: -0.04em;
    line-height: 1.16;
    padding-bottom: 2px;
    background: linear-gradient(135deg, #0f172a, #334155 45%, #2563eb 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-rendering: geometricPrecision;
}

.brand-version {
    margin-top: 4px;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-sub);
    letter-spacing: 0.02em;
}

html[data-theme="dark"] .brand-text {
    background: linear-gradient(135deg, #f8fafc, #cbd5e1 48%, #93c5fd 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

#sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 10px 12px;
    scrollbar-width: none;
}

#sidebar-nav::-webkit-scrollbar {
    display: none;
}

/* 分类分组（可折叠） */
.nav-category-group {
    margin-top: 14px;
}

.nav-category-group:first-child {
    margin-top: 4px;
}

.nav-category-btn {
    width: 100%;
    border: 1px solid rgba(148, 163, 184, 0.14);
    outline: none;
    background: rgba(148, 163, 184, 0.06);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 8px 6px 10px;
    margin: 0;
    cursor: pointer;
    border-radius: 8px;
    color: var(--text-sub);
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

html:not([data-theme="dark"]) .nav-category-btn {
    background: #f8fafc;
    border-color: #e9eef5;
}

html[data-theme="dark"] .nav-category-btn {
    background: rgba(148, 163, 184, 0.08);
    border-color: rgba(148, 163, 184, 0.18);
}

.nav-category-btn:hover {
    background: rgba(148, 163, 184, 0.10);
    border-color: rgba(148, 163, 184, 0.22);
    color: var(--text-main);
}

html:not([data-theme="dark"]) .nav-category-btn:hover {
    background: #f9fafb;
    border-color: #e5e7eb;
    color: #111827;
}

html[data-theme="dark"] .nav-category-btn:hover {
    background: rgba(148, 163, 184, 0.12);
    border-color: rgba(148, 163, 184, 0.28);
}

.nav-category-btn:focus-visible {
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.28);
}

.nav-category-title {
    font-size: 0.74rem;
    font-weight: 650;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.nav-category-arrow {
    width: 16px;
    height: 16px;
    margin-left: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
    flex-shrink: 0;
}

.nav-category-arrow::before {
    content: '';
    width: 6px;
    height: 6px;
    border-right: 1.6px solid currentColor;
    border-bottom: 1.6px solid currentColor;
    transform: translateY(-0.5px) rotate(45deg);
    transition: transform 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

html[data-theme="dark"] .nav-category-arrow {
    color: rgba(148, 163, 184, 0.9);
}

.nav-category-btn:hover .nav-category-arrow {
    color: var(--primary);
}

html[data-theme="dark"] .nav-category-btn:hover .nav-category-arrow {
    color: #a5b4fc;
}

.nav-category-group.collapsed .nav-category-arrow::before {
    transform: translateY(0) rotate(-45deg);
}

.nav-category-body {
    margin-top: 4px;
}

.nav-category-group.collapsed .nav-category-body {
    display: none;
}

.nav-category-group.collapsed.search-expanded .nav-category-body {
    display: block;
}

.nav-category-group.collapsed.search-expanded .nav-category-arrow::before {
    transform: translateY(-0.5px) rotate(45deg);
}

/* 菜单项 */
.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    margin-bottom: 4px;
    border-radius: var(--radius-m);
    cursor: pointer;
    transition: all 0.2s ease;
    color: #4b5563;
    font-weight: 500;
    font-size: 0.93rem;
    border: 1px solid transparent;
}

/* 系统工具导航项与普通项保持一致字号（防止被浏览器/插件默认样式放大） */
.system-tool-nav-item,
.system-tool-nav-item .nav-text,
.system-tool-nav-item .nav-icon-emoji {
    font-size: 0.93rem;
    line-height: 1.2;
}

html[data-theme="dark"] .nav-item {
    color: rgba(229, 231, 235, 0.72);
}

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

html:not([data-theme="dark"]) .nav-item:hover {
    background-color: #f9fafb;
    color: #111827;
}

.nav-item:hover .nav-icon-emoji {
    transform: scale(1.1);
}

/* 选中状态 */
.nav-item.active {
    background-color: var(--primary-light);
    color: var(--primary);
    font-weight: 600;
}

.nav-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 底部栏 */
.sidebar-footer {
    padding: 16px;
    border-top: 1px solid var(--border);
    background: var(--bg-sidebar);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sidebar-footer .theme-toggle-btn {
    width: 100%;
    padding: 10px;
    border: 1px solid #e5e7eb;
    background: var(--bg-card);
    color: #6b7280;
    border-radius: var(--radius-m);
    justify-content: center;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    gap: 8px;
    display: flex;
    align-items: center;
}

html[data-theme="dark"] .sidebar-footer .theme-toggle-btn {
    color: rgba(229, 231, 235, 0.75);
    border-color: rgba(148, 163, 184, 0.18);
}

.sidebar-footer .theme-toggle-btn:hover {
    background: #f3f4f6;
    border-color: #d1d5db;
    color: #4b5563;
}

html[data-theme="dark"] .sidebar-footer .theme-toggle-btn:hover {
    background: rgba(148, 163, 184, 0.15);
    border-color: rgba(148, 163, 184, 0.25);
    color: rgba(229, 231, 235, 0.85);
}

.sidebar-footer #theme-toggle-text {
    font-size: inherit;
    font-weight: inherit;
    color: inherit;
}

.logout-btn {
    width: 100%;
    padding: 10px;
    border: 1px solid #e5e7eb;
    background: var(--bg-card);
    color: #6b7280;
    border-radius: var(--radius-m);
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 0.9rem;
    font-weight: 500;
}

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

html[data-theme="dark"] .logout-btn {
    color: rgba(229, 231, 235, 0.75);
    border-color: rgba(148, 163, 184, 0.18);
}

html[data-theme="dark"] .logout-btn:hover {
    background: rgba(239, 68, 68, 0.12);
    border-color: rgba(239, 68, 68, 0.25);
    color: #f87171;
}

/* 内容区 */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--bg-body);
    position: relative;
    width: 100%;
    min-height: 0;
}

.top-bar {
    height: 64px;
    padding: 0 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(12px);
    position: sticky;
    top: 0;
    z-index: 40;
    border-bottom: 1px solid rgba(0, 0, 0, 0.03);
    gap: 16px;
}

.global-alert-strip {
    width: 100%;
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 32px;
}

.global-alert-strip.visible {
    padding-top: 16px;
}

.global-alert-banner {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    width: 100%;
    padding: 14px 16px;
    border-radius: 16px;
    border: 1px solid transparent;
}

.global-alert-banner-error {
    border-color: rgba(239, 68, 68, 0.22);
    background: linear-gradient(135deg, rgba(254, 226, 226, 0.98), rgba(254, 242, 242, 0.98));
    box-shadow: 0 10px 28px rgba(239, 68, 68, 0.12);
}

html[data-theme="dark"] .global-alert-banner-error {
    border-color: rgba(248, 113, 113, 0.26);
    background: linear-gradient(135deg, rgba(69, 10, 10, 0.92), rgba(127, 29, 29, 0.90));
    box-shadow: 0 10px 28px rgba(127, 29, 29, 0.24);
}

.global-alert-banner-icon {
    font-size: 1.1rem;
    line-height: 1.6;
}

.global-alert-banner-content {
    min-width: 0;
    flex: 1;
}

.global-alert-banner-title {
    font-size: 0.92rem;
    font-weight: 700;
    color: #b91c1c;
}

html[data-theme="dark"] .global-alert-banner-title {
    color: #fecaca;
}

.global-alert-banner-desc {
    margin-top: 4px;
    font-size: 0.8rem;
    line-height: 1.6;
    color: #991b1b;
}

html[data-theme="dark"] .global-alert-banner-desc {
    color: #fee2e2;
}

html[data-theme="dark"] .top-bar {
    background: rgba(15, 23, 42, 0.78);
    border-bottom: 1px solid rgba(148, 163, 184, 0.10);
}

.page-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-main);
    flex: 1;
}

.top-bar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* 搜索框 */
.search-wrapper {
    position: relative;
}

.search-input {
    width: 280px;
    padding: 8px 12px 8px 36px;
    border: 1px solid rgba(148, 163, 184, 0.25);
    border-radius: var(--radius-m);
    font-size: 0.9rem;
    background: rgba(148, 163, 184, 0.10);
    transition: all 0.2s;
    color: var(--text-main);
}

html:not([data-theme="dark"]) .search-input {
    border: 1px solid #e5e7eb;
    background: #f9fafb;
    color: #1f2937;
}

.search-input:focus {
    background: var(--bg-card);
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 3px var(--primary-light);
    width: 320px;
}

.search-input::placeholder {
    color: #9ca3af;
}

/* 完成度指示器 */
.completion-indicator {
    min-width: 60px;
    padding: 6px 12px;
    border-radius: var(--radius-m);
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    font-size: 0.85rem;
    font-weight: 600;
    text-align: center;
    cursor: default;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.save-btn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 10px 24px;
    border-radius: var(--radius-m);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.25);
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.save-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(99, 102, 241, 0.35);
}

.save-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.content-area {
    flex: 1;
    overflow-y: auto;
    padding: 32px;
    max-width: 1120px;
    margin: 0 auto;
    width: 100%;
    min-height: 0;
}

.content-area.dashboard-full-width {
    max-width: none;
    margin: 0;
}

/* 配置卡片 */
.config-group {
    background: var(--bg-card);
    border-radius: var(--radius-l);
    padding: 32px;
    box-shadow: var(--shadow-card);
    margin-bottom: 24px;
    display: none;
    animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.config-group.active {
    display: block;
}

.config-group-structured {
    padding: 28px;
}

.config-subgroup-stack {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.config-subgroup {
    position: relative;
    border-radius: 22px;
    padding: 22px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.82) 0%, rgba(248, 250, 252, 0.96) 100%);
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.05);
    overflow: hidden;
}

.config-subgroup::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, rgba(99, 102, 241, 0.92), rgba(56, 189, 248, 0.75));
    opacity: 0.9;
}

html[data-theme="dark"] .config-subgroup {
    border-color: rgba(148, 163, 184, 0.14);
    background: linear-gradient(180deg, rgba(30, 41, 59, 0.76) 0%, rgba(15, 23, 42, 0.94) 100%);
    box-shadow: 0 14px 32px rgba(2, 6, 23, 0.34);
}

.config-subgroup-head {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 16px;
    padding-bottom: 14px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.16);
}

.config-subgroup-toggle {
    margin-left: auto;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid rgba(99, 102, 241, 0.24);
    background: rgba(99, 102, 241, 0.08);
    color: var(--text-sub);
    border-radius: 999px;
    padding: 6px 12px;
    font-size: 0.78rem;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    transition: all 0.2s ease;
}

.config-subgroup-toggle:hover {
    border-color: rgba(99, 102, 241, 0.36);
    background: rgba(99, 102, 241, 0.14);
    color: var(--text-main);
}

.config-subgroup-toggle:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.28);
}

.config-subgroup-toggle-icon {
    display: inline-block;
    font-size: 0.9rem;
    line-height: 1;
    transform: rotate(-90deg);
    transition: transform 0.2s ease;
}

.config-subgroup:not(.is-collapsed) .config-subgroup-toggle-icon {
    transform: rotate(0deg);
}

.config-subgroup.is-collapsed .config-subgroup-body {
    display: none;
}

.config-subgroup.is-collapsed .config-subgroup-head {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom-color: transparent;
}

html[data-theme="dark"] .config-subgroup-head {
    border-bottom-color: rgba(148, 163, 184, 0.12);
}

html[data-theme="dark"] .config-subgroup-toggle {
    border-color: rgba(129, 140, 248, 0.34);
    background: rgba(129, 140, 248, 0.14);
    color: #cbd5e1;
}

html[data-theme="dark"] .config-subgroup-toggle:hover {
    border-color: rgba(129, 140, 248, 0.52);
    background: rgba(129, 140, 248, 0.22);
    color: #e2e8f0;
}

.config-subgroup-icon {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    flex-shrink: 0;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.16), rgba(59, 130, 246, 0.12));
    border: 1px solid rgba(99, 102, 241, 0.16);
}

html[data-theme="dark"] .config-subgroup-icon {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(14, 165, 233, 0.16));
    border-color: rgba(129, 140, 248, 0.22);
}

.config-subgroup-title-wrap {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.config-subgroup-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-main);
    letter-spacing: 0.01em;
}

.config-subgroup-desc {
    font-size: 0.84rem;
    line-height: 1.55;
    color: var(--text-sub);
}

.config-subgroup-desc-warning {
    margin-top: 8px;
    padding: 10px 12px;
    border-radius: 12px;
    border: 2px solid rgba(239, 68, 68, 0.58);
    background: linear-gradient(135deg, rgba(254, 226, 226, 0.96), rgba(254, 242, 242, 0.95));
    color: #b91c1c;
    font-size: 0.83rem;
    font-weight: 800;
    line-height: 1.55;
    letter-spacing: 0.01em;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.14);
}

.config-subgroup-desc-warning.is-caution {
    border-color: rgba(245, 158, 11, 0.62);
    background: linear-gradient(135deg, rgba(254, 243, 199, 0.98), rgba(254, 249, 195, 0.95));
    color: #92400e;
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.18);
}

.config-subgroup-desc-warning.is-caution::before {
    content: '⚠️ 覆盖顺序';
    display: block;
    margin-bottom: 6px;
    font-size: 0.76rem;
    font-weight: 900;
    letter-spacing: 0.02em;
    color: #b45309;
}

html[data-theme="dark"] .config-subgroup-desc-warning {
    border-color: rgba(248, 113, 113, 0.72);
    background: linear-gradient(135deg, rgba(127, 29, 29, 0.78), rgba(153, 27, 27, 0.65));
    color: #fecaca;
    box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.22);
}

html[data-theme="dark"] .config-subgroup-desc-warning.is-caution {
    border-color: rgba(251, 191, 36, 0.78);
    background: linear-gradient(135deg, rgba(120, 53, 15, 0.82), rgba(146, 64, 14, 0.68));
    color: #fde68a;
    box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.20);
}

html[data-theme="dark"] .config-subgroup-desc-warning.is-caution::before {
    color: #fcd34d;
}

.config-subgroup-desc.is-callout {
    margin-top: 8px;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid rgba(99, 102, 241, 0.22);
    background: linear-gradient(135deg, rgba(238, 242, 255, 0.98), rgba(224, 231, 255, 0.92));
    color: #4338ca;
    font-size: 0.85rem;
    font-weight: 600;
    line-height: 1.65;
    box-shadow: 0 8px 18px rgba(99, 102, 241, 0.10);
}

.config-subgroup-desc.is-callout::before {
    content: '⚠️ 触发说明';
    display: block;
    margin-bottom: 6px;
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    color: #4f46e5;
}

html[data-theme="dark"] .config-subgroup-desc.is-callout {
    border-color: rgba(129, 140, 248, 0.34);
    background: linear-gradient(135deg, rgba(49, 46, 129, 0.42), rgba(67, 56, 202, 0.22));
    color: #c7d2fe;
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.30);
}

html[data-theme="dark"] .config-subgroup-desc.is-callout::before {
    color: #a5b4fc;
}

.config-subgroup-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.config-group-structured .form-item {
    margin-bottom: 0;
    padding: 18px;
    border-radius: 18px;
    border: 1px solid rgba(148, 163, 184, 0.16);
    background: rgba(255, 255, 255, 0.72);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

html[data-theme="dark"] .config-group-structured .form-item {
    border-color: rgba(148, 163, 184, 0.12);
    background: rgba(15, 23, 42, 0.42);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.config-group-structured .form-header {
    margin-bottom: 10px;
}

.config-group-structured .form-desc {
    margin-bottom: 12px;
}

.config-group-structured .vf-inline-btn-wrap,
.config-group-structured .key-value-wrapper,
.config-group-structured .value-list-wrapper,
.config-group-structured .checkbox-grid,
.config-group-structured .vf-inline-editor,
.config-group-structured .cron-helper,
.config-group-structured .switch-wrapper {
    margin-top: 0;
}

.config-group-structured .switch-wrapper {
    background: rgba(99, 102, 241, 0.04);
    border-color: rgba(99, 102, 241, 0.08);
}

html[data-theme="dark"] .config-group-structured .switch-wrapper {
    background: rgba(99, 102, 241, 0.08);
    border-color: rgba(129, 140, 248, 0.14);
}

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

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

.form-item {
    margin-bottom: 28px;
}

.form-header {
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.form-header-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 8px;
}

.vf-inline-open-btn {
    border: 1px solid rgba(99, 102, 241, 0.35);
    background: rgba(99, 102, 241, 0.10);
    color: var(--primary);
    border-radius: 999px;
    padding: 7px 14px;
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}

.vf-inline-btn-wrap {
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.vf-inline-open-btn:hover {
    background: rgba(99, 102, 241, 0.16);
    border-color: rgba(99, 102, 241, 0.55);
    transform: translateY(-1px);
}

.vf-inline-copy-btn {
    border: 1px solid rgba(16, 185, 129, 0.35);
    background: rgba(16, 185, 129, 0.10);
    color: #10b981;
    border-radius: 999px;
    padding: 7px 14px;
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}

.vf-inline-copy-btn:hover {
    background: rgba(16, 185, 129, 0.16);
    border-color: rgba(16, 185, 129, 0.55);
    transform: translateY(-1px);
}

html:not([data-theme="dark"]) .vf-inline-open-btn {
    background: #eef2ff;
    border-color: #c7d2fe;
    color: #4338ca;
}

html:not([data-theme="dark"]) .vf-inline-open-btn:hover {
    background: #e0e7ff;
    border-color: #a5b4fc;
}

html:not([data-theme="dark"]) .vf-inline-copy-btn {
    background: #ecfdf5;
    border-color: #a7f3d0;
    color: #047857;
}

html:not([data-theme="dark"]) .vf-inline-copy-btn:hover {
    background: #d1fae5;
    border-color: #6ee7b7;
}

.form-label {
    font-weight: 600;
    font-size: 0.95rem;
    color: rgba(229, 231, 235, 0.85);
}

html:not([data-theme="dark"]) .form-label {
    color: #374151;
}

.required-tag {
    background: #fff1f2;
    color: #e11d48;
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 99px;
    font-weight: 700;
    border: 1px solid #ffe4e6;
}

.field-scope-badge {
    display: inline-flex;
    align-items: center;
    margin-left: 4px;
    padding: 3px 8px;
    border-radius: 999px;
    background: rgba(59, 130, 246, 0.10);
    border: 1px solid rgba(59, 130, 246, 0.18);
    color: #2563eb;
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
}

html[data-theme="dark"] .field-scope-badge {
    background: rgba(59, 130, 246, 0.14);
    border-color: rgba(96, 165, 250, 0.24);
    color: #93c5fd;
}

.field-scope-hint {
    margin-bottom: 10px;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid rgba(59, 130, 246, 0.16);
    background: linear-gradient(135deg, rgba(239, 246, 255, 0.96), rgba(219, 234, 254, 0.88));
    color: #1d4ed8;
    font-size: 0.8rem;
    line-height: 1.55;
    font-weight: 600;
}

html[data-theme="dark"] .field-scope-hint {
    border-color: rgba(96, 165, 250, 0.24);
    background: linear-gradient(135deg, rgba(30, 64, 175, 0.25), rgba(30, 41, 59, 0.42));
    color: #bfdbfe;
}

.form-desc {
    font-size: 0.85rem;
    color: #6b7280;
    margin-bottom: 10px;
    line-height: 1.5;
}

html[data-theme="dark"] .form-desc {
    color: rgba(229, 231, 235, 0.60);
}

.vf-inline-editor {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.vf-inline-preview {
    min-height: 92px;
    resize: vertical;
    font-family: "Cascadia Code", "Consolas", monospace;
    font-size: 0.82rem;
    line-height: 1.5;
    cursor: default;
}

.vf-inline-tip {
    font-size: 0.76rem;
    color: var(--text-sub);
}

.vf-inline-warning {
    border: 2px solid rgba(239, 68, 68, 0.58);
    background: linear-gradient(135deg, rgba(254, 226, 226, 0.96), rgba(254, 242, 242, 0.95));
    color: #b91c1c;
    border-radius: 10px;
    padding: 11px 13px;
    font-size: 0.86rem;
    font-weight: 800;
    line-height: 1.45;
    letter-spacing: 0.01em;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.16), 0 8px 18px rgba(239, 68, 68, 0.15);
}

html[data-theme="dark"] .vf-inline-warning {
    border-color: rgba(248, 113, 113, 0.72);
    background: linear-gradient(135deg, rgba(127, 29, 29, 0.78), rgba(153, 27, 27, 0.65));
    color: #fecaca;
    box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.24), 0 8px 20px rgba(0, 0, 0, 0.35);
}

.vf-inline-warning-badge {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid rgba(220, 38, 38, 0.3);
    background: rgba(220, 38, 38, 0.12);
    color: #dc2626;
    font-size: 0.74rem;
    font-weight: 800;
    line-height: 1;
    white-space: nowrap;
}

html[data-theme="dark"] .vf-inline-warning-badge {
    border-color: rgba(248, 113, 113, 0.45);
    background: rgba(248, 113, 113, 0.2);
    color: #fecaca;
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid rgba(148, 163, 184, 0.25);
    border-radius: var(--radius-m);
    font-size: 0.95rem;
    background: rgba(148, 163, 184, 0.10);
    transition: all 0.2s;
    color: var(--text-main);
}

html:not([data-theme="dark"]) .form-input {
    border: 1px solid #e5e7eb;
    background: #f9fafb;
    color: #1f2937;
}

.form-input:focus {
    background: var(--bg-card);
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 3px var(--primary-light);
}

.form-input.cron-input-valid {
    border-color: rgba(16, 185, 129, 0.45);
}

.form-input.cron-input-invalid {
    border-color: rgba(239, 68, 68, 0.55);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.10);
}

.cron-helper {
    margin-top: 10px;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    background: rgba(148, 163, 184, 0.08);
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 0.83rem;
    line-height: 1.55;
}

html:not([data-theme="dark"]) .cron-helper {
    background: #f8fafc;
    border-color: #e5e7eb;
}

.cron-helper-status {
    font-weight: 700;
    color: var(--text-main);
}

.cron-helper-mechanism,
.cron-helper-next,
.cron-helper-example {
    color: var(--text-sub);
}

.cron-helper.is-valid {
    border-color: rgba(16, 185, 129, 0.28);
    background: rgba(16, 185, 129, 0.08);
}

html:not([data-theme="dark"]) .cron-helper.is-valid {
    background: #ecfdf5;
    border-color: #a7f3d0;
}

.cron-helper.is-valid .cron-helper-status {
    color: #059669;
}

.cron-helper.is-invalid {
    border-color: rgba(239, 68, 68, 0.28);
    background: rgba(239, 68, 68, 0.08);
}

html:not([data-theme="dark"]) .cron-helper.is-invalid {
    background: #fef2f2;
    border-color: #fecaca;
}

.cron-helper.is-invalid .cron-helper-status {
    color: #dc2626;
}

.cron-helper.is-empty .cron-helper-status {
    color: var(--text-main);
}

/* 卡片式配置项 - 关键词:目录ID */
.key-value-wrapper {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 8px;
}

.key-value-card-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    align-items: start;
}

.key-value-card-list.single-column {
    grid-template-columns: 1fr;
}

/* 万能转发配置卡片：一行最多两个 */
.tg-transfer-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.key-value-card {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: rgba(148, 163, 184, 0.10);
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: var(--radius-m);
    transition: all 0.2s;
    min-width: 0;
}

html:not([data-theme="dark"]) .key-value-card {
    background: white;
    border: 1px solid #e5e7eb;
}

.key-value-card:hover {
    border-color: #d1d5db;
    background: #f3f4f6;
}

html[data-theme="dark"] .key-value-card:hover {
    background: rgba(148, 163, 184, 0.15);
    border-color: rgba(148, 163, 184, 0.25);
}

/* 万能转发卡片内改为纵向排布，字段更清晰 */
.tg-transfer-card {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 14px;
}

.tg-transfer-card .kv-key-input,
.tg-transfer-card .kv-target-input,
.tg-transfer-card .kv-value-input,
.tg-transfer-card .kv-blacklist-input {
    width: 100%;
}

.tg-transfer-option-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius-m);
    background: rgba(99, 102, 241, 0.08);
    border: 1px solid rgba(99, 102, 241, 0.12);
    cursor: pointer;
}

html:not([data-theme="dark"]) .tg-transfer-option-row {
    background: #f5f7ff;
    border-color: #dfe3ff;
}

.tg-transfer-option-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.tg-transfer-option-label {
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--text-main);
}

.tg-transfer-option-hint {
    font-size: 0.8rem;
    line-height: 1.4;
    color: var(--text-muted);
}

.kv-spoiler-input {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
    flex-shrink: 0;
}

.tg-transfer-card .kv-separator {
    display: none;
}

.tg-transfer-card .kv-card-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 2px;
}

.tg-transfer-card .kv-delete-btn {
    align-self: auto;
}

@media (max-width: 1100px) {
    .tg-transfer-card-grid {
        grid-template-columns: 1fr;
    }
}

.kv-key-input {
    flex: 1;
    min-width: 0;
    padding: 8px 12px;
    border: 1px solid rgba(148, 163, 184, 0.20);
    border-radius: var(--radius-m);
    background: rgba(15, 23, 42, 0.55);
    font-size: 0.9rem;
    transition: all 0.2s;
    color: var(--text-main);
}

html:not([data-theme="dark"]) .kv-key-input {
    border-color: #e5e7eb;
    background: white;
    color: #1f2937;
}

.kv-key-input:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 3px var(--primary-light);
}

.kv-separator {
    font-size: 1rem;
    font-weight: 600;
    color: #6b7280;
    user-select: none;
    flex-shrink: 0;
}

.kv-value-input,
.kv-target-input,
.kv-blacklist-input {
    flex: 1;
    min-width: 0;
    padding: 8px 12px;
    border: 1px solid rgba(148, 163, 184, 0.20);
    border-radius: var(--radius-m);
    background: rgba(15, 23, 42, 0.55);
    font-size: 0.9rem;
    transition: all 0.2s;
    color: var(--text-main);
}

.kv-note-input {
    flex: 1;
    min-width: 0;
    padding: 8px 12px;
    border: 1px solid rgba(148, 163, 184, 0.20);
    border-radius: var(--radius-m);
    background: rgba(15, 23, 42, 0.55);
    font-size: 0.9rem;
    transition: all 0.2s;
    color: var(--text-main);
}

html:not([data-theme="dark"]) .kv-note-input {
    border: 1px solid #e5e7eb;
    background: white;
    color: #1f2937;
}

.kv-note-input:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 3px var(--primary-light);
}

.monitor-link-card {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 14px;
    border-style: solid;
    border-color: rgba(99, 102, 241, 0.24);
    background: linear-gradient(180deg, rgba(99, 102, 241, 0.10) 0%, rgba(148, 163, 184, 0.08) 100%);
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
}

.monitor-link-card .kv-key-input,
.monitor-link-card .kv-value-input,
.monitor-link-card .kv-note-input {
    width: 100%;
}

.monitor-link-card-title {
    font-size: 0.86rem;
    font-weight: 700;
    color: #4f46e5;
    letter-spacing: 0.01em;
}

.monitor-link-card .kv-separator {
    display: none !important;
}

.monitor-link-card .kv-delete-btn {
    align-self: flex-end;
    margin-top: 2px;
}

.monitor-link-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

@media (max-width: 1100px) {
    .monitor-link-grid {
        grid-template-columns: 1fr;
    }
}

html:not([data-theme="dark"]) .monitor-link-card {
    border-color: rgba(79, 70, 229, 0.22);
    background: linear-gradient(180deg, #eef2ff 0%, #ffffff 100%);
    box-shadow: 0 10px 22px rgba(99, 102, 241, 0.08);
}

html[data-theme="dark"] .monitor-link-card {
    border-color: rgba(129, 140, 248, 0.35);
    background: linear-gradient(180deg, rgba(67, 56, 202, 0.20) 0%, rgba(15, 23, 42, 0.62) 100%);
    box-shadow: 0 10px 24px rgba(2, 6, 23, 0.42);
}

html[data-theme="dark"] .monitor-link-card-title {
    color: #a5b4fc;
}

html:not([data-theme="dark"]) .kv-value-input,
html:not([data-theme="dark"]) .kv-target-input,
html:not([data-theme="dark"]) .kv-blacklist-input {
    border: 1px solid #e5e7eb;
    background: white;
    color: #1f2937;
}

.kv-value-input:focus,
.kv-target-input:focus,
.kv-blacklist-input:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 3px var(--primary-light);
}

.kv-delete-btn {
    width: 28px;
    height: 28px;
    border: none;
    background: #fee2e2;
    color: #dc2626;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.3rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.kv-delete-btn:hover {
    background: #fecaca;
    transform: scale(1.1);
}

.kv-test-btn {
    border: none;
    background: var(--primary);
    color: #fff;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.8rem;
    line-height: 1;
    padding: 8px 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
    white-space: nowrap;
}

.kv-test-btn:hover {
    background: var(--primary-hover);
}

.kv-test-btn:disabled,
.kv-test-btn.is-loading {
    opacity: 0.7;
    cursor: not-allowed;
}

html:not([data-theme="dark"]) .kv-test-btn {
    background: #4f46e5;
}

html:not([data-theme="dark"]) .kv-test-btn:hover {
    background: #4338ca;
}

.kv-add-btn {
    padding: 10px 16px;
    border: 2px dashed #d1d5db;
    background: transparent;
    color: var(--primary);
    border-radius: var(--radius-m);
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: fit-content;
    margin-top: 4px;
}

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

html[data-theme="dark"] .kv-add-btn {
    border-color: rgba(148, 163, 184, 0.25);
}

html[data-theme="dark"] .kv-add-btn:hover {
    background: rgba(129, 140, 248, 0.15);
}

/* 卡片式配置项 - 简单值列表（用 | 或逗号分隔） */
.value-list-wrapper {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 8px;
}

.value-list-card-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    align-items: start;
}

.value-list-card-list.single-column {
    grid-template-columns: 1fr;
}

.value-list-card {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: rgba(148, 163, 184, 0.10);
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: var(--radius-m);
    transition: all 0.2s;
    min-width: 0;
}

html:not([data-theme="dark"]) .value-list-card {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
}

.value-list-card:hover {
    border-color: #d1d5db;
    background: #f3f4f6;
}

html[data-theme="dark"] .value-list-card:hover {
    background: rgba(148, 163, 184, 0.20);
    border-color: rgba(148, 163, 184, 0.30);
}

.vl-input {
    flex: 1;
    min-width: 0;
    padding: 8px 12px;
    border: 1px solid rgba(148, 163, 184, 0.20);
    border-radius: var(--radius-m);
    background: rgba(15, 23, 42, 0.55);
    font-size: 0.9rem;
    transition: all 0.2s;
    color: var(--text-main);
}

html:not([data-theme="dark"]) .vl-input {
    border-color: #e5e7eb;
    background: white;
    color: #1f2937;
}

.vl-input:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 3px var(--primary-light);
}

.organize-zero-invalid-wrap {
    border: 2px solid rgba(239, 68, 68, 0.52);
    border-radius: 12px;
    padding: 8px;
    background: rgba(254, 226, 226, 0.28);
}

html[data-theme="dark"] .organize-zero-invalid-wrap {
    border-color: rgba(248, 113, 113, 0.65);
    background: rgba(127, 29, 29, 0.3);
}

.organize-zero-invalid {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.16) !important;
}

.organize-zero-warning {
    margin-top: 6px;
    border: 2px solid rgba(239, 68, 68, 0.58);
    background: linear-gradient(135deg, rgba(254, 226, 226, 0.96), rgba(254, 242, 242, 0.95));
    color: #b91c1c;
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 0.83rem;
    font-weight: 800;
    line-height: 1.45;
    letter-spacing: 0.01em;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.12), 0 8px 18px rgba(239, 68, 68, 0.12);
}

html[data-theme="dark"] .organize-zero-warning {
    border-color: rgba(248, 113, 113, 0.72);
    background: linear-gradient(135deg, rgba(127, 29, 29, 0.78), rgba(153, 27, 27, 0.65));
    color: #fecaca;
    box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.2), 0 8px 20px rgba(0, 0, 0, 0.35);
}

.blocked-channel-invalid-wrap {
    border: 2px solid rgba(239, 68, 68, 0.52);
    border-radius: 12px;
    padding: 8px;
    background: rgba(254, 226, 226, 0.28);
}

html[data-theme="dark"] .blocked-channel-invalid-wrap {
    border-color: rgba(248, 113, 113, 0.65);
    background: rgba(127, 29, 29, 0.3);
}

.blocked-channel-invalid {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.16) !important;
}

.blocked-channel-warning {
    margin-top: 6px;
    border: 2px solid rgba(239, 68, 68, 0.58);
    background: linear-gradient(135deg, rgba(254, 226, 226, 0.96), rgba(254, 242, 242, 0.95));
    color: #b91c1c;
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 0.83rem;
    font-weight: 800;
    line-height: 1.45;
    letter-spacing: 0.01em;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.12), 0 8px 18px rgba(239, 68, 68, 0.12);
}

html[data-theme="dark"] .blocked-channel-warning {
    border-color: rgba(248, 113, 113, 0.72);
    background: linear-gradient(135deg, rgba(127, 29, 29, 0.78), rgba(153, 27, 27, 0.65));
    color: #fecaca;
    box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.2), 0 8px 20px rgba(0, 0, 0, 0.35);
}

.vl-delete-btn {
    width: 28px;
    height: 28px;
    border: none;
    background: #fee2e2;
    color: #dc2626;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.3rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.vl-delete-btn:hover {
    background: #fecaca;
    transform: scale(1.1);
}

.vl-add-btn {
    padding: 10px 16px;
    border: 2px dashed #d1d5db;
    background: transparent;
    color: var(--primary);
    border-radius: var(--radius-m);
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: fit-content;
    margin-top: 4px;
}

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

html[data-theme="dark"] .vl-add-btn {
    border-color: rgba(148, 163, 184, 0.25);
}

html[data-theme="dark"] .vl-add-btn:hover {
    background: rgba(129, 140, 248, 0.15);
}

/* 115 扫码登录面板 */
.qr115-panel {
    margin-top: 14px;
    padding: 14px;
    border: 1px dashed rgba(99, 102, 241, 0.45);
    border-radius: 12px;
    background: rgba(99, 102, 241, 0.06);
}

html[data-theme="dark"] .qr115-panel {
    border-color: rgba(129, 140, 248, 0.40);
    background: rgba(99, 102, 241, 0.10);
}

.qr115-panel-title {
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 10px;
}

.qr115-warning {
    margin: 0 0 12px;
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid rgba(245, 158, 11, 0.35);
    background: rgba(245, 158, 11, 0.10);
    color: #92400e;
    font-size: 0.84rem;
    line-height: 1.45;
}

html[data-theme="dark"] .qr115-warning {
    border-color: rgba(251, 191, 36, 0.35);
    background: rgba(251, 191, 36, 0.12);
    color: #fcd34d;
}

.qr115-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 12px;
}

.qr115-select {
    min-width: 240px;
    flex: 1;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid rgba(148, 163, 184, 0.3);
    background: var(--bg-card);
    color: var(--text-main);
}

.qr115-action-btn,
.qr115-stop-btn {
    border: none;
    border-radius: 10px;
    padding: 10px 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.qr115-action-btn {
    background: var(--primary);
    color: #fff;
}

.qr115-action-btn:hover:not(:disabled) {
    background: var(--primary-hover);
}

.qr115-stop-btn {
    background: #f3f4f6;
    color: #4b5563;
    border: 1px solid #e5e7eb;
}

.qr115-stop-btn:hover:not(:disabled) {
    background: #e5e7eb;
}

.qr115-action-btn:disabled,
.qr115-stop-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

html[data-theme="dark"] .qr115-stop-btn {
    background: rgba(148, 163, 184, 0.12);
    color: rgba(229, 231, 235, 0.85);
    border-color: rgba(148, 163, 184, 0.2);
}

.qr115-qrcode-wrap {
    width: 220px;
    max-width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 10px;
    border: 1px solid rgba(148, 163, 184, 0.35);
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.qr115-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.qr115-placeholder {
    text-align: center;
    color: #6b7280;
    padding: 10px;
    line-height: 1.4;
    font-size: 0.86rem;
}

.qr115-status {
    margin-top: 10px;
    font-size: 0.9rem;
    color: #6b7280;
}

.qr115-status.success {
    color: #059669;
    font-weight: 600;
}

.qr115-status.error {
    color: #dc2626;
}

.qr115-countdown {
    margin-top: 4px;
    font-size: 0.82rem;
    color: #9ca3af;
}

/* 开关控件 */
.switch-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    background: #f9fafb;
    border: 1px solid #f3f4f6;
    border-radius: var(--radius-m);
    cursor: pointer;
    transition: border-color 0.2s;
}

html[data-theme="dark"] .switch-wrapper {
    background: rgba(148, 163, 184, 0.10);
    border-color: rgba(148, 163, 184, 0.18);
}

.switch-wrapper:hover {
    border-color: #e5e7eb;
    background: #f3f4f6;
}

html[data-theme="dark"] .switch-wrapper:hover {
    background: rgba(148, 163, 184, 0.15);
    border-color: rgba(148, 163, 184, 0.25);
}

.switch-label {
    font-size: 0.95rem;
    font-weight: 500;
    color: #4b5563;
}

.switch-label.on {
    color: var(--primary);
    font-weight: 600;
}

.switch-box {
    position: relative;
    width: 44px;
    height: 24px;
}

.switch-box input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #d1d5db;
    border-radius: 34px;
    transition: .3s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    border-radius: 50%;
    transition: .3s;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

input:checked+.slider {
    background-color: var(--primary);
}

input:checked+.slider:before {
    transform: translateX(20px);
}

/* 移动端 */
.menu-toggle {
    display: none;
    border: none;
    background: none;
    font-size: 1.5rem;
    color: #374151;
    padding: 4px;
}

html[data-theme="dark"] .menu-toggle {
    color: rgba(229, 231, 235, 0.85);
}

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(3px);
    z-index: 45;
    opacity: 0;
    visibility: hidden;
    transition: 0.3s;
}

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

@media (max-width: 768px) {
    .app-container {
        height: 100dvh;
    }

    html {
        scroll-padding-top: 0;
    }

    input,
    select,
    textarea,
    .form-input,
    .kv-key-input,
    .kv-value-input,
    .kv-target-input,
    .kv-blacklist-input,
    .kv-note-input,
    .vl-input,
    .proxy-settings-input,
    .transfer-status-select,
    .transfer-result-input,
    .emby-setup-input,
    .emby-user-select,
    .qr115-select,
    .vf-card-input,
    .vf-card-select,
    .vf-textarea {
        font-size: 16px !important;
        scroll-margin-top: 0;
    }

    .sidebar {
        position: fixed;
        left: -250px;
        height: 100%;
        box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
    }

    .sidebar.open {
        transform: translateX(250px);
    }

    .menu-toggle {
        display: block;
    }

    .top-bar {
        padding: 8px 16px;
        height: auto;
        min-height: 56px;
        flex-wrap: wrap;
        gap: 8px;
        position: relative;
        top: auto;
    }

    .global-alert-strip {
        padding: 0 16px;
    }

    .global-alert-strip.visible {
        padding-top: 12px;
    }

    .page-title {
        width: 100%;
        order: 1;
        margin-bottom: 0;
    }

    .top-bar-right {
        width: 100%;
        order: 2;
        display: flex;
        gap: 8px;
        align-items: center;
        flex-wrap: nowrap;
    }

    .search-wrapper {
        flex: 1;
        min-width: 0;
    }

    .search-input {
        width: 100%;
        max-width: none;
        padding: 8px 12px 8px 36px;
    }

    .search-input:focus {
        width: 100%;
    }

    .completion-indicator {
        font-size: 0.75rem;
        padding: 4px 8px;
        min-width: 50px;
        flex-shrink: 0;
    }

    .save-btn {
        padding: 8px 16px;
        font-size: 0.85rem;
        flex-shrink: 0;
        white-space: nowrap;
    }

    .content-area {
        padding: 16px;
        scroll-padding-top: 0;
        padding-bottom: calc(env(safe-area-inset-bottom) + 24px);
    }

    #env-form,
    #env-sections,
    .config-group,
    .form-item,
    .value-list-card,
    .key-value-card,
    .checkbox-card {
        scroll-margin-top: 0;
    }

    .config-group {
        padding: 20px;
    }

    .config-group-structured {
        padding: 16px;
    }

    .config-subgroup {
        padding: 16px;
        border-radius: 18px;
    }

    .config-subgroup-head {
        gap: 12px;
        margin-bottom: 14px;
        padding-bottom: 12px;
        flex-wrap: wrap;
    }

    .config-subgroup-toggle {
        margin-left: 0;
        align-self: flex-start;
    }

    .config-subgroup-icon {
        width: 38px;
        height: 38px;
        border-radius: 12px;
    }

    .config-group-structured .form-item {
        padding: 14px;
        border-radius: 16px;
    }

    /* 移动端卡片网格单列显示 */
    .key-value-card-list,
    .value-list-card-list {
        grid-template-columns: 1fr;
    }
}

/* 日志查看器样式 */
.log-viewer-container {
    background: var(--bg-card);
    border-radius: var(--radius-l);
    padding: 24px;
    box-shadow: var(--shadow-card);
}

html:not([data-theme="dark"]) .log-viewer-container {
    background: #ffffff;
}

.log-loading,
.log-error {
    padding: 20px;
    text-align: center;
    color: var(--text-sub);
    font-size: 0.9rem;
}

.log-error {
    color: #dc2626;
}

.log-content {
    background: #1f2937;
    color: #e5e7eb;
    padding: 20px;
    border-radius: var(--radius-m);
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.85rem;
    line-height: 1.6;
    overflow-x: auto;
    overflow-y: auto;
    max-height: calc(100vh - 200px);
    white-space: pre-wrap;
    word-wrap: break-word;
    margin: 0;
    /* 优化移动端滚动体验 */
    -webkit-overflow-scrolling: touch;
    /* 自定义滚动条样式（WebKit浏览器） */
    scrollbar-width: thick;
    /* Firefox */
    scrollbar-color: #4b5563 #374151;
    /* Firefox */
}

/* WebKit浏览器（Chrome、Safari、Edge）滚动条样式 */
.log-content::-webkit-scrollbar {
    width: 12px;
    /* 滚动条宽度 */
    height: 12px;
    /* 水平滚动条高度 */
}

.log-content::-webkit-scrollbar-track {
    background: #374151;
    /* 滚动条轨道背景 */
    border-radius: 6px;
}

.log-content::-webkit-scrollbar-thumb {
    background: #6b7280;
    /* 滚动条滑块颜色 */
    border-radius: 6px;
    border: 2px solid #374151;
    /* 增加视觉边界 */
    min-height: 40px;
    /* 最小高度，便于拖动 */
}

.log-content::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
    /* 悬停时颜色 */
}

/* 转存历史 */
.transfer-history-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}

.transfer-history-title-wrap {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.transfer-history-title {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-main);
}

.transfer-history-tip {
    font-size: 0.86rem;
    color: var(--text-sub);
}

.transfer-history-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.transfer-history-refresh-btn {
    border: none;
    background: var(--primary);
    color: #fff;
    border-radius: 8px;
    font-size: 0.84rem;
    font-weight: 600;
    padding: 7px 12px;
    cursor: pointer;
    transition: all 0.2s;
}

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

.transfer-history-recognize-btn {
    background: linear-gradient(135deg, #7c3aed 0%, #ec4899 100%);
    box-shadow: 0 12px 24px rgba(124, 58, 237, 0.22);
}

.transfer-history-recognize-btn:hover {
    background: linear-gradient(135deg, #6d28d9 0%, #db2777 100%);
    transform: translateY(-1px);
    box-shadow: 0 16px 28px rgba(124, 58, 237, 0.28);
}

.transfer-history-danger-btn {
    background: #ef4444;
}

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

.transfer-history-refresh-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.transfer-history-updated {
    font-size: 0.8rem;
    color: var(--text-sub);
}

/* 命令调整页：紧凑布局 */
#bot-commands-section .transfer-history-header {
    margin-bottom: 12px;
    gap: 10px;
}

#bot-commands-section .transfer-history-title-wrap {
    gap: 4px;
}

#bot-commands-section .transfer-history-title {
    font-size: 1rem;
}

#bot-commands-section .transfer-history-tip {
    font-size: 0.8rem;
}

#bot-commands-section .transfer-history-actions {
    gap: 8px;
}

#bot-commands-section .transfer-history-refresh-btn {
    font-size: 0.8rem;
    padding: 6px 10px;
}

#bot-commands-section .transfer-history-container {
    gap: 8px;
}

/* 代理设置 */
.proxy-settings-wrap {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.proxy-settings-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 14px;
    flex-wrap: wrap;
    position: sticky;
    top: 10px;
    z-index: 20;
    padding: 14px 16px;
    border-radius: 18px;
    border: 1px solid rgba(148, 163, 184, 0.16);
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
    backdrop-filter: blur(12px);
}

html[data-theme="dark"] .proxy-settings-head {
    border-color: rgba(148, 163, 184, 0.16);
    background: rgba(15, 23, 42, 0.86);
    box-shadow: 0 10px 28px rgba(2, 6, 23, 0.24);
}

.proxy-settings-title {
    margin: 0;
    font-size: 1.08rem;
    font-weight: 700;
    color: var(--text-main);
}

.proxy-settings-tip {
    margin-top: 6px;
    font-size: 0.85rem;
    color: var(--text-sub);
    line-height: 1.5;
}

.proxy-settings-tip code {
    background: rgba(148, 163, 184, 0.16);
    border-radius: 6px;
    padding: 0 6px;
}

.proxy-settings-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.proxy-settings-actions-top {
    justify-content: flex-end;
}

.proxy-settings-actions-bottom {
    margin-top: 10px;
}

.proxy-settings-save-reminder {
    font-size: 0.78rem;
    color: var(--text-sub);
    white-space: nowrap;
}

.proxy-settings-block-actions {
    margin-top: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.proxy-settings-btn {
    border: none;
    border-radius: 8px;
    font-size: 0.84rem;
    font-weight: 600;
    padding: 7px 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.proxy-settings-btn.primary {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 10px 24px rgba(99, 102, 241, 0.22);
}

.proxy-settings-btn.primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 14px 28px rgba(99, 102, 241, 0.28);
}

.proxy-settings-btn.secondary {
    background: rgba(148, 163, 184, 0.12);
    color: var(--text-main);
    border: 1px solid var(--border);
}

.proxy-settings-btn.secondary:hover {
    background: rgba(148, 163, 184, 0.18);
}

.proxy-settings-btn:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

.proxy-settings-inline-result {
    min-height: 20px;
    font-size: 0.8rem;
    color: var(--text-sub);
}

.proxy-settings-inline-result.success {
    color: #059669;
}

.proxy-settings-inline-result.error {
    color: #dc2626;
}

.proxy-settings-inline-result.info {
    color: #64748b;
}

.proxy-settings-field-wrap {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.proxy-settings-guide {
    padding: 18px;
    border-radius: 18px;
    border: 1px solid rgba(99, 102, 241, 0.16);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.08), rgba(59, 130, 246, 0.05));
}

html[data-theme="dark"] .proxy-settings-guide {
    border-color: rgba(99, 102, 241, 0.2);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.14), rgba(59, 130, 246, 0.08));
}

.proxy-settings-guide-title {
    font-size: 0.98rem;
    font-weight: 700;
    color: var(--text-main);
}

.proxy-settings-guide-desc {
    margin-top: 6px;
    font-size: 0.82rem;
    line-height: 1.6;
    color: var(--text-sub);
}

.proxy-settings-guide-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 12px;
    margin-top: 14px;
}

.proxy-settings-guide-card {
    padding: 14px 16px;
    border-radius: 14px;
    border: 1px solid rgba(148, 163, 184, 0.16);
    background: rgba(255, 255, 255, 0.78);
}

html[data-theme="dark"] .proxy-settings-guide-card {
    border-color: rgba(148, 163, 184, 0.14);
    background: rgba(15, 23, 42, 0.5);
}

.proxy-settings-guide-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(99, 102, 241, 0.12);
    color: var(--primary);
    font-size: 0.74rem;
    font-weight: 700;
}

.proxy-settings-guide-card-title {
    margin-top: 10px;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-main);
}

.proxy-settings-guide-list,
.proxy-settings-steps-list {
    margin: 10px 0 0 18px;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 0.8rem;
    line-height: 1.65;
    color: var(--text-sub);
}

.proxy-settings-guide-list li,
.proxy-settings-steps-list li {
    margin: 0;
}

.proxy-settings-steps {
    margin-top: 12px;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px dashed rgba(99, 102, 241, 0.22);
    background: rgba(99, 102, 241, 0.05);
}

html[data-theme="dark"] .proxy-settings-steps {
    border-color: rgba(99, 102, 241, 0.24);
    background: rgba(99, 102, 241, 0.08);
}

.proxy-settings-steps-title {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-main);
}

.proxy-settings-save-panel {
    padding: 18px;
    border-radius: 18px;
    border: 1px solid rgba(99, 102, 241, 0.18);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(59, 130, 246, 0.06));
}

html[data-theme="dark"] .proxy-settings-save-panel {
    border-color: rgba(99, 102, 241, 0.22);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.16), rgba(59, 130, 246, 0.1));
}

.proxy-settings-save-panel-title {
    font-size: 0.98rem;
    font-weight: 700;
    color: var(--text-main);
}

.proxy-settings-save-panel-desc {
    margin-top: 6px;
    font-size: 0.82rem;
    line-height: 1.6;
    color: var(--text-sub);
}

.proxy-settings-blocks {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.proxy-settings-block {
    padding: 18px;
    border-radius: 18px;
    border: 1px solid rgba(148, 163, 184, 0.16);
    background: rgba(255, 255, 255, 0.76);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

html[data-theme="dark"] .proxy-settings-block {
    border-color: rgba(148, 163, 184, 0.14);
    background: rgba(15, 23, 42, 0.42);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.proxy-settings-block-head {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 14px;
}

.proxy-settings-block-icon {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1.05rem;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.16), rgba(59, 130, 246, 0.12));
    border: 1px solid rgba(99, 102, 241, 0.18);
}

.proxy-settings-block-title {
    font-size: 0.96rem;
    font-weight: 700;
    color: var(--text-main);
}

.proxy-settings-block-desc {
    margin-top: 4px;
    font-size: 0.82rem;
    line-height: 1.5;
    color: var(--text-sub);
}

.proxy-settings-label {
    font-size: 0.82rem;
    color: var(--text-sub);
    font-weight: 600;
}

.proxy-settings-input {
    width: 100%;
    max-width: 760px;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-main);
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.proxy-settings-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-light);
}

.proxy-settings-hint {
    font-size: 0.78rem;
    color: var(--text-sub);
}

.proxy-settings-status {
    margin-top: 14px;
    font-size: 0.84rem;
    border-radius: 10px;
    padding: 9px 12px;
    border: 1px solid transparent;
}

.proxy-settings-status.info {
    color: #64748b;
    background: rgba(148, 163, 184, 0.12);
    border-color: rgba(148, 163, 184, 0.25);
}

.proxy-settings-status.success {
    color: #059669;
    background: rgba(16, 185, 129, 0.1);
    border-color: rgba(16, 185, 129, 0.25);
}

.proxy-settings-status.error {
    color: #dc2626;
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.25);
}

.proxy-settings-meta {
    margin-top: 12px;
    font-size: 0.8rem;
    color: var(--text-sub);
}

.proxy-settings-results {
    margin-top: 14px;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px;
    background: var(--bg-card);
}

.proxy-settings-results-summary {
    font-size: 0.82rem;
    color: var(--text-main);
    margin-bottom: 8px;
    font-weight: 600;
}

.proxy-settings-results-table-wrap {
    overflow: auto;
}

.proxy-settings-results-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
}

.proxy-settings-results-table th,
.proxy-settings-results-table td {
    border-bottom: 1px solid var(--border);
    padding: 8px 10px;
    text-align: left;
    white-space: nowrap;
}

.proxy-settings-results-table th {
    color: var(--text-sub);
    font-weight: 600;
}

.proxy-settings-results-table tr:last-child td {
    border-bottom: none;
}

.bot-cmd-updated {
    margin-bottom: 8px;
}

.bot-cmd-row {
    padding: 8px 10px;
}

.bot-cmd-row-main {
    display: flex;
    align-items: center;
    gap: 8px;
}

.bot-cmd-drag-handle {
    cursor: grab;
    user-select: none;
    color: var(--text-sub);
    line-height: 1;
}

.bot-cmd-switch {
    margin: 0;
    padding: 6px 10px;
    min-width: 112px;
}

.bot-cmd-switch .switch-label {
    font-size: 0.84rem;
}

.bot-cmd-command {
    font-weight: 700;
    min-width: 128px;
    font-size: 0.88rem;
}

.bot-cmd-desc {
    flex: 1;
    min-width: 220px;
    padding: 8px 10px;
    font-size: 0.86rem;
}

.transfer-source-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.transfer-filters {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.transfer-filter-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.transfer-filter-label {
    font-size: 0.82rem;
    color: var(--text-sub);
    font-weight: 600;
}

.transfer-status-select {
    min-width: 150px;
    padding: 6px 10px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-main);
    font-size: 0.82rem;
    outline: none;
}

.transfer-status-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-light);
}

.transfer-filter-item-keyword {
    margin-left: auto;
}

.transfer-result-input {
    min-width: 300px;
    padding: 6px 10px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-main);
    font-size: 0.82rem;
    outline: none;
}

.transfer-result-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-light);
}

.organize-clear-filters {
    margin-top: -4px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.organize-clear-all-switch {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.82rem;
    color: var(--text-main);
}

.organize-clear-all-switch input[type="checkbox"] {
    width: 14px;
    height: 14px;
}

.organize-clear-modal {
    position: fixed;
    inset: 0;
    z-index: 4200;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.22s ease, visibility 0s linear 0.22s;
}

.organize-clear-mask {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.58);
    backdrop-filter: blur(8px);
    opacity: 0;
    transition: opacity 0.22s ease;
}

.organize-clear-panel {
    position: relative;
    width: min(520px, calc(100vw - 28px));
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.96));
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 20px;
    box-shadow: 0 28px 80px rgba(15, 23, 42, 0.28);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateY(22px) scale(0.965);
    opacity: 0;
    transition: transform 0.24s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.22s ease, box-shadow 0.22s ease;
    will-change: transform, opacity;
}

html[data-theme="dark"] .organize-clear-panel {
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.98), rgba(17, 24, 39, 0.96));
    border-color: rgba(148, 163, 184, 0.12);
    box-shadow: 0 28px 80px rgba(0, 0, 0, 0.5);
}

.organize-clear-modal.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition: opacity 0.22s ease;
}

.organize-clear-modal.is-open .organize-clear-mask {
    opacity: 1;
}

.organize-clear-modal.is-open .organize-clear-panel {
    transform: translateY(0) scale(1);
    opacity: 1;
}

.organize-clear-panel:focus {
    outline: none;
}

.organize-clear-header {
    padding: 14px 16px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.12);
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.organize-clear-hero {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.organize-clear-icon {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    flex-shrink: 0;
    background: linear-gradient(135deg, rgba(248, 113, 113, 0.18), rgba(239, 68, 68, 0.12));
    border: 1px solid rgba(239, 68, 68, 0.18);
}

.organize-clear-heading {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.organize-clear-eyebrow {
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #ef4444;
}

.organize-clear-title {
    margin: 0;
    font-size: 1.08rem;
    color: var(--text-main);
}

.organize-clear-tip {
    font-size: 0.82rem;
    color: var(--text-sub);
}

.organize-clear-source-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 10px;
    border-radius: 999px;
    background: rgba(99, 102, 241, 0.12);
    color: var(--primary);
    font-weight: 700;
}

.organize-clear-close-btn {
    border: 1px solid rgba(148, 163, 184, 0.18);
    background: rgba(148, 163, 184, 0.08);
    color: var(--text-main);
    border-radius: 10px;
    padding: 4px 10px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.organize-clear-close-btn:hover {
    border-color: rgba(99, 102, 241, 0.35);
    background: rgba(99, 102, 241, 0.08);
    color: var(--primary);
}

.organize-clear-body {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.organize-clear-note {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 14px;
    background: rgba(248, 113, 113, 0.08);
    border: 1px solid rgba(248, 113, 113, 0.16);
}

.organize-clear-note-icon {
    width: 22px;
    height: 22px;
    border-radius: 999px;
    background: rgba(239, 68, 68, 0.14);
    color: #ef4444;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    flex-shrink: 0;
}

.organize-clear-note-text {
    min-width: 0;
}

.organize-clear-note-title {
    font-size: 0.84rem;
    font-weight: 700;
    color: var(--text-main);
}

.organize-clear-note-desc {
    margin-top: 4px;
    font-size: 0.8rem;
    line-height: 1.55;
    color: var(--text-sub);
}

.organize-clear-date-cards {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.organize-clear-date-card {
    border: 1px solid rgba(148, 163, 184, 0.14);
    background: rgba(255, 255, 255, 0.72);
    border-radius: 16px;
    padding: 14px;
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 6px;
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

html[data-theme="dark"] .organize-clear-date-card {
    background: rgba(30, 41, 59, 0.44);
    border-color: rgba(148, 163, 184, 0.1);
}

.organize-clear-date-card:hover {
    border-color: rgba(99, 102, 241, 0.2);
    background: rgba(99, 102, 241, 0.05);
    transform: translateY(-1px);
    box-shadow: 0 10px 24px rgba(99, 102, 241, 0.08);
}

.organize-clear-date-card.active {
    border-color: rgba(99, 102, 241, 0.35);
    background: rgba(99, 102, 241, 0.08);
    box-shadow: 0 12px 28px rgba(99, 102, 241, 0.12);
}

.organize-clear-date-card.is-disabled {
    opacity: 0.58;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.organize-clear-date-card-label {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-sub);
}

.organize-clear-date-input {
    width: 100%;
    border: none;
    background: transparent;
    padding: 0;
    margin: 0;
    outline: none;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-main);
    line-height: 1.3;
    letter-spacing: 0.02em;
}

.organize-clear-date-input::placeholder {
    color: var(--text-sub);
    font-weight: 600;
}

.organize-clear-date-input[aria-invalid="true"] {
    color: #ef4444;
}

.organize-clear-date-input:disabled {
    cursor: not-allowed;
}

.organize-clear-date-card-meta {
    font-size: 0.76rem;
    color: var(--text-sub);
}

.organize-clear-calendar-shell {
    border: 1px solid rgba(148, 163, 184, 0.14);
    border-radius: 18px;
    padding: 14px;
    background: rgba(255, 255, 255, 0.78);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

html[data-theme="dark"] .organize-clear-calendar-shell {
    background: rgba(30, 41, 59, 0.52);
    border-color: rgba(148, 163, 184, 0.1);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.organize-clear-calendar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.organize-clear-calendar-heading {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.organize-clear-calendar-label {
    font-size: 0.76rem;
    font-weight: 700;
    color: var(--text-sub);
}

.organize-clear-calendar-month {
    font-size: 0.98rem;
    font-weight: 700;
    color: var(--text-main);
}

.organize-clear-calendar-nav {
    display: flex;
    align-items: center;
    gap: 8px;
}

.organize-clear-calendar-nav-btn {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    border: 1px solid rgba(148, 163, 184, 0.16);
    background: rgba(148, 163, 184, 0.08);
    color: var(--text-main);
    cursor: pointer;
    font-size: 1rem;
    font-weight: 700;
    transition: all 0.2s ease;
}

.organize-clear-calendar-nav-btn:hover {
    border-color: rgba(99, 102, 241, 0.24);
    background: rgba(99, 102, 241, 0.08);
    color: var(--primary);
}

.organize-clear-calendar-weekdays,
.organize-clear-calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 6px;
}

.organize-clear-calendar-weekdays {
    margin-bottom: 8px;
}

.organize-clear-calendar-weekdays span {
    text-align: center;
    font-size: 0.74rem;
    font-weight: 700;
    color: var(--text-sub);
    padding: 4px 0;
}

.organize-clear-calendar-day {
    border: 1px solid transparent;
    background: transparent;
    border-radius: 12px;
    min-height: 38px;
    color: var(--text-main);
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 600;
    transition: all 0.18s ease;
}

.organize-clear-calendar-day:hover {
    background: rgba(99, 102, 241, 0.08);
    border-color: rgba(99, 102, 241, 0.14);
}

.organize-clear-calendar-day.is-muted {
    color: rgba(148, 163, 184, 0.88);
}

.organize-clear-calendar-day.is-today {
    border-color: rgba(99, 102, 241, 0.28);
}

.organize-clear-calendar-day.is-in-range {
    background: rgba(99, 102, 241, 0.08);
    color: var(--primary);
}

.organize-clear-calendar-day.is-selected,
.organize-clear-calendar-day.is-range-start,
.organize-clear-calendar-day.is-range-end {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.organize-clear-calendar-day.is-active-selection {
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.18);
}

.organize-clear-calendar-day:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.organize-clear-calendar-actions {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-top: 12px;
}

.organize-clear-calendar-action {
    border: none;
    background: rgba(99, 102, 241, 0.12);
    color: var(--primary);
    border-radius: 10px;
    padding: 8px 12px;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.organize-clear-calendar-action:hover {
    background: rgba(99, 102, 241, 0.18);
}

.organize-clear-calendar-action.secondary {
    background: rgba(148, 163, 184, 0.12);
    color: var(--text-sub);
}

.organize-clear-calendar-action.secondary:hover {
    background: rgba(148, 163, 184, 0.18);
}

.organize-clear-field-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid rgba(148, 163, 184, 0.14);
    background: rgba(255, 255, 255, 0.66);
    transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

html[data-theme="dark"] .organize-clear-field-row {
    background: rgba(30, 41, 59, 0.44);
    border-color: rgba(148, 163, 184, 0.1);
}

.organize-clear-field-row:hover {
    border-color: rgba(99, 102, 241, 0.18);
    background: rgba(99, 102, 241, 0.04);
    transform: translateY(-1px);
}

.organize-clear-field-label {
    font-size: 0.84rem;
    color: var(--text-sub);
    font-weight: 600;
}

.organize-clear-mode-chip {
    padding: 7px 12px;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.12);
    border: 1px solid rgba(148, 163, 184, 0.14);
}

.organize-clear-field-input {
    min-width: 220px;
    transition: all 0.2s ease;
}

.organize-clear-field-input:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.organize-clear-summary {
    padding: 12px 14px;
    border-radius: 14px;
    background: rgba(99, 102, 241, 0.08);
    border: 1px solid rgba(99, 102, 241, 0.12);
    color: var(--text-main);
    font-size: 0.82rem;
    line-height: 1.55;
}

.organize-clear-summary.all-mode {
    background: rgba(239, 68, 68, 0.08);
    border-color: rgba(239, 68, 68, 0.14);
}

.organize-clear-summary.pending {
    background: rgba(59, 130, 246, 0.08);
    border-color: rgba(59, 130, 246, 0.14);
}

.organize-clear-footer {
    padding: 12px 16px 14px;
    border-top: 1px solid rgba(148, 163, 184, 0.12);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.organize-clear-cancel-btn {
    border: 1px solid rgba(148, 163, 184, 0.18);
    background: rgba(148, 163, 184, 0.08);
    color: var(--text-main);
    border-radius: 10px;
    font-size: 0.84rem;
    font-weight: 600;
    padding: 8px 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.organize-clear-cancel-btn:hover {
    border-color: rgba(148, 163, 184, 0.45);
    background: rgba(148, 163, 184, 0.08);
}

.organize-clear-modal.is-busy .organize-clear-mask {
    cursor: progress;
}

.organize-clear-close-btn:disabled,
.organize-clear-cancel-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

@media (prefers-reduced-motion: reduce) {
    .organize-clear-modal,
    .organize-clear-mask,
    .organize-clear-panel,
    .organize-clear-field-row,
    .organize-clear-date-card,
    .organize-clear-calendar-day {
        transition: none !important;
    }
}

.transfer-source-tab-btn {
    border: 1px solid var(--border);
    background: rgba(148, 163, 184, 0.10);
    color: var(--text-main);
    border-radius: 999px;
    padding: 6px 12px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

html:not([data-theme="dark"]) .transfer-source-tab-btn {
    background: #f8fafc;
}

.transfer-source-tab-btn:hover {
    border-color: rgba(99, 102, 241, 0.4);
}

.transfer-source-tab-btn.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

/* 修复浅色模式下 active 背景被更高优先级规则覆盖，导致白字看不清 */
html:not([data-theme="dark"]) .transfer-source-tab-btn.active {
    background: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.28);
}

.transfer-history-container {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.transfer-source-block {
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px;
    background: rgba(148, 163, 184, 0.08);
}

html:not([data-theme="dark"]) .transfer-source-block {
    background: #f8fafc;
}

.transfer-source-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.transfer-source-title {
    margin: 0;
    font-size: 0.98rem;
    font-weight: 700;
    color: var(--text-main);
}

.transfer-source-meta {
    font-size: 0.8rem;
    color: var(--text-sub);
}

.transfer-table-wrap {
    overflow: auto;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--bg-card);
}

.transfer-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 860px;
}

.transfer-table thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    text-align: left;
    font-size: 0.78rem;
    font-weight: 700;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    background: rgba(148, 163, 184, 0.16);
    color: var(--text-main);
    white-space: nowrap;
}

html:not([data-theme="dark"]) .transfer-table thead th {
    background: #f1f5f9;
}

.transfer-table tbody td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    font-size: 0.84rem;
    color: var(--text-main);
    vertical-align: top;
}

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

.transfer-time {
    white-space: nowrap;
}

.transfer-result-cell {
    max-width: 360px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.transfer-link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

.transfer-link:hover {
    text-decoration: underline;
}

.transfer-status-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 99px;
    font-size: 0.76rem;
    font-weight: 700;
    border: 1px solid transparent;
    white-space: nowrap;
}

.transfer-status-badge.status-success {
    color: #047857;
    background: #d1fae5;
    border-color: #a7f3d0;
}

.transfer-status-badge.status-failed {
    color: #b91c1c;
    background: #fee2e2;
    border-color: #fecaca;
}

.transfer-status-badge.status-skipped {
    color: #92400e;
    background: #fef3c7;
    border-color: #fde68a;
}

.transfer-status-badge.status-replace {
    color: #1d4ed8;
    background: #dbeafe;
    border-color: #bfdbfe;
}

.transfer-status-badge.status-unknown {
    color: #4b5563;
    background: #e5e7eb;
    border-color: #d1d5db;
}

.transfer-pagination {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
    margin-top: 12px;
}

.transfer-page-info {
    font-size: 0.82rem;
    color: var(--text-sub);
}

.transfer-page-btn {
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-card);
    color: var(--text-main);
    font-size: 0.82rem;
    font-weight: 600;
    padding: 6px 10px;
    cursor: pointer;
    transition: all 0.2s;
}

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

.transfer-page-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

/* 整理历史卡片摘要 */
.organize-cards-wrap {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 10px;
}

.organize-card {
    border: 1px solid var(--border);
    background: var(--bg-card);
    border-radius: 10px;
    padding: 10px;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-main);
}

.organize-card:hover {
    border-color: rgba(99, 102, 241, 0.45);
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
    transform: translateY(-1px);
}

.organize-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
}

.organize-card-time {
    font-size: 0.78rem;
    color: var(--text-sub);
    white-space: nowrap;
}

.organize-card-runid {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 6px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.organize-card-stats {
    font-size: 0.8rem;
    color: var(--text-sub);
}

.organize-card-foot {
    margin-top: 8px;
    font-size: 0.76rem;
    color: var(--text-sub);
    display: flex;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
}

/* 整理历史详情弹窗 */
.organize-detail-modal {
    position: fixed;
    inset: 0;
    z-index: 4000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.organize-detail-mask {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(2px);
}

.organize-detail-panel {
    position: relative;
    width: min(1200px, calc(100vw - 36px));
    max-height: calc(100vh - 36px);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.22);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.organize-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
}

.organize-detail-title-wrap h3 {
    margin: 0;
    font-size: 1rem;
    color: var(--text-main);
}

.organize-detail-meta {
    margin-top: 6px;
    font-size: 0.8rem;
    color: var(--text-sub);
}

.organize-detail-close-btn {
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-main);
    border-radius: 8px;
    padding: 4px 10px;
    cursor: pointer;
    font-size: 0.9rem;
}

.organize-detail-close-btn:hover {
    border-color: rgba(99, 102, 241, 0.45);
    color: var(--primary);
}

.organize-detail-filters {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    border-bottom: 1px solid var(--border);
}

.organize-detail-content {
    padding: 10px 16px;
    overflow: auto;
    flex: 1;
}

.organize-detail-pagination {
    padding: 10px 16px 14px;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
}

body.modal-open {
    overflow: hidden;
}

.organize-recognize-modal {
    position: fixed;
    inset: 0;
    z-index: 4050;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.22s ease;
}

.organize-recognize-modal.is-open {
    opacity: 1;
    pointer-events: auto;
}

.organize-recognize-mask {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(6px);
    opacity: 0;
    transition: opacity 0.22s ease;
}

.organize-recognize-modal.is-open .organize-recognize-mask {
    opacity: 1;
}

.organize-recognize-panel {
    position: relative;
    width: min(1120px, calc(100vw - 36px));
    max-height: calc(100vh - 36px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: 24px;
    border: 1px solid rgba(148, 163, 184, 0.2);
    background: linear-gradient(180deg, rgba(248, 250, 252, 0.98) 0%, rgba(255, 255, 255, 0.96) 100%);
    box-shadow: 0 28px 60px rgba(15, 23, 42, 0.28);
    transform: translateY(20px) scale(0.985);
    transition: transform 0.22s ease;
}

.organize-recognize-modal.is-open .organize-recognize-panel {
    transform: translateY(0) scale(1);
}

html[data-theme="dark"] .organize-recognize-panel {
    border-color: rgba(99, 102, 241, 0.2);
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.98) 0%, rgba(2, 6, 23, 0.96) 100%);
    box-shadow: 0 32px 72px rgba(2, 6, 23, 0.55);
}

.organize-recognize-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    padding: 20px 22px 14px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.16);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.12), rgba(236, 72, 153, 0.08));
}

.organize-recognize-hero {
    display: flex;
    align-items: flex-start;
    gap: 14px;
}

.organize-recognize-icon {
    width: 48px;
    height: 48px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.18), rgba(236, 72, 153, 0.18));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.organize-recognize-heading {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.organize-recognize-eyebrow {
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-sub);
    font-weight: 700;
}

.organize-recognize-title {
    margin: 0;
    font-size: 1.18rem;
    font-weight: 800;
    color: var(--text-main);
}

.organize-recognize-tip {
    font-size: 0.86rem;
    line-height: 1.6;
    color: var(--text-sub);
}

.organize-recognize-close-btn {
    border: 1px solid rgba(148, 163, 184, 0.3);
    background: rgba(255, 255, 255, 0.7);
    color: var(--text-main);
    border-radius: 12px;
    padding: 7px 10px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.organize-recognize-close-btn:hover {
    color: var(--primary);
    border-color: rgba(99, 102, 241, 0.45);
    background: rgba(255, 255, 255, 0.92);
}

html[data-theme="dark"] .organize-recognize-close-btn {
    background: rgba(15, 23, 42, 0.82);
}

.organize-recognize-body {
    padding: 18px 22px 22px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-height: 0;
}

.organize-recognize-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.organize-recognize-label {
    font-size: 0.84rem;
    font-weight: 700;
    color: var(--text-main);
}

.organize-recognize-input-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.organize-recognize-input {
    flex: 1;
    min-width: 0;
    border-radius: 14px;
    border: 1px solid rgba(148, 163, 184, 0.28);
    background: rgba(255, 255, 255, 0.9);
    color: var(--text-main);
    padding: 13px 16px;
    font-size: 0.92rem;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

.organize-recognize-input:focus {
    outline: none;
    border-color: rgba(124, 58, 237, 0.55);
    box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.12);
}

html[data-theme="dark"] .organize-recognize-input {
    background: rgba(15, 23, 42, 0.88);
}

.organize-recognize-submit-btn {
    border: none;
    border-radius: 14px;
    background: linear-gradient(135deg, #7c3aed 0%, #ec4899 100%);
    color: #fff;
    font-size: 0.88rem;
    font-weight: 700;
    padding: 13px 18px;
    cursor: pointer;
    white-space: nowrap;
    box-shadow: 0 14px 28px rgba(124, 58, 237, 0.22);
    transition: all 0.2s ease;
}

.organize-recognize-submit-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 18px 32px rgba(124, 58, 237, 0.28);
}

.organize-recognize-submit-btn:disabled,
.organize-recognize-close-btn:disabled,
.organize-recognize-input:disabled {
    opacity: 0.72;
    cursor: not-allowed;
}

.organize-recognize-hints {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.organize-recognize-hint-chip,
.organize-recognize-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border-radius: 999px;
    padding: 6px 10px;
    font-size: 0.76rem;
    font-weight: 700;
    line-height: 1;
}

.organize-recognize-hint-chip {
    color: var(--primary);
    background: rgba(99, 102, 241, 0.08);
    border: 1px solid rgba(99, 102, 241, 0.16);
}

.organize-recognize-result-shell {
    flex: 1;
    min-height: 320px;
    overflow: auto;
    border-radius: 20px;
    border: 1px solid rgba(148, 163, 184, 0.16);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.78) 0%, rgba(248, 250, 252, 0.92) 100%);
    padding: 18px;
}

html[data-theme="dark"] .organize-recognize-result-shell {
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.72) 0%, rgba(15, 23, 42, 0.92) 100%);
    border-color: rgba(148, 163, 184, 0.16);
}

.organize-recognize-empty,
.organize-recognize-loading,
.organize-recognize-error {
    min-height: 284px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 10px;
    color: var(--text-sub);
}

.organize-recognize-empty-icon,
.organize-recognize-loading-spinner {
    width: 62px;
    height: 62px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.12), rgba(236, 72, 153, 0.12));
    color: var(--primary);
    font-size: 1.7rem;
}

.organize-recognize-loading-spinner {
    border: 3px solid rgba(99, 102, 241, 0.18);
    border-top-color: rgba(99, 102, 241, 0.95);
    background: transparent;
    animation: recognize-spin 0.9s linear infinite;
}

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

.organize-recognize-empty-title,
.organize-recognize-loading-title,
.organize-recognize-error-title {
    font-size: 1rem;
    font-weight: 800;
    color: var(--text-main);
}

.organize-recognize-empty-desc,
.organize-recognize-loading-desc,
.organize-recognize-error-desc {
    max-width: 680px;
    line-height: 1.7;
    font-size: 0.9rem;
}

.organize-recognize-error-title {
    color: #dc2626;
}

.organize-recognize-result {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.organize-recognize-hero-card {
    position: relative;
    overflow: hidden;
    border-radius: 20px;
    border: 1px solid rgba(99, 102, 241, 0.12);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(248, 250, 252, 0.88));
}

html[data-theme="dark"] .organize-recognize-hero-card {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.84), rgba(15, 23, 42, 0.9));
    border-color: rgba(99, 102, 241, 0.18);
}

.organize-recognize-hero-backdrop {
    position: absolute;
    inset: 0;
    opacity: 0.26;
}

.organize-recognize-hero-backdrop::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.78), rgba(15, 23, 42, 0.14));
}

.organize-recognize-hero-backdrop img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.organize-recognize-hero-content {
    position: relative;
    display: grid;
    grid-template-columns: 180px minmax(0, 1fr);
    gap: 18px;
    padding: 18px;
    align-items: flex-start;
}

.organize-recognize-hero-poster {
    width: 180px;
    max-width: 100%;
    aspect-ratio: 2 / 3;
    border-radius: 16px;
    overflow: hidden;
    background: rgba(15, 23, 42, 0.08);
    box-shadow: 0 18px 34px rgba(15, 23, 42, 0.2);
}

.organize-recognize-hero-poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.organize-recognize-hero-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: var(--primary);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(236, 72, 153, 0.12));
}

.organize-recognize-hero-body {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
}

.organize-recognize-hero-status {
    align-self: flex-start;
    border-radius: 999px;
    padding: 6px 12px;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.02em;
}

.organize-recognize-hero-status.is-success,
.organize-recognize-chip.is-success {
    color: #047857;
    background: rgba(16, 185, 129, 0.14);
    border: 1px solid rgba(16, 185, 129, 0.24);
}

.organize-recognize-hero-status.is-warn,
.organize-recognize-chip.is-warn {
    color: #b45309;
    background: rgba(245, 158, 11, 0.14);
    border: 1px solid rgba(245, 158, 11, 0.24);
}

.organize-recognize-chip.is-info {
    color: var(--primary);
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.18);
}

.organize-recognize-hero-title {
    margin: 0;
    font-size: 1.3rem;
    font-weight: 800;
    line-height: 1.3;
    color: var(--text-main);
}

.organize-recognize-hero-subtitle {
    font-size: 0.88rem;
    color: var(--text-sub);
    line-height: 1.6;
}

.organize-recognize-chip-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.organize-recognize-overview {
    font-size: 0.9rem;
    color: var(--text-main);
    line-height: 1.8;
    white-space: pre-wrap;
}

.organize-recognize-link-btn {
    align-self: flex-start;
    border-radius: 12px;
    padding: 9px 12px;
    font-size: 0.82rem;
    font-weight: 800;
    color: var(--primary);
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.18);
    text-decoration: none;
    transition: all 0.2s ease;
}

.organize-recognize-link-btn:hover {
    background: rgba(99, 102, 241, 0.16);
    border-color: rgba(99, 102, 241, 0.32);
}

.organize-recognize-notes {
    border-radius: 18px;
    border: 1px solid rgba(245, 158, 11, 0.22);
    background: linear-gradient(135deg, rgba(255, 251, 235, 0.95), rgba(255, 247, 237, 0.92));
    padding: 14px 16px;
}

html[data-theme="dark"] .organize-recognize-notes {
    background: linear-gradient(135deg, rgba(69, 26, 3, 0.3), rgba(30, 41, 59, 0.78));
}

.organize-recognize-notes-title {
    font-size: 0.82rem;
    font-weight: 800;
    color: #b45309;
    margin-bottom: 8px;
}

.organize-recognize-notes ul {
    margin: 0;
    padding-left: 18px;
    color: var(--text-main);
    line-height: 1.75;
}

.organize-recognize-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.organize-recognize-card {
    border-radius: 18px;
    border: 1px solid rgba(148, 163, 184, 0.16);
    background: rgba(255, 255, 255, 0.82);
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.06);
    padding: 16px;
}

html[data-theme="dark"] .organize-recognize-card {
    background: rgba(15, 23, 42, 0.78);
    border-color: rgba(148, 163, 184, 0.16);
    box-shadow: 0 16px 34px rgba(2, 6, 23, 0.28);
}

.organize-recognize-card-head {
    margin-bottom: 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.organize-recognize-card-eyebrow {
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-sub);
}

.organize-recognize-card-title {
    font-size: 1rem;
    font-weight: 800;
    color: var(--text-main);
}

.organize-recognize-info-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.organize-recognize-info-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 8px;
    border-bottom: 1px dashed rgba(148, 163, 184, 0.16);
}

.organize-recognize-info-row:last-child {
    padding-bottom: 0;
    border-bottom: none;
}

.organize-recognize-info-label {
    flex: 0 0 104px;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-sub);
}

.organize-recognize-info-value {
    flex: 1;
    min-width: 0;
    text-align: right;
    font-size: 0.84rem;
    color: var(--text-main);
    word-break: break-word;
    line-height: 1.65;
}

.organize-recognize-code-block {
    margin-top: 2px;
    border-radius: 14px;
    background: rgba(15, 23, 42, 0.06);
    border: 1px solid rgba(148, 163, 184, 0.14);
    padding: 12px 14px;
}

html[data-theme="dark"] .organize-recognize-code-block {
    background: rgba(15, 23, 42, 0.88);
}

.organize-recognize-code-label {
    font-size: 0.76rem;
    font-weight: 800;
    color: var(--text-sub);
    margin-bottom: 6px;
}

.organize-recognize-code-block code {
    display: block;
    font-family: Consolas, Monaco, 'Courier New', monospace;
    font-size: 0.8rem;
    line-height: 1.7;
    color: var(--text-main);
    white-space: pre-wrap;
    word-break: break-all;
}

.organize-recognize-empty-inline {
    font-size: 0.82rem;
    color: var(--text-sub);
}

.organize-recognize-modal.is-busy .organize-recognize-mask {
    cursor: progress;
}

/* 通知机器人弹窗 */
.notify-bot-inline-wrap {
    margin-top: 12px;
}

.notify-bot-inline-btn {
    border: 1px dashed rgba(99, 102, 241, 0.5);
    background: rgba(99, 102, 241, 0.08);
    color: var(--primary);
    border-radius: 10px;
    font-size: 0.8rem;
    font-weight: 700;
    padding: 8px 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.notify-bot-inline-btn:hover {
    background: rgba(99, 102, 241, 0.16);
    border-color: rgba(99, 102, 241, 0.75);
}

/* 目录选择器（频道监控目录ID） */
.directory-selector-inline-wrap {
    margin-top: 12px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.directory-selector-inline-btn {
    border: 1px dashed rgba(99, 102, 241, 0.55);
    background: rgba(99, 102, 241, 0.10);
    color: var(--primary);
    border-radius: 10px;
    font-size: 0.82rem;
    font-weight: 700;
    padding: 8px 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.directory-selector-inline-btn:hover {
    background: rgba(99, 102, 241, 0.18);
    border-color: rgba(99, 102, 241, 0.8);
}

.directory-selector-inline-hint {
    font-size: 0.78rem;
    color: var(--text-sub);
}

.directory-selector-mini-input-wrap {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.directory-selector-mini-input-wrap .form-input,
.directory-selector-mini-input-wrap .kv-value-input,
.directory-selector-mini-input-wrap .vl-input {
    flex: 1;
    min-width: 0;
}

.directory-selector-mini-btn {
    border: 1px dashed rgba(99, 102, 241, 0.5);
    background: rgba(99, 102, 241, 0.12);
    color: var(--primary);
    border-radius: 8px;
    padding: 6px 10px;
    font-size: 0.76rem;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    transition: all 0.2s;
}

.directory-selector-mini-btn:hover {
    border-color: rgba(99, 102, 241, 0.75);
    background: rgba(99, 102, 241, 0.2);
}

.directory-selector-modal {
    position: fixed;
    inset: 0;
    z-index: 5200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
}

.directory-selector-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.62);
    backdrop-filter: blur(2px);
}

.directory-selector-panel {
    position: relative;
    width: min(980px, calc(100vw - 36px));
    max-height: calc(100vh - 36px);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--bg-card);
    box-shadow: 0 26px 50px rgba(0, 0, 0, 0.28);
}

.directory-selector-head {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
}

.directory-selector-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 800;
    color: var(--text-main);
}

.directory-selector-subtitle {
    margin-top: 5px;
    font-size: 0.8rem;
    color: var(--text-sub);
}

.directory-selector-close-btn {
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-main);
    border-radius: 8px;
    padding: 4px 10px;
    cursor: pointer;
    font-size: 0.9rem;
}

.directory-selector-close-btn:hover {
    border-color: rgba(99, 102, 241, 0.45);
    color: var(--primary);
}

.directory-selector-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 16px;
    border-bottom: 1px solid var(--border);
}

.directory-selector-breadcrumb {
    min-width: 0;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
}

.directory-selector-crumb-btn {
    border: 1px solid rgba(148, 163, 184, 0.3);
    background: rgba(148, 163, 184, 0.1);
    color: var(--text-main);
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 0.76rem;
    cursor: pointer;
    max-width: 260px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.directory-selector-crumb-btn.active {
    border-color: rgba(99, 102, 241, 0.55);
    background: rgba(99, 102, 241, 0.16);
    color: var(--primary);
}

.directory-selector-crumb-sep {
    color: var(--text-sub);
    font-size: 0.85rem;
}

.directory-selector-refresh-btn {
    border: 1px solid rgba(148, 163, 184, 0.35);
    background: rgba(148, 163, 184, 0.1);
    color: var(--text-main);
    border-radius: 8px;
    padding: 6px 12px;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
}

.directory-selector-refresh-btn:hover:not(:disabled) {
    border-color: rgba(99, 102, 241, 0.45);
    color: var(--primary);
}

.directory-selector-refresh-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.directory-selector-current {
    padding: 10px 16px;
    font-size: 0.82rem;
    color: var(--text-sub);
    border-bottom: 1px solid var(--border);
}

.directory-selector-list {
    flex: 1;
    overflow: auto;
    padding: 10px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.directory-selector-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 10px;
    background: rgba(148, 163, 184, 0.08);
}

.directory-selector-enter-btn {
    flex: 1;
    min-width: 0;
    border: none;
    background: transparent;
    text-align: left;
    color: var(--text-main);
    display: flex;
    flex-direction: column;
    gap: 4px;
    cursor: pointer;
    padding: 4px;
}

.directory-selector-row-name {
    font-size: 0.86rem;
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.directory-selector-row-id {
    font-size: 0.78rem;
    color: var(--text-sub);
}

.directory-selector-pick-btn {
    border: 1px solid rgba(99, 102, 241, 0.45);
    background: rgba(99, 102, 241, 0.12);
    color: var(--primary);
    border-radius: 8px;
    padding: 6px 12px;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    flex-shrink: 0;
}

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

.directory-selector-loading,
.directory-selector-empty,
.directory-selector-error {
    padding: 14px;
    border-radius: 10px;
    font-size: 0.84rem;
}

.directory-selector-loading,
.directory-selector-empty {
    border: 1px dashed rgba(148, 163, 184, 0.35);
    color: var(--text-sub);
    background: rgba(148, 163, 184, 0.08);
}

.directory-selector-error {
    border: 1px solid rgba(239, 68, 68, 0.38);
    color: #ef4444;
    background: rgba(239, 68, 68, 0.12);
}

.directory-selector-foot {
    padding: 12px 16px 14px;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
}

.directory-selector-action-btn {
    border: 1px solid rgba(148, 163, 184, 0.35);
    background: rgba(148, 163, 184, 0.1);
    color: var(--text-main);
    border-radius: 8px;
    padding: 8px 14px;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
}

.directory-selector-action-btn.primary {
    border-color: rgba(99, 102, 241, 0.45);
    background: rgba(99, 102, 241, 0.14);
    color: var(--primary);
}

.directory-selector-action-btn:hover:not(:disabled) {
    border-color: rgba(99, 102, 241, 0.45);
    color: var(--primary);
}

.directory-selector-action-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.notify-bot-modal {
    position: fixed;
    inset: 0;
    z-index: 5100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
}

.notify-bot-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.62);
    backdrop-filter: blur(2px);
}

.notify-bot-panel {
    position: relative;
    width: min(1060px, calc(100vw - 36px));
    max-height: calc(100vh - 36px);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--bg-card);
    box-shadow: 0 26px 50px rgba(0, 0, 0, 0.28);
}

.notify-bot-head {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
}

.notify-bot-title {
    font-size: 1rem;
    font-weight: 800;
    color: var(--text-main);
}

.notify-bot-subtitle {
    margin-top: 5px;
    font-size: 0.8rem;
    color: var(--text-sub);
}

.notify-bot-close-btn {
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-main);
    border-radius: 8px;
    padding: 4px 10px;
    cursor: pointer;
}

.notify-bot-close-btn:hover {
    border-color: rgba(99, 102, 241, 0.45);
    color: var(--primary);
}

.notify-bot-body {
    padding: 12px 16px;
    display: grid;
    grid-template-columns: 0.95fr 1.05fr;
    gap: 12px;
    overflow: auto;
    flex: 1;
}

.notify-bot-panel-block {
    border: 1px solid var(--border);
    border-radius: 12px;
    background: rgba(148, 163, 184, 0.08);
    padding: 12px;
    min-width: 0;
}

html:not([data-theme="dark"]) .notify-bot-panel-block {
    background: #f8fafc;
}

.notify-bot-panel-block h3 {
    margin: 0 0 10px;
    font-size: 0.9rem;
    color: var(--text-main);
}

.notify-bot-source-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.notify-bot-source-card {
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px;
    background: var(--bg-card);
}

.notify-bot-source-title {
    font-size: 0.84rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 8px;
}

.notify-bot-bind-row {
    display: grid;
    grid-template-columns: 120px minmax(140px, 1fr);
    gap: 8px;
    align-items: center;
}

.notify-bot-bind-row + .notify-bot-bind-row {
    margin-top: 8px;
}

.notify-bot-bind-label {
    font-size: 0.78rem;
    color: var(--text-sub);
}

.notify-bot-custom-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.notify-bot-custom-card {
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px;
    background: var(--bg-card);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.notify-bot-custom-card.is-system {
    border-color: rgba(59, 130, 246, 0.35);
    background: rgba(59, 130, 246, 0.05);
}

.notify-bot-custom-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.notify-bot-custom-title {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-main);
}

.notify-bot-system-badge {
    border: 1px solid rgba(59, 130, 246, 0.4);
    color: #1d4ed8;
    background: rgba(59, 130, 246, 0.1);
    border-radius: 999px;
    padding: 2px 8px;
    font-size: 0.72rem;
    font-weight: 700;
}

.notify-bot-system-note {
    font-size: 0.76rem;
    color: var(--text-sub);
    line-height: 1.45;
}

.notify-bot-remove-btn {
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: #dc2626;
    background: rgba(239, 68, 68, 0.08);
    border-radius: 8px;
    padding: 4px 10px;
    font-size: 0.78rem;
    cursor: pointer;
}

.notify-bot-remove-btn:hover {
    background: rgba(239, 68, 68, 0.14);
}

.notify-bot-input {
    font-size: 0.82rem;
}

.notify-bot-add-btn {
    border: 1px dashed rgba(99, 102, 241, 0.5);
    background: rgba(99, 102, 241, 0.08);
    color: var(--primary);
    border-radius: 10px;
    padding: 10px;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
}

.notify-bot-add-btn:hover {
    background: rgba(99, 102, 241, 0.16);
}

.notify-bot-empty {
    padding: 10px;
    border: 1px dashed var(--border);
    border-radius: 10px;
    font-size: 0.8rem;
    color: var(--text-sub);
    text-align: center;
}

.notify-bot-help {
    margin-top: 8px;
    font-size: 0.78rem;
    color: var(--text-sub);
    line-height: 1.5;
}

.notify-bot-help code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.76rem;
}

.notify-bot-foot {
    padding: 10px 16px 14px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.notify-bot-status {
    min-height: 20px;
    font-size: 0.8rem;
    color: var(--text-sub);
}

.notify-bot-status.success {
    color: #059669;
}

.notify-bot-status.error {
    color: #dc2626;
}

.notify-bot-actions {
    display: inline-flex;
    gap: 8px;
}

.notify-bot-btn {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 7px 12px;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
}

.notify-bot-btn.ghost {
    background: transparent;
    color: var(--text-main);
}

.notify-bot-btn.primary {
    border-color: transparent;
    background: var(--primary);
    color: #fff;
}

.notify-bot-btn.primary:hover {
    background: var(--primary-hover);
}

.notify-bot-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* 可视化过滤器弹窗 */
.vf-modal {
    position: fixed;
    inset: 0;
    z-index: 5000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
}

.vf-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.62);
    backdrop-filter: blur(3px);
}

.vf-modal-panel {
    position: relative;
    width: min(1380px, calc(100vw - 36px));
    max-height: calc(100vh - 36px);
    height: calc(100vh - 36px);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--bg-card);
    box-shadow: 0 26px 50px rgba(0, 0, 0, 0.28);
}

.vf-modal-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
}

.vf-modal-title {
    font-size: 1rem;
    font-weight: 800;
    color: var(--text-main);
}

.vf-modal-subtitle {
    margin-top: 4px;
    font-size: 0.8rem;
    color: var(--text-sub);
}

.vf-close-btn {
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-main);
    border-radius: 8px;
    padding: 3px 10px;
    cursor: pointer;
    font-size: 1rem;
    line-height: 1.2;
    transition: all 0.2s;
}

.vf-close-btn:hover {
    border-color: rgba(99, 102, 241, 0.45);
    color: var(--primary);
}

.vf-modal-body {
    padding: 14px;
    overflow: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.vf-columns {
    display: grid;
    grid-template-columns: minmax(310px, 1fr) minmax(360px, 1.15fr) minmax(290px, 0.9fr);
    gap: 12px;
}

.vf-panel {
    border: 1px solid var(--border);
    border-radius: 12px;
    background: rgba(148, 163, 184, 0.08);
    padding: 12px;
    min-width: 0;
}

html:not([data-theme="dark"]) .vf-panel {
    background: #f8fafc;
}

.vf-panel h3 {
    margin: 0;
    font-size: 0.9rem;
    font-weight: 800;
    color: var(--text-main);
}

.vf-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 10px;
}

.vf-header-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.vf-scene-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.vf-scene-tab-btn {
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-main);
    border-radius: 999px;
    padding: 6px 12px;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}

.vf-scene-tab-btn:hover {
    border-color: rgba(99, 102, 241, 0.45);
    color: var(--primary);
}

.vf-scene-tab-btn.active {
    border-color: transparent;
    background: var(--primary);
    color: #fff;
}

.vf-scene-desc {
    margin-top: 8px;
    font-size: 0.78rem;
    color: var(--text-sub);
}

.vf-parse-hint {
    margin-top: 8px;
    border: 1px dashed rgba(245, 158, 11, 0.5);
    background: rgba(245, 158, 11, 0.10);
    color: #b45309;
    border-radius: 10px;
    padding: 8px 10px;
    font-size: 0.78rem;
    line-height: 1.45;
}

html[data-theme="dark"] .vf-parse-hint {
    color: #facc15;
    border-color: rgba(250, 204, 21, 0.45);
    background: rgba(234, 179, 8, 0.14);
}

.vf-search-row {
    display: grid;
    grid-template-columns: minmax(120px, 1fr) 130px auto;
    gap: 8px;
    align-items: center;
    margin-bottom: 8px;
}

.vf-select {
    min-width: 0;
}

.vf-inline-status {
    min-height: 20px;
    font-size: 0.78rem;
    color: var(--text-sub);
    margin-bottom: 8px;
}

.vf-search-results {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 58vh;
    overflow: auto;
    padding-right: 2px;
}

.vf-result-card {
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--bg-card);
    padding: 8px;
    display: grid;
    grid-template-columns: 62px 1fr auto;
    gap: 9px;
    align-items: start;
}

.vf-result-poster {
    width: 62px;
    aspect-ratio: 2 / 3;
    border-radius: 8px;
    overflow: hidden;
    background: rgba(148, 163, 184, 0.2);
    color: var(--text-sub);
    font-size: 0.72rem;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.vf-result-poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.vf-result-title {
    font-size: 0.88rem;
    font-weight: 800;
    color: var(--text-main);
}

.vf-result-meta {
    margin-top: 3px;
    font-size: 0.74rem;
    color: var(--text-sub);
}

.vf-result-overview {
    margin-top: 6px;
    font-size: 0.77rem;
    color: var(--text-sub);
    line-height: 1.45;
    display: -webkit-box;
    line-clamp: 2;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.vf-selected-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 58vh;
    overflow: auto;
}

.vf-selected-card {
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--bg-card);
    padding: 10px;
    display: grid;
    grid-template-columns: 68px 1fr;
    gap: 10px;
    min-width: 0;
}

.vf-selected-poster {
    width: 68px;
    aspect-ratio: 2 / 3;
    border-radius: 8px;
    overflow: hidden;
    background: rgba(148, 163, 184, 0.2);
    color: var(--text-sub);
    font-size: 0.72rem;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.vf-selected-poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.vf-selected-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

.vf-card-input {
    font-size: 0.82rem;
    padding-top: 9px;
    padding-bottom: 9px;
}

.vf-card-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.vf-card-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.vf-card-field-label {
    font-size: 0.78rem;
    color: var(--text-sub);
}

.vf-card-select {
    min-width: 0;
    font-size: 0.82rem;
    padding-top: 9px;
    padding-bottom: 9px;
}

.vf-selected-card-custom {
    border-style: dashed;
    border-color: rgba(99, 102, 241, 0.35);
    grid-template-columns: 56px minmax(0, 1fr);
}

.vf-selected-card-custom .vf-selected-poster {
    width: 56px;
    aspect-ratio: 1 / 1;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 700;
}

.vf-selected-card-custom .vf-selected-footer {
    justify-content: flex-start;
}

html[data-theme="dark"] .vf-selected-card-custom {
    border-color: rgba(129, 140, 248, 0.52);
    background: rgba(99, 102, 241, 0.08);
}

.vf-selected-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

.vf-year-wrap {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.78rem;
    color: var(--text-sub);
}

.vf-year-input {
    width: 90px;
    min-width: 0;
    font-size: 0.8rem;
    padding: 7px 10px;
}

.vf-all-mode-card {
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px dashed rgba(16, 185, 129, 0.45);
    border-radius: 10px;
    background: rgba(16, 185, 129, 0.08);
    color: #065f46;
    padding: 10px 12px;
    margin-bottom: 10px;
}

.vf-all-mode-icon {
    font-size: 1.2rem;
}

.vf-all-mode-title {
    font-size: 0.86rem;
    font-weight: 800;
}

.vf-all-mode-desc {
    margin-top: 2px;
    font-size: 0.76rem;
    line-height: 1.45;
}

html[data-theme="dark"] .vf-all-mode-card {
    color: #a7f3d0;
    border-color: rgba(16, 185, 129, 0.55);
    background: rgba(16, 185, 129, 0.16);
}

.vf-mode-row {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.vf-radio-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    color: var(--text-main);
}

.vf-label {
    display: block;
    font-size: 0.78rem;
    color: var(--text-sub);
    margin-bottom: 6px;
}

.vf-textarea {
    width: 100%;
    min-height: 145px;
    max-height: 280px;
    resize: none;
    border: 1px solid rgba(148, 163, 184, 0.25);
    background: rgba(148, 163, 184, 0.08);
    color: var(--text-main);
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 0.8rem;
    line-height: 1.5;
    font-family: "Cascadia Code", "Consolas", monospace;
}

html:not([data-theme="dark"]) .vf-textarea {
    border-color: #e5e7eb;
    background: #f8fafc;
}

.vf-textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.vf-save-actions {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
}

.vf-save-tip {
    font-size: 0.8rem;
    line-height: 1.45;
    color: #92400e;
    background: rgba(251, 191, 36, 0.18);
    border: 1px solid rgba(251, 191, 36, 0.55);
    border-radius: 10px;
    padding: 8px 10px;
}

.vf-save-actions .vf-btn {
    align-self: flex-end;
}

.vf-save-tip strong {
    color: #b45309;
}

html[data-theme="dark"] .vf-save-tip {
    color: #fde68a;
    background: rgba(245, 158, 11, 0.18);
    border-color: rgba(251, 191, 36, 0.5);
}

html[data-theme="dark"] .vf-save-tip strong {
    color: #fcd34d;
}

.vf-btn {
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-main);
    border-radius: 10px;
    padding: 8px 12px;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}

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

.vf-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
}

.vf-btn-primary {
    border-color: transparent;
    background: var(--primary);
    color: #fff;
}

.vf-btn-primary:hover:not(:disabled) {
    background: var(--primary-hover);
}

.vf-btn-ghost {
    border-style: dashed;
    color: var(--primary);
}

.vf-btn-ghost:hover:not(:disabled) {
    border-color: var(--primary);
    background: var(--primary-light);
}

.vf-btn-danger {
    border-color: rgba(239, 68, 68, 0.35);
    color: #dc2626;
    background: rgba(239, 68, 68, 0.08);
}

.vf-btn-danger:hover:not(:disabled) {
    background: rgba(239, 68, 68, 0.14);
}

html[data-theme="dark"] .vf-btn-danger {
    color: #fca5a5;
    border-color: rgba(239, 68, 68, 0.45);
    background: rgba(239, 68, 68, 0.14);
}

.vf-empty {
    border: 1px dashed var(--border);
    border-radius: 10px;
    padding: 12px;
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-sub);
    background: rgba(148, 163, 184, 0.05);
}

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

    .vf-search-results,
    .vf-selected-list {
        max-height: 320px;
    }
}

@media (max-width: 768px) {
    .vf-modal {
        align-items: flex-start;
        padding: calc(env(safe-area-inset-top) + 44px) 8px calc(env(safe-area-inset-bottom) + 8px);
    }

    .vf-modal-panel {
        width: calc(100vw - 10px);
        max-height: calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 52px);
        height: calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 52px);
        border-radius: 10px;
    }

    .vf-modal-head,
    .vf-modal-body {
        padding: 10px;
    }

    .vf-modal-head {
        padding-top: 12px;
    }

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

    .vf-result-card {
        grid-template-columns: 54px 1fr;
    }

    .vf-result-card .vf-btn {
        grid-column: 1 / -1;
        justify-self: flex-end;
    }

    .vf-selected-card {
        grid-template-columns: 56px 1fr;
    }

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

    .vf-year-wrap {
        width: 100%;
    }

    .vf-inline-preview {
        min-height: 82px;
    }

    .notify-bot-modal {
        align-items: flex-start;
        padding: calc(env(safe-area-inset-top) + 44px) 8px calc(env(safe-area-inset-bottom) + 8px);
    }

    .directory-selector-modal {
        align-items: flex-start;
        /* 手机上继续下移一些，避免顶部关闭按钮被遮挡 */
        padding: 8px 8px calc(env(safe-area-inset-bottom) + 8px);
        padding-top: calc(env(safe-area-inset-top) + 88px);
    }

    .directory-selector-panel {
        width: calc(100vw - 10px);
        /* 下方区域拉长：移动端固定一个更高的面板高度 */
        height: calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 96px);
        max-height: calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 96px);
        border-radius: 10px;
    }

    .notify-bot-panel {
        width: calc(100vw - 10px);
        max-height: calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 52px);
        border-radius: 10px;
    }

    .notify-bot-body {
        grid-template-columns: 1fr;
        gap: 10px;
        padding: 10px;
    }

    .notify-bot-bind-row {
        grid-template-columns: 1fr;
    }
}

html[data-theme="dark"] .transfer-status-badge.status-success {
    color: #6ee7b7;
    background: rgba(16, 185, 129, 0.2);
    border-color: rgba(16, 185, 129, 0.35);
}

html[data-theme="dark"] .transfer-status-badge.status-failed {
    color: #fca5a5;
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.35);
}

html[data-theme="dark"] .transfer-status-badge.status-skipped {
    color: #fcd34d;
    background: rgba(245, 158, 11, 0.2);
    border-color: rgba(245, 158, 11, 0.35);
}

html[data-theme="dark"] .transfer-status-badge.status-replace {
    color: #93c5fd;
    background: rgba(59, 130, 246, 0.2);
    border-color: rgba(59, 130, 246, 0.35);
}

html[data-theme="dark"] .transfer-status-badge.status-unknown {
    color: #d1d5db;
    background: rgba(148, 163, 184, 0.2);
    border-color: rgba(148, 163, 184, 0.35);
}

@media (max-width: 768px) {
    .organize-clear-modal {
        align-items: flex-start;
        padding: max(calc(env(safe-area-inset-top) + 8px), calc(var(--mobile-top-bar-offset, 88px) - 8px)) 10px calc(env(safe-area-inset-bottom) + 12px);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .transfer-history-actions {
        width: 100%;
        justify-content: flex-start;
        flex-wrap: wrap;
    }

    .transfer-history-refresh-btn {
        padding: 7px 10px;
    }

    .transfer-history-updated {
        width: 100%;
    }

    .organize-recognize-modal {
        align-items: flex-start;
        padding: max(calc(env(safe-area-inset-top) + 8px), calc(var(--mobile-top-bar-offset, 88px) - 8px)) 10px calc(env(safe-area-inset-bottom) + 12px);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .organize-recognize-panel {
        width: calc(100vw - 20px);
        max-height: none;
    }

    .organize-recognize-header {
        padding: 16px 16px 12px;
    }

    .organize-recognize-body {
        padding: 14px 16px 16px;
    }

    .organize-recognize-input-row {
        flex-direction: column;
        align-items: stretch;
    }

    .organize-recognize-submit-btn {
        width: 100%;
    }

    .organize-recognize-result-shell {
        padding: 14px;
    }

    .organize-recognize-hero-content {
        grid-template-columns: 1fr;
    }

    .organize-recognize-hero-poster {
        width: min(180px, 46vw);
        justify-self: center;
    }

    .organize-recognize-grid {
        grid-template-columns: 1fr;
    }

    .organize-recognize-info-row {
        flex-direction: column;
    }

    .organize-recognize-info-label,
    .organize-recognize-info-value {
        flex: none;
        text-align: left;
    }

    .bot-cmd-row-main {
        flex-wrap: wrap;
        gap: 6px;
    }

    .bot-cmd-switch {
        min-width: 0;
    }

    .bot-cmd-command {
        min-width: 0;
    }

    .bot-cmd-desc {
        min-width: 0;
        width: 100%;
    }

    .proxy-settings-actions {
        width: 100%;
        justify-content: space-between;
    }

    .proxy-settings-btn {
        flex: 1;
        min-width: 0;
    }

    .proxy-settings-input {
        max-width: none;
    }

    .proxy-settings-results-table th,
    .proxy-settings-results-table td {
        white-space: normal;
    }

    .transfer-pagination {
        justify-content: space-between;
        flex-wrap: wrap;
    }

    .transfer-filter-item {
        width: 100%;
    }

    .transfer-status-select {
        width: 100%;
    }

    .transfer-filter-item-keyword {
        margin-left: 0;
    }

    .transfer-result-input {
        width: 100%;
        min-width: 0;
    }

    .organize-clear-field-row {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .organize-clear-date-cards {
        grid-template-columns: 1fr;
    }

    .organize-clear-field-input {
        min-width: 0;
        width: 100%;
    }

    .organize-clear-calendar-actions {
        flex-direction: column;
    }

    .organize-clear-panel {
        width: calc(100vw - 20px);
        max-height: calc(100dvh - max(env(safe-area-inset-top), var(--mobile-top-bar-offset, 88px)) - env(safe-area-inset-bottom) - 12px);
        margin: 0 auto;
        border-radius: 16px;
    }

    .organize-clear-body {
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .organize-detail-panel {
        width: calc(100vw - 14px);
        max-height: calc(100vh - 14px);
        border-radius: 10px;
    }

    .organize-detail-header,
    .organize-detail-filters,
    .organize-detail-content,
    .organize-detail-pagination {
        padding-left: 10px;
        padding-right: 10px;
    }
}

/* Toast */
.toast-container {
    position: fixed;
    top: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    background: #1f2937;
    color: white;
    padding: 10px 24px;
    border-radius: 99px;
    font-size: 0.9rem;
    font-weight: 500;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    animation: fadeDown 0.3s;
}

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

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

/* SSH 终端容器 */
.ssh-terminal-container {
    background: #000000;
    padding: 10px;
    border-radius: var(--radius-l);
    box-shadow: var(--shadow-card);
    overflow: hidden;
    height: 500px;
    /* 固定高度，或者根据需要调整 */
    position: relative;
}

/* 隐藏 xterm 的滚动条，使用容器的 */
.xterm-viewport {
    overflow-y: auto !important;
}

/* ====== SSH 头部美化 ====== */
.ssh-header {
    display: flex;
    justify-content: space-between;
    /* 左右对齐 */
    align-items: center;
    /* 垂直居中 */
    margin-bottom: 20px;
    /* 增加底部间距 */
    padding: 0 4px;
    flex-wrap: wrap;
    /* 手机端自动换行 */
    gap: 12px;
}

/* 左侧标题区域 - 修复对齐问题 */
.ssh-header-main {
    display: flex;
    align-items: center;
    /* 垂直居中核心代码 */
    gap: 10px;
}

.ssh-header-icon {
    font-size: 1.6rem;
    line-height: 1;
    /* 关键：强制行高为 1，消除上下间隙 */

    /* 额外技巧：让 Emoji 自身也居中，并微调位置 */
    display: flex;
    align-items: center;
    justify-content: center;

    /* 微调：Emoji 视觉上通常偏高，往下压 1-2px 会更协调 */
    transform: translateY(2px);

    /* 阴影增加立体感 */
    filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.1));
}

.ssh-title {
    font-size: 1.25rem;
    font-weight: 800;
    color: #111827;
    letter-spacing: -0.5px;
    line-height: 1;
    /* 保持标题行高紧凑 */

    /* 渐变色文字效果（可选，不喜欢可以删掉 background 相关属性） */
    background: linear-gradient(135deg, #1f2937 0%, #4b5563 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

html[data-theme="dark"] .ssh-title {
    background: linear-gradient(135deg, #e5e7eb 0%, #9ca3af 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* 右侧（或下方）的安全提示胶囊 */
.ssh-tip-box {
    display: flex;
    align-items: center;
    gap: 8px;
    background-color: #ecfdf5;
    /* 淡绿色背景 (安全感) */
    border: 1px solid #d1fae5;
    padding: 6px 12px;
    border-radius: 99px;
    /* 胶囊形状 */
    font-size: 0.8rem;
    color: #047857;
    /* 深绿色文字 */
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
    max-width: 100%;
}

html[data-theme="dark"] .ssh-tip-box {
    background-color: rgba(16, 185, 129, 0.15);
    border-color: rgba(16, 185, 129, 0.25);
    color: #6ee7b7;
}

.ssh-tip-icon {
    font-size: 1rem;
}

.ssh-tip-text b {
    font-weight: 700;
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-decoration-color: #10b981;
}

/* 移动端适配：变为垂直排列 */
@media (max-width: 600px) {
    .ssh-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .ssh-tip-box {
        width: 100%;
        border-radius: 8px;
        /* 手机上改圆角矩形 */
        justify-content: center;
    }
}

/* =========================================
   SSH 配置栏样式优化 (Flex 布局)
   ========================================= */
.ssh-config {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-l);
    box-shadow: var(--shadow-card);
    padding: 20px;

    /* 改用 Flex 布局，自动换行，对齐底部 */
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: flex-end;
    /* 让按钮和输入框底部对齐 */

    margin-bottom: 16px;
}

.ssh-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
    /* 自动撑开宽度 */
    min-width: 140px;
    /* 防止太窄 */
}

/* 针对端口号输入框，让它窄一点，看起来更协调 */
.ssh-field:nth-child(2) {
    flex: 0.4;
    min-width: 80px;
}

.ssh-label {
    font-size: 13px;
    color: #4b5563;
    font-weight: 600;
    margin-left: 2px;
}

.ssh-input {
    width: 100%;
    height: 40px;
    /* 固定高度 */
    padding: 0 12px;
    border: 1px solid rgba(148, 163, 184, 0.20);
    border-radius: 8px;
    background: rgba(15, 23, 42, 0.55);
    outline: none;
    font-size: 14px;
    font-family: 'Inter', monospace;
    /* 数字显示更好看 */
    transition: all 0.2s;
    color: var(--text-main);
}

html:not([data-theme="dark"]) .ssh-input {
    border-color: #d1d5db;
    background: #fff;
    color: #1f2937;
}

.ssh-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

/* 按钮样式优化 */
.ssh-save,
.ssh-connect {
    height: 40px;
    /* 与输入框高度一致 */
    padding: 0 20px;
    border-radius: 8px;
    border: none;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 80px;
}

.ssh-save {
    background: #eff6ff;
    color: var(--primary);
    border: 1px solid transparent;
}

html[data-theme="dark"] .ssh-save {
    background: rgba(99, 102, 241, 0.15);
    color: #a5b4fc;
}

.ssh-save:hover {
    background: #dbeafe;
    border-color: #bfdbfe;
}

html[data-theme="dark"] .ssh-save:hover {
    background: rgba(99, 102, 241, 0.25);
    border-color: rgba(99, 102, 241, 0.35);
}

.ssh-connect {
    background: #10b981;
    color: #fff;
    box-shadow: 0 2px 5px rgba(16, 185, 129, 0.2);
}

.ssh-connect:hover {
    background: #059669;
    transform: translateY(-1px);
}

.ssh-connect:active {
    transform: translateY(0);
}

.ssh-connect:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* 连接成功后的状态 */
.ssh-connect.connected {
    background: #ef4444;
    /* 变成红色断开按钮 */
    box-shadow: none;
}

.ssh-connect.connected:hover {
    background: #dc2626;
}

/* 移动端适配 */
@media (max-width: 768px) {
    .ssh-config {
        flex-direction: column;
        /* 手机上垂直排列 */
        align-items: stretch;
        gap: 12px;
    }

    .ssh-field,
    .ssh-field:nth-child(2) {
        width: 100%;
        flex: none;
    }

    .ssh-save,
    .ssh-connect {
        width: 100%;
        margin-top: 4px;
    }
}

/* Pansou 3列自适应网格 - 强制覆盖默认单列/双列样式 */
.pansou-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 10px;
}

@media (max-width: 768px) {
    .pansou-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

@media (max-width: 480px) {
    .pansou-grid {
        grid-template-columns: 1fr !important;
    }
}

/* 后缀名自适应网格 */
.ext-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(102px, 1fr)) !important;
    gap: 5px;
}

.ext-grid .value-list-card {
    flex-direction: row;
    align-items: center;
    gap: 6px;
    padding: 5px 6px;
}

.ext-grid .vl-input {
    padding: 4px 7px;
    font-size: 0.9rem;
}

.ext-grid .vl-delete-btn {
    width: 18px;
    height: 18px;
    font-size: 0.9rem;
    align-self: center;
}

@media (max-width: 768px) {
    .ext-grid {
        grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)) !important;
    }
}

@media (max-width: 480px) {
    .ext-grid {
        grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)) !important;
    }
}

/* 复选框网格布局 (Douban Hot) */
.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
    margin-top: 8px;
}

.checkbox-card {
    background: rgba(148, 163, 184, 0.10);
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: var(--radius-m);
    padding: 10px 12px;
    transition: all 0.2s;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    user-select: none;
    font-size: 0.9rem;
    color: var(--text-main);
    font-weight: 500;
}

html:not([data-theme="dark"]) .checkbox-card {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
}

.checkbox-card:hover {
    background: #f3f4f6;
    border-color: #d1d5db;
}

html[data-theme="dark"] .checkbox-card:hover {
    background: rgba(148, 163, 184, 0.15);
    border-color: rgba(148, 163, 184, 0.25);
}

.checkbox-card.checked {
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary);
    font-weight: 600;
}

.checkbox-card input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
    cursor: pointer;
    flex-shrink: 0;
}

/* ===============================
   Emby 仪表盘
   =============================== */
.emby-dashboard-wrap {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.emby-dashboard-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.emby-dashboard-title {
    margin: 0;
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--text-main);
}

.emby-dashboard-date {
    margin-top: 4px;
    font-size: 0.8rem;
    color: #9ca3af;
    font-weight: 700;
}

.emby-dashboard-tip {
    margin-top: 6px;
    font-size: 0.76rem;
    color: #94a3b8;
    line-height: 1.5;
}

.emby-dashboard-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.emby-config-btn {
    border: 1px solid rgba(59, 130, 246, 0.25);
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.12), rgba(37, 99, 235, 0.08));
    color: #2563eb;
    border-radius: 12px;
    padding: 9px 14px;
    font-size: 0.86rem;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.2s ease;
}

.emby-config-btn:hover {
    border-color: #3b82f6;
    color: #1d4ed8;
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(37, 99, 235, 0.18);
}

.emby-refresh-btn {
    border: 1px solid rgba(16, 185, 129, 0.28);
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.14), rgba(5, 150, 105, 0.08));
    color: #047857;
    border-radius: 12px;
    padding: 9px 14px;
    font-size: 0.86rem;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.2s ease;
}

.emby-refresh-btn:hover:not(:disabled) {
    border-color: #10b981;
    color: #065f46;
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(16, 185, 129, 0.22);
}

.emby-refresh-btn:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

.emby-setup-panel {
    border: 1px solid rgba(59, 130, 246, 0.18);
    border-radius: 16px;
    background: linear-gradient(180deg, rgba(59, 130, 246, 0.06), rgba(59, 130, 246, 0.02));
    padding: 18px;
}

.emby-setup-card {
    max-width: 760px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--bg-card);
    padding: 18px;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
}

.emby-setup-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.2px;
    background: rgba(59, 130, 246, 0.12);
    color: #2563eb;
}

.emby-setup-title {
    margin-top: 10px;
    font-size: 1rem;
    font-weight: 800;
    color: var(--text-main);
}

.emby-setup-desc {
    margin-top: 6px;
    color: #9ca3af;
    font-size: 0.83rem;
    line-height: 1.5;
}

.emby-setup-desc code {
    background: rgba(148, 163, 184, 0.16);
    border: 1px solid rgba(148, 163, 184, 0.25);
    border-radius: 6px;
    padding: 1px 6px;
    color: var(--text-main);
    font-size: 0.78rem;
}

.emby-setup-form {
    margin-top: 14px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 9px;
}

.emby-setup-label {
    font-size: 0.8rem;
    font-weight: 700;
    color: #64748b;
}

.emby-setup-input {
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-main);
    border-radius: 12px;
    padding: 11px 12px;
    font-size: 0.9rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.emby-setup-input:focus {
    outline: none;
    border-color: #60a5fa;
    box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.22);
}

.emby-setup-password-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.emby-setup-password-wrap .emby-setup-input {
    width: 100%;
    padding-right: 44px;
}

.emby-setup-toggle-key {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 30px;
    height: 30px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    cursor: pointer;
    font-size: 0.9rem;
    line-height: 1;
}

.emby-setup-toggle-key:hover {
    background: rgba(148, 163, 184, 0.18);
}

.emby-setup-actions {
    margin-top: 8px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.emby-setup-btn {
    border-radius: 12px;
    padding: 10px 14px;
    font-size: 0.86rem;
    font-weight: 800;
    cursor: pointer;
    border: 1px solid var(--border);
    transition: all 0.2s ease;
}

.emby-setup-btn.primary {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    border-color: #2563eb;
    color: #fff;
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.28);
}

.emby-setup-btn.secondary {
    background: rgba(148, 163, 184, 0.08);
    color: #334155;
}

.emby-setup-btn.danger {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.25);
    color: #dc2626;
}

.emby-setup-btn:hover:not(:disabled) {
    transform: translateY(-1px);
}

.emby-setup-btn:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

.emby-setup-result {
    min-height: 24px;
    margin-top: 4px;
    font-size: 0.82rem;
    border-radius: 10px;
    padding: 7px 10px;
    border: 1px solid transparent;
}

.emby-setup-result.info {
    color: #64748b;
    background: rgba(148, 163, 184, 0.08);
    border-color: rgba(148, 163, 184, 0.22);
}

.emby-setup-result.success {
    color: #059669;
    background: rgba(16, 185, 129, 0.1);
    border-color: rgba(16, 185, 129, 0.22);
}

.emby-setup-result.error {
    color: #dc2626;
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.25);
}

.emby-setup-tip {
    margin-top: 2px;
    font-size: 0.75rem;
    color: #94a3b8;
}

.emby-user-select {
    min-width: 220px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-main);
    border-radius: 10px;
    padding: 8px 12px;
    font-size: 0.9rem;
    font-weight: 600;
}

.emby-live-btn {
    position: relative;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-main);
    border-radius: 10px;
    width: 40px;
    height: 40px;
    cursor: pointer;
}

.emby-live-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    min-width: 18px;
    height: 18px;
    border-radius: 999px;
    background: #ef4444;
    color: #fff;
    font-size: 11px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

.hidden {
    display: none !important;
}

.emby-live-dropdown {
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--bg-card);
    overflow: hidden;
}

.emby-live-head {
    padding: 10px 12px;
    display: flex;
    justify-content: space-between;
    border-bottom: 1px solid var(--border);
    font-size: 0.85rem;
    font-weight: 700;
}

.emby-live-list {
    max-height: 320px;
    overflow: auto;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.emby-live-item {
    display: grid;
    grid-template-columns: 48px 1fr;
    gap: 10px;
    padding: 8px;
    border: 1px solid var(--border);
    border-radius: 10px;
    text-decoration: none;
    color: inherit;
}

.emby-live-item img {
    width: 48px;
    height: 68px;
    object-fit: cover;
    border-radius: 8px;
    background: #111827;
}

.emby-live-title {
    font-size: 0.86rem;
    font-weight: 700;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.emby-live-meta {
    margin-top: 2px;
    font-size: 0.75rem;
    color: #9ca3af;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.emby-live-progress {
    margin-top: 8px;
    height: 6px;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.25);
    overflow: hidden;
}

.emby-live-progress span {
    display: block;
    height: 100%;
    background: #3b82f6;
}

.emby-metrics-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.emby-metric-card {
    border: 1px solid var(--border);
    background: var(--bg-card);
    border-radius: 12px;
    padding: 12px;
}

.emby-metric-label {
    font-size: 0.76rem;
    color: #9ca3af;
    font-weight: 700;
}

.emby-metric-value {
    margin-top: 6px;
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--text-main);
    line-height: 1;
}

.emby-panel {
    border: 1px solid var(--border);
    background: var(--bg-card);
    border-radius: 12px;
    padding: 12px;
}

.emby-panel-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.emby-panel-title {
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--text-main);
    margin-bottom: 10px;
}

.emby-library-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 10px;
}

.emby-library-card {
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    background: var(--bg-card);
}

.emby-library-card img {
    width: 100%;
    aspect-ratio: 16/9;
    object-fit: cover;
    background: #0f172a;
}

.emby-library-name {
    font-size: 0.85rem;
    font-weight: 700;
    padding: 8px;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.emby-two-cols {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.emby-poster-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(108px, 1fr));
    gap: 10px;
}

.emby-poster-card {
    text-decoration: none;
    color: inherit;
}

.emby-poster-card img {
    width: 100%;
    aspect-ratio: 2/3;
    object-fit: cover;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: #0f172a;
}

.emby-poster-title {
    margin-top: 6px;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.emby-poster-meta {
    margin-top: 2px;
    font-size: 0.72rem;
    color: #9ca3af;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.emby-trend-actions {
    display: inline-flex;
    gap: 6px;
}

.emby-trend-btn {
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-main);
    border-radius: 8px;
    padding: 4px 8px;
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
}

.emby-trend-btn.active {
    background: #3b82f6;
    border-color: #3b82f6;
    color: #fff;
}

.emby-chart-box {
    height: 260px;
}

.emby-top-users {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 320px;
    overflow: auto;
}

.emby-user-row {
    display: grid;
    grid-template-columns: 28px 1fr auto;
    gap: 10px;
    align-items: center;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 8px;
}

.emby-user-rank {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: rgba(99, 102, 241, 0.15);
    color: #6366f1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 800;
}

.emby-user-name {
    font-size: 0.84rem;
    font-weight: 700;
    color: var(--text-main);
}

.emby-user-meta {
    font-size: 0.72rem;
    color: #9ca3af;
}

.emby-user-time {
    font-size: 0.84rem;
    font-weight: 800;
    color: var(--text-main);
}

.emby-loading,
.emby-empty,
.emby-error {
    text-align: center;
    padding: 16px 8px;
    font-size: 0.85rem;
    color: #9ca3af;
}

.emby-error {
    color: #ef4444;
}

/* ===============================
   Emby 反代配置页
   =============================== */
.emby-proxy-wrap {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.emby-proxy-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.emby-proxy-title {
    margin: 0;
    font-size: 1.28rem;
    font-weight: 800;
    color: var(--text-main);
}

.emby-proxy-tip {
    margin-top: 6px;
    font-size: 0.8rem;
    color: #94a3b8;
    line-height: 1.6;
}

.emby-proxy-tip code {
    background: rgba(148, 163, 184, 0.16);
    border: 1px solid rgba(148, 163, 184, 0.24);
    border-radius: 6px;
    padding: 1px 6px;
    color: var(--text-main);
    font-size: 0.76rem;
}

.emby-proxy-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.emby-proxy-btn {
    border-radius: 12px;
    padding: 9px 14px;
    font-size: 0.86rem;
    font-weight: 800;
    cursor: pointer;
    border: 1px solid var(--border);
    transition: all 0.2s ease;
}

.emby-proxy-btn.primary {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    border-color: #2563eb;
    color: #fff;
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.25);
}

.emby-proxy-btn.secondary {
    background: rgba(148, 163, 184, 0.08);
    color: #334155;
}

.emby-proxy-btn.danger {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.25);
    color: #dc2626;
}

.emby-proxy-btn:hover:not(:disabled) {
    transform: translateY(-1px);
}

.emby-proxy-btn:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

.emby-proxy-result {
    border-radius: 10px;
    padding: 9px 12px;
    font-size: 0.82rem;
    border: 1px solid transparent;
}

.emby-proxy-result.info {
    color: #64748b;
    background: rgba(148, 163, 184, 0.08);
    border-color: rgba(148, 163, 184, 0.22);
}

.emby-proxy-result.success {
    color: #059669;
    background: rgba(16, 185, 129, 0.1);
    border-color: rgba(16, 185, 129, 0.22);
}

.emby-proxy-result.error {
    color: #dc2626;
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.25);
}

.emby-proxy-cards {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.emby-proxy-card {
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 12px;
    background: var(--bg-card);
    box-shadow: 0 4px 14px rgba(2, 6, 23, 0.04);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.emby-proxy-card-head {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
}

.emby-proxy-name-input {
    min-width: 0;
    max-width: none;
}

.emby-proxy-card-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    align-items: stretch;
}

.emby-proxy-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.emby-proxy-field>span {
    font-size: 0.74rem;
    color: #64748b;
    font-weight: 700;
}

.emby-proxy-input {
    width: 100%;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-main);
    border-radius: 10px;
    padding: 8px 10px;
    font-size: 0.84rem;
}

.emby-proxy-input:focus {
    outline: none;
    border-color: #60a5fa;
    box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.2);
}

.emby-proxy-api-wrap {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 6px;
}

.emby-proxy-mini-btn {
    border: 1px solid var(--border);
    background: rgba(148, 163, 184, 0.08);
    color: var(--text-main);
    border-radius: 8px;
    padding: 6px 8px;
    font-size: 0.76rem;
    font-weight: 700;
    cursor: pointer;
}

.emby-proxy-mini-btn:hover {
    border-color: #94a3b8;
}

.emby-proxy-mini-btn.danger {
    color: #dc2626;
    border-color: rgba(239, 68, 68, 0.28);
    background: rgba(239, 68, 68, 0.1);
}

.emby-proxy-mini-btn.success {
    color: #065f46;
    border-color: rgba(16, 185, 129, 0.28);
    background: rgba(16, 185, 129, 0.1);
}

.emby-proxy-mini-btn.primary {
    color: #1d4ed8;
    border-color: rgba(59, 130, 246, 0.32);
    background: rgba(59, 130, 246, 0.1);
}

.emby-proxy-center {
    text-align: center;
}

.emby-proxy-status {
    display: inline-flex;
    align-items: center;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 800;
}

.emby-proxy-status.running {
    color: #065f46;
    background: rgba(16, 185, 129, 0.16);
}

.emby-proxy-status.stopped {
    color: #92400e;
    background: rgba(251, 191, 36, 0.2);
}

.emby-proxy-status.disabled {
    color: #475569;
    background: rgba(148, 163, 184, 0.18);
}

.emby-proxy-status-error {
    margin-top: 4px;
    font-size: 0.72rem;
    color: #dc2626;
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.emby-proxy-row-actions {
    display: inline-flex;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.emby-proxy-hidden-flag {
    display: none;
}

.emby-proxy-empty {
    text-align: center;
    color: #94a3b8;
    font-size: 0.84rem;
    padding: 22px 8px;
    border: 1px dashed rgba(148, 163, 184, 0.35);
    border-radius: 12px;
}

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

@media (max-width: 980px) {
    .emby-metrics-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .emby-two-cols {
        grid-template-columns: 1fr;
    }

    .emby-proxy-cards {
        grid-template-columns: 1fr;
    }

    .emby-proxy-card-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .emby-user-select {
        min-width: 150px;
    }

    /* 手机视图：我的媒体库至少 2 列 */
    #emby-library-container.emby-library-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    /* 手机视图：最近入库至少 3 列 */
    #emby-latest-container.emby-poster-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    /* 手机视图：继续播放至少 3 列 */
    #emby-recent-container.emby-poster-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .emby-metrics-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .emby-metric-value {
        font-size: 1.3rem;
    }
}
