/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: #e0e0e0;
    min-height: 100vh;
    line-height: 1.6;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* 头部样式 */
.header {
    text-align: center;
    padding: 30px 0;
    margin-bottom: 30px;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 10px;
}

.logo i {
    font-size: 48px;
    color: #4facfe;
    animation: rotate 10s linear infinite;
}

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

.logo h1 {
    font-size: 42px;
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
}

.subtitle {
    color: #888;
    font-size: 16px;
}

.header-view-switch {
    margin-top: 12px;
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 8px 10px;
    row-gap: 10px;
    max-width: 100%;
    padding: 0 8px;
    box-sizing: border-box;
}

/* 页头「移动版 / 版本 / 用户」统一为同一套胶囊尺寸，避免字级与 padding 不一致 */
.header-view-switch > a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.25;
    min-height: 32px;
    padding: 6px 14px;
    color: rgba(127, 208, 255, 0.9);
    text-decoration: none;
    border-radius: 999px;
    border: 1px solid rgba(79, 172, 254, 0.32);
    background: rgba(79, 172, 254, 0.1);
    transition: background 0.2s ease, border-color 0.2s ease;
}

.header-view-switch > a:hover {
    background: rgba(79, 172, 254, 0.2);
    border-color: rgba(79, 172, 254, 0.48);
}

.app-version-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.25;
    letter-spacing: 0.02em;
    min-height: 32px;
    padding: 6px 14px;
    color: rgba(180, 220, 255, 0.95);
    background: rgba(79, 172, 254, 0.12);
    border: 1px solid rgba(79, 172, 254, 0.38);
    border-radius: 999px;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.app-version-btn:hover,
.app-version-btn:focus {
    background: rgba(79, 172, 254, 0.22);
    border-color: rgba(79, 172, 254, 0.55);
    color: #fff;
    outline: none;
}

.header-logout-form {
    display: inline-flex;
    margin: 0;
    align-items: center;
}

.header-logout-btn {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: rgba(255, 200, 200, 0.95);
    background: rgba(255, 99, 99, 0.12);
    border: 1px solid rgba(255, 120, 120, 0.4);
    border-radius: 999px;
    padding: 4px 12px;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.header-logout-btn:hover,
.header-logout-btn:focus {
    background: rgba(255, 99, 99, 0.22);
    border-color: rgba(255, 140, 140, 0.6);
    color: #fff;
    outline: none;
}

/* ---------- 已登录：用户菜单（右上角） ---------- */
.header-user-menu {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.header-user-menu-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.25;
    color: rgba(210, 235, 255, 0.95);
    background: rgba(79, 172, 254, 0.12);
    border: 1px solid rgba(79, 172, 254, 0.38);
    border-radius: 999px;
    min-height: 32px;
    padding: 6px 12px 6px 10px;
    cursor: pointer;
    /* 短用户名随内容收窄；过长时在 max-width 内省略 */
    width: fit-content;
    max-width: min(440px, calc(100% - 8px));
    transition: background 0.2s ease, border-color 0.2s ease;
}

.header-user-menu-icon {
    flex: 0 0 auto;
    font-size: 1.05em;
    line-height: 1;
}

.header-user-menu-name {
    flex: 0 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: left;
}

.header-user-menu-toggle:hover,
.header-user-menu-toggle:focus {
    background: rgba(79, 172, 254, 0.22);
    border-color: rgba(79, 172, 254, 0.55);
    outline: none;
}

.header-user-menu-chevron {
    flex: 0 0 auto;
    font-size: 10px;
    line-height: 1;
    opacity: 0.75;
    margin-left: 2px;
}

.header-user-menu-panel {
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    min-width: 168px;
    padding: 6px;
    border-radius: 10px;
    background: rgba(12, 18, 32, 0.96);
    border: 1px solid rgba(79, 172, 254, 0.32);
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.45);
    z-index: 80;
}

.header-user-menu-panel[hidden] {
    display: none !important;
}

.header-user-menu-panel.is-open {
    display: block !important;
}

.header-user-menu-item {
    display: block;
    width: 100%;
    text-align: left;
    margin: 0;
    padding: 9px 12px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: rgba(226, 238, 255, 0.95);
    font-size: 13px;
    cursor: pointer;
    transition: background 0.15s ease;
}

.header-user-menu-item:hover,
.header-user-menu-item:focus {
    background: rgba(79, 172, 254, 0.18);
    outline: none;
}

.header-user-menu-item--danger {
    color: #fecaca;
}

.header-user-menu-item--danger:hover,
.header-user-menu-item--danger:focus {
    background: rgba(248, 113, 113, 0.15);
}

.header-user-menu-logout-form {
    margin: 0;
    padding: 0;
}

.modal-credentials-dialog {
    max-width: 440px;
}

.modal-credentials-error {
    min-height: 1.25em;
    margin: 0 0 10px;
    font-size: 13px;
    color: #fecaca;
}

.modal-credentials-fields {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 12px;
}

.modal-credentials-label {
    font-size: 12px;
    color: rgba(200, 215, 240, 0.88);
}

.modal-changelog-dialog {
    max-width: 520px;
    text-align: left;
}

.modal-changelog-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 4px;
}

.modal-changelog-title {
    margin: 0;
    flex: 1;
    min-width: 0;
    padding-right: 4px;
}

.modal-changelog-close {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    margin: -4px -6px 0 0;
    padding: 0;
    border: none;
    border-radius: 8px;
    font-size: 22px;
    line-height: 1;
    color: rgba(255, 255, 255, 0.75);
    background: rgba(255, 255, 255, 0.08);
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.modal-changelog-close:hover {
    color: #fff;
    background: rgba(248, 113, 113, 0.35);
}

.modal-changelog-hint {
    margin-top: 0;
}

.modal-changelog-body {
    max-height: min(58vh, 440px);
    overflow-y: auto;
    margin: 6px 0 4px;
    padding-right: 4px;
    font-size: 13px;
    line-height: 1.55;
    color: rgba(255, 255, 255, 0.9);
}

.changelog-entry + .changelog-entry {
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.changelog-version {
    margin: 0 0 4px;
    font-size: 15px;
    font-weight: 700;
    color: rgba(127, 208, 255, 0.95);
}

.changelog-date {
    margin: 0 0 10px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.48);
}

.changelog-list {
    margin: 0;
    padding-left: 1.25em;
}

.changelog-list li {
    margin-bottom: 6px;
}

.changelog-list li:last-child {
    margin-bottom: 0;
}

/* 主要内容区域 - 上下结构 */
.main-content-vertical {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 20px;
}

/* 顶栏：右侧「已选择目标」为自然高度基准；左侧高度由 initDesktopTopSectionSync() 与右侧对齐，避免 flex stretch 把右侧拉得过高 */
.top-section {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.top-section > aside.config-panel:not(.file-browser-panel) {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
    align-self: flex-start;
}

/* 文件浏览器主面板：总高度由脚本与右栏一致；内部 .browser-list 用 flex+min-height:0 撑满并滚动 */
.config-panel.file-browser-panel {
    flex: 1.15;
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    overflow: hidden;
}

.file-browser-panel > .panel-header,
.file-browser-panel > .browse-hint-details {
    flex-shrink: 0;
}

.panel-header.file-browser-section-title {
    margin-bottom: 12px;
    padding-bottom: 12px;
}

.file-browser-panel > .browser {
    flex: 1;
    min-height: 0;
}

/* minfo 风格文件浏览器（配色适配本项目深色主题） */
.browser {
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 14px;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.28);
    min-height: 0;
}

.browser-toolbar {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: rgba(79, 172, 254, 0.06);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    flex-shrink: 0;
}

.search-actions {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.browser-icon-btn {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.85);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, border-color 0.15s;
}

.browser-icon-btn:hover {
    background: rgba(79, 172, 254, 0.15);
    border-color: rgba(79, 172, 254, 0.4);
}

.browser-current {
    flex: 1;
    min-width: 0;
    font-family: ui-monospace, Consolas, "Courier New", monospace;
    font-size: 0.82rem;
    line-height: 1.35;
    color: rgba(255, 255, 255, 0.65);
    text-align: right;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.browser-sort-wrap {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.browser-sort-label {
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.45);
    white-space: nowrap;
}

.browser-sort-select {
    min-width: 0;
    max-width: 118px;
    padding: 6px 8px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(12, 18, 32, 0.92);
    color: #e8eef8;
    font-size: 0.82rem;
    outline: none;
    cursor: pointer;
    color-scheme: dark;
    -webkit-appearance: none;
    appearance: none;
}

.browser-sort-select:focus {
    border-color: #4facfe;
}

.browser-sort-select option {
    background: #1a1a2e;
    color: #f0f4fa;
}

.browser-sort-dir-btn {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.88);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    line-height: 1;
    transition: background 0.15s, border-color 0.15s;
}

.browser-sort-dir-btn:hover {
    background: rgba(79, 172, 254, 0.15);
    border-color: rgba(79, 172, 254, 0.4);
}

.browser-sort-dir-icon {
    pointer-events: none;
}

.browser-search {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(0, 0, 0, 0.18);
    flex-shrink: 0;
}

.browser-search-icon {
    color: rgba(255, 255, 255, 0.35);
    font-size: 14px;
}

.browser-search-input {
    flex: 1;
    min-width: 0;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    padding: 9px 12px;
    font-size: 0.95rem;
    outline: none;
    background: rgba(12, 18, 32, 0.92);
    color: #f0f4fa;
    color-scheme: dark;
    -webkit-appearance: none;
    appearance: none;
}

.browser-search input.browser-search-input[type="search"] {
    background-color: rgba(12, 18, 32, 0.92) !important;
    color: #f0f4fa !important;
}

.browser-search-input:focus {
    border-color: #4facfe;
}

.browser-search-input::placeholder {
    color: rgba(255, 255, 255, 0.38);
}

.browser-search-input::-webkit-search-cancel-button {
    -webkit-appearance: none;
    appearance: none;
    height: 14px;
    width: 14px;
    cursor: pointer;
    background: linear-gradient(45deg, transparent 45%, rgba(255, 255, 255, 0.45) 45%, rgba(255, 255, 255, 0.45) 55%, transparent 55%),
        linear-gradient(-45deg, transparent 45%, rgba(255, 255, 255, 0.45) 45%, rgba(255, 255, 255, 0.45) 55%, transparent 55%);
}

.browser-list {
    padding: 8px;
    overflow-x: hidden;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
    min-height: 0;
    position: relative;
}

.browser-list.browser-list--drop-hover {
    outline: 2px dashed rgba(79, 172, 254, 0.75);
    outline-offset: -4px;
    background: rgba(79, 172, 254, 0.08);
}

.browser-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 10px;
    cursor: pointer;
    user-select: none;
    transition: background 0.15s;
}

.browser-row:not(.empty):hover {
    background: rgba(79, 172, 254, 0.12);
}

.browser-row.selected {
    background: rgba(79, 172, 254, 0.22);
    box-shadow: inset 0 0 0 1px rgba(79, 172, 254, 0.35);
}

/** 浏览器内剪切（Ctrl+X）待粘贴：弱化 / 接近「虚化」观感 */
.browser-row.browser-row--cut-pending {
    opacity: 0.48;
    filter: grayscale(42%);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
    transition: opacity 0.2s ease, filter 0.2s ease;
}

.browser-row.browser-row--cut-pending .browser-row-name {
    color: rgba(255, 255, 255, 0.72);
}

.browser-row.directory .browser-row-name {
    font-weight: 600;
}

.browser-row.empty {
    cursor: default;
    color: rgba(255, 255, 255, 0.45);
    justify-content: flex-start;
}

.browser-row-main {
    min-width: 0;
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
}

.browser-row-text-col {
    min-width: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 3px;
}

.browser-row-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
    font-size: 0.72rem;
    line-height: 1.35;
    color: rgba(255, 255, 255, 0.42);
    word-break: break-all;
    font-variant-numeric: tabular-nums;
}

.browser-row-meta-lead {
    white-space: nowrap;
}

.browser-row-meta-icons {
    display: inline-flex;
    align-items: center;
    gap: 12px;
}

.browser-meta-count {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.browser-meta-count .fa-folder-open {
    color: rgba(186, 230, 253, 0.9);
    font-size: 0.88em;
}

.browser-meta-count .fa-file-alt {
    color: rgba(255, 255, 255, 0.38);
    font-size: 0.85em;
}

.browser-meta-num {
    font-variant-numeric: tabular-nums;
}

.browser-row-chevron {
    flex-shrink: 0;
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.28);
    padding: 0 2px;
}

.browser-row-icon {
    flex-shrink: 0;
    width: 1.3rem;
    text-align: center;
    font-size: 1rem;
    line-height: 1;
    color: rgba(255, 255, 255, 0.5);
}

.browser-row.directory .browser-row-icon {
    color: #ffd700;
}

.browser-row-name {
    font-size: 0.9rem;
    word-break: break-all;
    color: rgba(255, 255, 255, 0.92);
}

.browser-row-side {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.browser-row-size {
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.45);
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.browser-row-type {
    font-size: 0.72rem;
    color: rgba(79, 172, 254, 0.85);
    white-space: nowrap;
}

.browser-list--bulk .browser-row {
    gap: 8px;
}

.browser-row-bulk-chk {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    cursor: pointer;
}

.browser-row-bulk-chk input {
    width: 16px;
    height: 16px;
    accent-color: #4facfe;
}

.browser-row-thumb {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.28);
}

.browser-row-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.browser-upload-input-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.browser-actions-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 8px 4px 6px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.browser-bulk-bar {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.browser-action-btn {
    padding: 5px 10px;
    border-radius: 8px;
    font-size: 0.76rem;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.88);
    transition: background 0.15s, border-color 0.15s;
}

.browser-action-btn:hover {
    background: rgba(79, 172, 254, 0.15);
    border-color: rgba(79, 172, 254, 0.35);
}

.browser-action-btn--small {
    padding: 4px 8px;
    font-size: 0.72rem;
}

.browser-action-btn--danger {
    border-color: rgba(248, 113, 113, 0.45);
    color: #fecaca;
}

.browser-action-btn--danger:hover {
    background: rgba(248, 113, 113, 0.18);
}

.browser-move-picker-dialog {
    max-width: 520px;
    width: calc(100vw - 32px);
}

.browser-move-picker-path {
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.5);
    word-break: break-all;
    margin: 8px 0;
    max-height: 4.5em;
    overflow: auto;
}

.browser-move-picker-list {
    max-height: 280px;
    overflow: auto;
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 10px 0 14px;
}

.browser-move-picker-row {
    text-align: left;
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.2);
    color: rgba(255, 255, 255, 0.9);
    cursor: pointer;
    font-size: 0.82rem;
}

.browser-move-picker-row:hover {
    border-color: rgba(79, 172, 254, 0.4);
    background: rgba(79, 172, 254, 0.1);
}

.browser-move-picker-empty {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.45);
    margin: 6px 0;
}

.browser-move-picker-tree-wrap {
    max-height: 280px;
    overflow: auto;
    margin: 10px 0 14px;
    padding: 6px 8px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(0, 0, 0, 0.18);
}

.browser-move-picker-tree {
    list-style: none;
    margin: 0;
    padding: 0;
}

.browser-tree-children {
    list-style: none;
    margin: 0 0 0 1.1rem;
    padding: 4px 0 0 0;
}

.browser-tree-item {
    margin: 2px 0;
}

.browser-tree-row {
    display: flex;
    align-items: center;
    gap: 6px;
}

.browser-tree-exp,
.browser-tree-select {
    padding: 4px 8px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.8rem;
    cursor: pointer;
}

.browser-tree-exp {
    flex: 0 0 auto;
    min-width: 2rem;
    text-align: center;
    font-size: 0.7rem;
}

.browser-tree-select {
    flex: 1 1 auto;
    text-align: left;
}

.browser-tree-select.is-target {
    border-color: rgba(79, 172, 254, 0.55);
    background: rgba(79, 172, 254, 0.12);
}

.browser-tree-exp-spacer {
    display: inline-block;
    min-width: 2rem;
}

.browser-tree-empty-hint {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.4);
    padding: 2px 0 2px 1.5rem;
}

.browser-conflict-wrap {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.74rem;
    color: rgba(255, 255, 255, 0.75);
}

.browser-conflict-label {
    white-space: nowrap;
}

.browser-on-conflict-select {
    min-width: 0;
    max-width: 10rem;
    padding: 6px 8px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(12, 18, 32, 0.92);
    color: #e8eef8;
    font-size: 0.82rem;
    outline: none;
    cursor: pointer;
    color-scheme: dark;
    -webkit-appearance: none;
    appearance: none;
}

.browser-on-conflict-select:focus {
    border-color: #4facfe;
}

.browser-on-conflict-select option {
    background: #1a1a2e;
    color: #f0f4fa;
}

.browser-upload-panel {
    flex-shrink: 0;
    padding: 8px 10px 6px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(0, 0, 0, 0.18);
}

.browser-upload-progress-block {
    margin-bottom: 8px;
}

.browser-upload-progress-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 4px;
}

.browser-upload-progress-title {
    font-size: 0.78rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.88);
}

.browser-upload-progress-meta {
    font-size: 0.72rem;
    color: rgba(147, 197, 253, 0.95);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.browser-upload-progress-name {
    font-size: 0.74rem;
    color: rgba(255, 255, 255, 0.65);
    margin-bottom: 6px;
    word-break: break-all;
    line-height: 1.35;
}

.browser-upload-bar-wrap {
    height: 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    overflow: hidden;
}

.browser-upload-bar {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(56, 189, 248, 0.85), rgba(79, 172, 254, 0.95));
    transition: width 0.12s ease-out;
    max-width: 100%;
}

.browser-upload-progress-hint {
    margin-top: 5px;
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.45);
    font-variant-numeric: tabular-nums;
}

.browser-upload-history-block {
    margin-top: 4px;
}

.browser-upload-history-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 6px;
}

.browser-upload-history-title {
    font-size: 0.76rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.82);
}

.browser-upload-history-list {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 9.5rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.browser-upload-history-list li {
    font-size: 0.7rem;
    line-height: 1.35;
    padding: 5px 8px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    word-break: break-word;
}

.browser-upload-history-list li.is-ok {
    border-color: rgba(34, 197, 94, 0.25);
}

.browser-upload-history-list li.is-fail {
    border-color: rgba(248, 113, 113, 0.35);
    color: #fecaca;
}

.browser-upload-history-time {
    display: block;
    font-size: 0.65rem;
    color: rgba(255, 255, 255, 0.4);
    margin-bottom: 2px;
}

.browser-upload-history-name {
    font-weight: 600;
    color: rgba(255, 255, 255, 0.88);
}

.browser-upload-history-detail {
    color: rgba(255, 255, 255, 0.55);
    margin-top: 2px;
}

.browser-upload-queue {
    font-size: 0.72rem;
    color: rgba(147, 197, 253, 0.95);
    max-width: 14rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.browser-upload-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.browser-upload-toolbar-title {
    font-size: 0.78rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.88);
}

.browser-upload-toolbar-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    justify-content: flex-end;
}

.browser-upload-queue-list {
    list-style: none;
    margin: 0 0 8px;
    padding: 0;
    max-height: 14rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.browser-upload-queue-item {
    padding: 6px 8px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.browser-upload-queue-item.is-uploading {
    border-color: rgba(56, 189, 248, 0.35);
}

.browser-upload-queue-item.is-paused {
    border-color: rgba(251, 191, 36, 0.35);
}

.browser-upload-queue-item.is-success {
    border-color: rgba(34, 197, 94, 0.25);
}

.browser-upload-queue-item.is-error {
    border-color: rgba(248, 113, 113, 0.35);
}

.browser-upload-queue-item-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 4px;
}

.browser-upload-queue-item-name {
    font-size: 0.72rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    word-break: break-all;
    line-height: 1.35;
    flex: 1;
    min-width: 0;
}

.browser-upload-queue-item-status {
    font-size: 0.68rem;
    color: rgba(147, 197, 253, 0.95);
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.browser-upload-queue-item-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 4px;
}

.browser-upload-queue-item-actions .browser-action-btn--small {
    padding: 2px 8px;
    font-size: 0.66rem;
}

.browser-upload-queue-item-detail {
    font-size: 0.66rem;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 3px;
    word-break: break-word;
}

.browser-upload-queue-item .browser-upload-bar-wrap {
    margin-top: 4px;
}

/* ---------- 上传/下载传输管理面板（独立浮层） ---------- */
.browser.browser--drop-hover {
    outline: 2px dashed rgba(79, 172, 254, 0.55);
    outline-offset: -2px;
}

.browser-transfer-overlay {
    position: fixed;
    inset: 0;
    z-index: 12050;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(6, 10, 20, 0.62);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.browser-transfer-panel {
    width: min(920px, 100%);
    max-height: min(82vh, 720px);
    display: flex;
    flex-direction: column;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(18, 24, 40, 0.94);
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.45);
    overflow: hidden;
}

.browser-transfer-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.browser-transfer-settings {
    display: flex;
    align-items: center;
    margin-left: auto;
    margin-right: 4px;
}

.browser-transfer-concurrency-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.68);
    white-space: nowrap;
}

.browser-transfer-concurrency-select {
    min-width: 3rem;
    padding: 2px 6px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(0, 0, 0, 0.25);
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.78rem;
}

.browser-transfer-main--drop-hover {
    outline: 2px dashed rgba(79, 172, 254, 0.55);
    outline-offset: -4px;
    background: rgba(79, 172, 254, 0.06);
}

.browser-transfer-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.92);
}

.browser-transfer-close {
    border: none;
    background: transparent;
    color: rgba(255, 255, 255, 0.65);
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 8px;
}

.browser-transfer-close:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.browser-transfer-layout {
    display: flex;
    min-height: 0;
    flex: 1 1 auto;
}

.browser-transfer-layout--upload-only .browser-transfer-main {
    flex: 1 1 auto;
    min-width: 0;
}

.browser-transfer-nav {
    flex: 0 0 108px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 10px 8px;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(0, 0, 0, 0.14);
}

.browser-transfer-nav-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 10px 6px;
    border: 1px solid transparent;
    border-radius: 10px;
    background: transparent;
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.74rem;
    cursor: pointer;
    position: relative;
}

.browser-transfer-nav-btn.is-active {
    background: rgba(79, 172, 254, 0.16);
    border-color: rgba(79, 172, 254, 0.35);
    color: #e8f4ff;
}

.browser-transfer-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    min-width: 1.1rem;
    padding: 0 4px;
    border-radius: 999px;
    background: #3b82f6;
    color: #fff;
    font-size: 0.62rem;
    font-weight: 700;
    line-height: 1.3;
}

.browser-transfer-main {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    padding: 10px 12px 12px;
}

.browser-transfer-batch {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.browser-transfer-batch-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: rgba(96, 165, 250, 0.95);
    font-size: 0.76rem;
    font-weight: 600;
    cursor: pointer;
    pointer-events: auto;
    position: relative;
    z-index: 1;
}

.browser-transfer-batch-btn:hover {
    background: rgba(79, 172, 254, 0.12);
}

.browser-transfer-batch-btn.is-disabled,
.browser-transfer-batch-btn:disabled {
    opacity: 0.38;
    cursor: not-allowed;
    pointer-events: none;
}

/* 工具栏「传输」：与 .browser-action-btn 同排同高，仅加小图标与角标 */
.browser-transfer-entry-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.browser-transfer-entry-icon {
    font-size: 0.72rem;
    line-height: 1;
    opacity: 0.88;
}

.browser-transfer-entry-btn.has-active .browser-transfer-entry-icon {
    animation: browser-transfer-sync-spin 2.5s linear infinite;
}

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

.browser-transfer-toolbar-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    z-index: 2;
    min-width: 0.9rem;
    height: 0.9rem;
    padding: 0 3px;
    border-radius: 999px;
    background: #ef4444;
    color: #fff;
    font-size: 0.56rem;
    font-weight: 700;
    line-height: 0.9rem;
    text-align: center;
    pointer-events: none;
}

.browser-transfer-chk-all {
    width: 15px;
    height: 15px;
    margin: 0;
    cursor: pointer;
    accent-color: #3b82f6;
}

.browser-transfer-batch-sep {
    width: 1px;
    height: 1rem;
    background: rgba(255, 255, 255, 0.12);
    margin: 0 2px;
}

.browser-transfer-tabs {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 10px 0 8px;
    flex-wrap: wrap;
}

.browser-transfer-tab {
    border: none;
    background: transparent;
    padding: 0 0 6px;
    font-size: 0.82rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.55);
    cursor: pointer;
    border-bottom: 2px solid transparent;
}

.browser-transfer-tab.is-active {
    color: rgba(255, 255, 255, 0.95);
    border-bottom-color: #3b82f6;
}

.browser-transfer-summary {
    margin-left: auto;
    font-size: 0.72rem;
    color: rgba(147, 197, 253, 0.9);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.browser-transfer-table-head {
    display: grid;
    grid-template-columns: 28px 1fr minmax(5.5rem, 0.35fr) minmax(6.5rem, 0.42fr);
    gap: 8px;
    padding: 4px 6px 6px;
    font-size: 0.68rem;
    color: rgba(255, 255, 255, 0.45);
}

.browser-transfer-breadcrumb {
    flex: 0 0 auto;
    padding: 6px 8px 4px;
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.62);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.browser-transfer-breadcrumb-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 2px 4px;
}

.browser-transfer-bc-link {
    border: none;
    background: transparent;
    color: rgba(96, 165, 250, 0.95);
    padding: 2px 4px;
    border-radius: 4px;
    cursor: pointer;
    font-size: inherit;
}

.browser-transfer-bc-link:hover {
    background: rgba(79, 172, 254, 0.12);
    text-decoration: underline;
}

.browser-transfer-bc-sep {
    color: rgba(255, 255, 255, 0.35);
    user-select: none;
}

.browser-transfer-bc-current {
    color: rgba(255, 255, 255, 0.88);
    font-weight: 600;
}

.browser-transfer-task--folder {
    background: rgba(251, 191, 36, 0.04);
}

.browser-transfer-task--folder .browser-transfer-file-icon {
    color: #fbbf24;
}

.browser-transfer-folder-open {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    flex: 1;
    border: none;
    background: transparent;
    padding: 0;
    cursor: pointer;
    text-align: left;
    color: inherit;
}

.browser-transfer-folder-open:hover .browser-transfer-file-name {
    color: #7dd3fc;
    text-decoration: underline;
}

.browser-transfer-task-list {
    list-style: none;
    margin: 0;
    padding: 0;
    overflow-y: auto;
    flex: 1 1 auto;
    min-height: 120px;
    max-height: calc(82vh - 220px);
}

.browser-transfer-col--chk {
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: auto;
    position: relative;
    z-index: 2;
}

.browser-transfer-chk {
    width: 15px;
    height: 15px;
    margin: 0;
    cursor: pointer;
    pointer-events: auto;
    accent-color: #3b82f6;
}

.browser-transfer-download-hint {
    flex: 1 1 100%;
    margin-top: 4px;
    font-size: 0.68rem;
    color: rgba(255, 255, 255, 0.45);
    line-height: 1.35;
}

.browser-transfer-task {
    display: grid;
    grid-template-columns: 28px 1fr minmax(5.5rem, 0.35fr) minmax(6.5rem, 0.42fr);
    gap: 8px;
    align-items: center;
    padding: 8px 6px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.74rem;
}

.browser-transfer-task.is-uploading,
.browser-transfer-task.is-downloading {
    background: rgba(59, 130, 246, 0.06);
}

.browser-transfer-task.is-paused {
    background: rgba(251, 191, 36, 0.05);
}

.browser-transfer-col--file {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.browser-transfer-file-icon {
    flex: 0 0 auto;
    color: #94a3b8;
    font-size: 0.9rem;
}

.browser-transfer-file-icon--file-image,
.browser-transfer-file-icon.fa-file-image {
    color: #4ade80;
}

.browser-transfer-file-icon--file-video,
.browser-transfer-file-icon.fa-file-video {
    color: #60a5fa;
}

.browser-transfer-file-icon--file-audio,
.browser-transfer-file-icon.fa-file-audio {
    color: #c084fc;
}

.browser-transfer-file-icon--file-pdf,
.browser-transfer-file-icon.fa-file-pdf {
    color: #f87171;
}

.browser-transfer-file-icon--file-archive,
.browser-transfer-file-icon.fa-file-archive {
    color: #fbbf24;
}

.browser-transfer-file-icon--file-code,
.browser-transfer-file-icon.fa-file-code {
    color: #38bdf8;
}

.browser-transfer-file-icon--file-alt,
.browser-transfer-file-icon.fa-file-alt {
    color: #a3e635;
}

.browser-transfer-file-icon--compact-disc,
.browser-transfer-file-icon.fa-compact-disc {
    color: #e879f9;
}

.browser-transfer-file-link {
    border: none;
    background: transparent;
    padding: 0;
    margin: 0;
    font: inherit;
    font-weight: 600;
    color: rgba(125, 211, 252, 0.95);
    cursor: pointer;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
    text-align: left;
}

.browser-transfer-file-link:hover {
    text-decoration: underline;
    color: #bae6fd;
}

.browser-transfer-file-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 600;
    min-width: 0;
}

.browser-transfer-inline-actions {
    display: inline-flex;
    gap: 2px;
    flex: 0 0 auto;
}

.browser-transfer-icon-btn {
    border: none;
    background: transparent;
    color: rgba(96, 165, 250, 0.95);
    padding: 2px 5px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.78rem;
    pointer-events: auto;
    position: relative;
    z-index: 1;
}

.browser-transfer-icon-btn:hover {
    background: rgba(79, 172, 254, 0.15);
}

.browser-transfer-col--size {
    color: rgba(255, 255, 255, 0.55);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.browser-transfer-task.is-done-row .browser-transfer-bar-wrap {
    display: none !important;
}

.browser-transfer-task.is-done-row .browser-transfer-col--status {
    color: rgba(255, 255, 255, 0.72);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.browser-transfer-table-head.is-done-tab .browser-transfer-col--status {
    color: rgba(255, 255, 255, 0.45);
}

.browser-transfer-col--status {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.browser-transfer-status-text {
    color: rgba(147, 197, 253, 0.95);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.browser-transfer-bar-wrap {
    height: 6px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    overflow: hidden;
}

.browser-transfer-bar {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(56, 189, 248, 0.85), rgba(79, 172, 254, 0.95));
    transition: width 0.12s ease-out;
    max-width: 100%;
}

.browser-transfer-task-detail {
    grid-column: 2 / -1;
    font-size: 0.66rem;
    color: rgba(255, 255, 255, 0.45);
    padding: 0 6px 4px 22px;
}

.browser-transfer-empty {
    margin: 24px 0;
    text-align: center;
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.8rem;
}

body.browser-transfer-open {
    overflow: hidden;
}

.browser-row:focus-visible {
    outline: 2px solid rgba(79, 172, 254, 0.75);
    outline-offset: 2px;
}

.browser-health-pre {
    white-space: pre-wrap;
    word-break: break-word;
    font-size: 0.78rem;
    line-height: 1.45;
    max-height: 50vh;
    overflow: auto;
    margin: 10px 0 14px;
    padding: 10px;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.25);
    color: rgba(255, 255, 255, 0.88);
}

.browser-enter-btn {
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid rgba(79, 172, 254, 0.45);
    background: transparent;
    color: #4facfe;
    transition: background 0.15s, color 0.15s;
}

.browser-enter-btn:hover {
    background: rgba(79, 172, 254, 0.18);
    color: #fff;
}

.browser-preview-btn {
    padding: 6px 12px;
    margin-right: 6px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid rgba(34, 197, 94, 0.45);
    background: transparent;
    color: #86efac;
    transition: background 0.15s, color 0.15s;
}

.browser-preview-btn:hover {
    background: rgba(34, 197, 94, 0.18);
    color: #fff;
}

.browser-preview-overlay {
    align-items: flex-start;
    justify-content: center;
    padding-top: min(5vh, 36px);
    padding-bottom: 24px;
    overflow-y: auto;
}

.browser-preview-dialog {
    max-width: min(98vw, 1320px);
    width: min(98vw, 1320px);
    max-height: min(92vh, 960px);
    min-width: min(96vw, 360px);
    min-height: min(48vh, 320px);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    resize: both;
    overflow: auto;
}

.browser-preview-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 6px;
    cursor: grab;
    user-select: none;
}

.browser-preview-head:active {
    cursor: grabbing;
}

.browser-preview-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 650;
    color: #e8f4ff;
    word-break: break-all;
}

.browser-preview-close {
    flex-shrink: 0;
    border: none;
    background: transparent;
    color: rgba(255, 255, 255, 0.65);
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    padding: 0 4px;
}

.browser-preview-close:hover {
    color: #fff;
}

.browser-preview-hint {
    margin: 0 0 10px;
    font-size: 11px;
    line-height: 1.45;
    color: rgba(200, 215, 240, 0.78);
}

.browser-preview-body {
    flex: 1;
    min-height: min(55vh, 520px);
    overflow: auto;
    text-align: center;
}

.browser-preview-img {
    max-width: 100%;
    max-height: min(72vh, 720px);
    width: auto;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
}

.browser-preview-video,
.browser-preview-audio {
    width: 100%;
    max-height: min(75vh, 800px);
    border-radius: 8px;
    background: #000;
}

.browser-preview-audio {
    max-height: 120px;
    margin-top: 24px;
}

.browser-preview-text {
    margin: 0;
    text-align: left;
    max-height: min(68vh, 640px);
    overflow: auto;
    padding: 12px;
    font-size: 12px;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
    font-family: ui-monospace, Consolas, "Cascadia Mono", monospace;
    background: rgba(0, 0, 0, 0.45);
    border-radius: 8px;
    color: rgba(225, 235, 255, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.browser-preview-iframe {
    width: 100%;
    min-height: min(78vh, 820px);
    border: 0;
    border-radius: 8px;
    background: #fff;
}

.browser-preview-loading {
    padding: 24px;
    color: rgba(200, 215, 240, 0.85);
    font-size: 13px;
}

body.mtool-mobile .browser-preview-dialog,
body.mtool-mobile .modal-bbcode-dialog.browser-preview-dialog {
    resize: none;
    max-width: calc(100vw - 16px);
    width: calc(100vw - 16px);
    min-width: 0;
}

body.mtool-mobile .browser-preview-head {
    cursor: default;
}

.browse-hint-details {
    margin-top: 10px;
}

.browse-hint-summary {
    list-style: none;
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
    color: rgba(79, 172, 254, 0.85);
    border-radius: 8px;
    padding: 4px 6px;
    margin: -4px -6px;
    outline-offset: 2px;
}

.browse-hint-summary::-webkit-details-marker {
    display: none;
}

.browse-hint-summary-icon {
    font-size: 1.1rem;
    line-height: 1;
}

.browse-hint-summary-icon i {
    color: rgba(79, 172, 254, 0.85);
}

.browse-hint-summary-sr {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.browse-hint-body {
    margin-top: 8px;
    padding-left: 2px;
    font-size: 12px;
    line-height: 1.55;
    color: rgba(255, 255, 255, 0.45);
}

@media (max-width: 640px) {
    .browser-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .browser-row-side {
        width: 100%;
        justify-content: space-between;
    }
}

/* 左侧配置面板 */
.config-panel {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* 右侧目标显示面板 */
.target-panel {
    flex: 1;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    padding: 20px;
    display: flex;
    flex-direction: column;
}

.target-display {
    flex: 1;
    display: flex;
    align-items: stretch;
}

.target-display input,
.target-display textarea.selected-target-field {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    background: #f9f9f9;
    resize: vertical;
    min-height: 44px;
    box-sizing: border-box;
    font-family: inherit;
    line-height: 1.4;
}

/* 底部日志区域 */
.log-section {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    padding: 20px;
    display: flex;
    flex-direction: column;
    min-height: 300px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.panel-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.panel-header i {
    font-size: 20px;
    color: #4facfe;
}

.panel-header h2 {
    font-size: 18px;
    font-weight: 600;
    flex: 1;
    color: #fff;
}

/* 配置区域 */
.config-section {
    margin-bottom: 25px;
}

.section-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.section-label--sub {
    margin-top: 16px;
    margin-bottom: 8px;
    text-transform: none;
    letter-spacing: 0.3px;
}

.hint-text {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 8px;
}

.info-hint {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
    margin-top: 15px;
    padding: 10px;
    background: rgba(79, 172, 254, 0.1);
    border-radius: 8px;
    border-left: 3px solid #4facfe;
}

.info-hint i {
    margin-right: 5px;
}

/* 路径输入 */
.path-input-group {
    display: flex;
    gap: 10px;
}

.path-input-group input {
    flex: 1;
    padding: 12px 15px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #fff;
    font-size: 14px;
}

.path-input-group input:focus {
    outline: none;
    border-color: #4facfe;
}

.btn-browse {
    padding: 12px 18px;
    background: rgba(79, 172, 254, 0.2);
    border: 1px solid rgba(79, 172, 254, 0.3);
    border-radius: 8px;
    color: #4facfe;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-browse:hover {
    background: rgba(79, 172, 254, 0.3);
}

/* 媒体选择器容器 */
.media-selector-container {
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.2);
}

/* 路径显示栏 */
.path-bar {
    background: rgba(0, 0, 0, 0.2);
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 12px;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.path-text {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.9);
    font-family: 'Courier New', monospace;
    word-break: break-all;
}

/* 操作栏 */
.action-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.icon-btn {
    width: 36px;
    height: 36px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.icon-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
}

.icon-btn i {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.8);
}

.search-box {
    flex: 1;
    margin-left: 8px;
}

.search-box input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
    background: rgba(0, 0, 0, 0.2);
    color: #fff;
}

.search-box input:focus {
    border-color: #4facfe;
}

.search-box input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

/* 文件列表滚动区域 */
.file-list-scroll {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.2);
}

/* 文件项样式 */
.file-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    cursor: pointer;
    transition: background-color 0.2s;
}

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

.file-item:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.file-item.selected {
    background-color: rgba(79, 172, 254, 0.2);
}

.file-icon {
    font-size: 20px;
    margin-right: 12px;
    width: 24px;
    text-align: center;
    flex-shrink: 0;
}

.file-name {
    flex: 1;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.9);
    word-break: break-all;
    margin-right: 12px;
}

.file-size {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.5);
    white-space: nowrap;
    flex-shrink: 0;
}

.browser-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 200px;
    color: rgba(255, 255, 255, 0.5);
}

.browser-placeholder i {
    font-size: 48px;
    margin-bottom: 15px;
}

.browser-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 5px;
}

.browser-item:hover {
    background: rgba(79, 172, 254, 0.1);
}

.browser-item.selected {
    background: rgba(79, 172, 254, 0.2);
    border: 1px solid rgba(79, 172, 254, 0.4);
}

.browser-item i {
    font-size: 18px;
    width: 20px;
    text-align: center;
}

.browser-item.folder i { color: #ffd700; }
.browser-item.video i { color: #4caf50; }
.browser-item.iso i { color: #ff9800; }
.browser-item.bdmv i { color: #e91e63; }
.browser-item.file i { color: rgba(255, 255, 255, 0.5); }

.browser-item .item-name {
    flex: 1;
    font-size: 14px;
    word-break: break-all;
}

.browser-item .item-size {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
    white-space: nowrap;
}

.btn-clear {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    padding: 5px;
    transition: color 0.3s ease;
}

.btn-clear:hover {
    color: #f44336;
}

/* 复选框选项 */
.checkbox-group {
    margin-bottom: 15px;
}

.checkbox-option {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 12px 15px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    transition: all 0.3s ease;
}

.checkbox-option:hover {
    background: rgba(79, 172, 254, 0.1);
}

.checkbox-option input {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #4facfe;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.9);
}

.checkbox-label i {
    color: #4facfe;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 10px 15px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    transition: all 0.3s ease;
}

.checkbox-item:hover {
    background: rgba(79, 172, 254, 0.1);
}

.checkbox-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #4facfe;
}

/* 选中路径显示 */
.selected-path-display {
    background: rgba(79, 172, 254, 0.1);
    border: 1px solid rgba(79, 172, 254, 0.3);
    border-radius: 8px;
    padding: 12px 15px;
}

.selected-path-display .path-label {
    color: rgba(255, 255, 255, 0.7);
    font-size: 13px;
    display: block;
    margin-bottom: 5px;
}

.selected-path-display .path-label i {
    margin-right: 5px;
    color: #4facfe;
}

.selected-path-display .path-value {
    color: #4facfe;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    word-break: break-all;
    white-space: pre-wrap;
}

#selectedTypeDisplay .path-value {
    white-space: normal;
}

/* 结果操作按钮 */
.result-actions {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    padding: 15px;
}

.action-group {
    margin-bottom: 10px;
}

.action-group:last-child {
    margin-bottom: 0;
}

.section-label {
    display: block;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 8px;
}

.section-label i {
    margin-right: 5px;
    color: #4facfe;
}

.copy-input-group {
    display: flex;
    gap: 10px;
}

.copy-input-group input {
    flex: 1;
    padding: 10px 12px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: #fff;
    font-size: 13px;
    font-family: 'Courier New', monospace;
}

.copy-input-group input:focus {
    outline: none;
    border-color: #4facfe;
}

.btn-copy {
    padding: 10px 15px;
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    border: none;
    border-radius: 6px;
    color: #fff;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.btn-copy:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(79, 172, 254, 0.4);
}

.btn-action {
    padding: 12px 20px;
    background: rgba(79, 172, 254, 0.2);
    border: 1px solid rgba(79, 172, 254, 0.3);
    border-radius: 8px;
    color: #4facfe;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-action:hover {
    background: rgba(79, 172, 254, 0.3);
    border-color: rgba(79, 172, 254, 0.5);
}

/* 截图参数 */
.screenshot-options {
    margin-top: 15px;
    padding: 15px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    border-left: 3px solid #4facfe;
}

/* 参数行 */
.param-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.param-row:last-child {
    margin-bottom: 0;
}

.param-row label {
    font-size: 14px;
    color: #aaa;
}

.param-row input,
.param-row select {
    width: 120px;
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: #fff;
    font-size: 14px;
}

.param-row input:focus,
.param-row select:focus {
    outline: none;
    border-color: #4facfe;
}

.param-row select option {
    background: #1a1a2e;
}

/* 执行按钮 */
.btn-execute {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    border: none;
    border-radius: 10px;
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn-execute:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(79, 172, 254, 0.4);
}

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

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

.execute-row {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 12px;
    align-items: stretch;
}

.execute-row .btn-execute {
    flex: 1 1 180px;
    min-width: 0;
    width: auto;
}

.btn-stop {
    flex: 0 0 auto;
    min-width: 120px;
    padding: 15px 18px;
    background: rgba(244, 67, 54, 0.15);
    border: 1px solid rgba(244, 67, 54, 0.45);
    border-radius: 10px;
    color: #ff8a80;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.btn-stop:hover:not(:disabled) {
    background: rgba(244, 67, 54, 0.28);
    border-color: rgba(244, 67, 54, 0.65);
}

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

.log-live-progress {
    opacity: 0.92;
}

/* 日志容器 */
.log-container {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    padding: 20px;
    min-height: 300px;
    max-height: 500px;
    overflow-y: auto;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 13px;
    line-height: 1.8;
}

.log-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 300px;
    color: rgba(255, 255, 255, 0.4);
}

.log-placeholder i {
    font-size: 48px;
    margin-bottom: 15px;
}

.log-line {
    padding: 3px 0;
    word-break: break-all;
}

.log-line.info { color: #4facfe; }
.log-line.success { color: #4caf50; }
.log-line.error { color: #f44336; }
.log-line.warning { color: #ff9800; }
.log-line.debug { color: rgba(255, 255, 255, 0.5); }

.log-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.btn-log-tool {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    font-size: 12px;
    border-radius: 8px;
    border: 1px solid rgba(79, 172, 254, 0.35);
    background: rgba(79, 172, 254, 0.12);
    color: #b8e1ff;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.btn-log-tool:hover {
    background: rgba(79, 172, 254, 0.22);
    border-color: rgba(79, 172, 254, 0.55);
}

.btn-clear-log {
    margin-left: auto;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.45);
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 8px;
    transition: color 0.2s ease, background 0.2s ease;
}

.btn-clear-log:hover {
    color: #f44336;
    background: rgba(244, 67, 54, 0.12);
}

.screenshot-gallery-section {
    margin-top: 28px;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.screenshot-gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
    margin-top: 8px;
}

.screenshot-disc-heading {
    grid-column: 1 / -1;
    margin: 14px 0 6px;
    font-size: 0.98rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.88);
    letter-spacing: 0.02em;
}

.screenshot-disc-heading:first-child {
    margin-top: 0;
}

@media (max-width: 900px) {
    .screenshot-gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 520px) {
    .screenshot-gallery-grid {
        grid-template-columns: 1fr;
    }
}

.screenshot-card {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.09) 0%, rgba(255, 255, 255, 0.03) 100%);
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
    display: flex;
    flex-direction: column;
}

.screenshot-card-thumb {
    background: rgba(0, 0, 0, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 140px;
    padding: 10px;
}

.screenshot-card-thumb img {
    max-width: 100%;
    max-height: 280px;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 8px;
    cursor: zoom-in;
}

/* 截图双击放大 */
.screenshot-lightbox {
    position: fixed;
    inset: 0;
    z-index: 10060;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.88);
    padding: 48px 16px 16px;
    box-sizing: border-box;
}

.screenshot-lightbox-img {
    max-width: min(96vw, 100%);
    max-height: 92vh;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 10px;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.55);
}

.screenshot-lightbox-close {
    position: absolute;
    top: 12px;
    right: 16px;
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.screenshot-lightbox-close:hover {
    background: rgba(255, 255, 255, 0.22);
}

/* 文件列表右键菜单 */
.browser-context-menu {
    position: fixed;
    z-index: 10050;
    min-width: 220px;
    max-width: min(96vw, 320px);
    padding: 6px 0 8px;
    margin: 0;
    overflow: visible;
    list-style: none;
    background: linear-gradient(180deg, rgba(40, 44, 58, 0.98) 0%, rgba(28, 30, 40, 0.98) 100%);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 10px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}

.browser-context-menu > .browser-context-menu-item,
.browser-context-menu > .browser-context-submenu-wrap {
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.browser-context-menu > *:first-child {
    border-top: none;
}

.browser-context-menu > .browser-context-bulk-sep {
    height: 0;
    margin: 0;
    padding: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* 列表空白处右键：仅显示「粘贴」（由 JS 加 .browser-context-menu--list-bg-mode） */
.browser-context-menu.browser-context-menu--list-bg-mode > *:not(.browser-context-paste-empty) {
    display: none !important;
}

.browser-context-menu.browser-context-menu--list-bg-mode > .browser-context-paste-empty {
    display: block !important;
    border-top: none;
}

.browser-context-menu-item {
    display: block;
    width: 100%;
    padding: 10px 16px;
    border: none;
    background: transparent;
    color: rgba(255, 255, 255, 0.92);
    font-size: 13px;
    text-align: left;
    cursor: pointer;
    transition: background 0.15s ease;
}

.browser-context-menu-item:hover,
.browser-context-menu-item:focus {
    background: rgba(110, 220, 180, 0.18);
    outline: none;
}

.browser-context-menu-item--danger {
    color: #fecaca;
}

.browser-context-menu-item--danger:hover,
.browser-context-menu-item--danger:focus {
    background: rgba(248, 113, 113, 0.2);
    color: #fff;
}

/* 二级菜单：父行 + 右侧展开 */
.browser-context-submenu-wrap {
    position: relative;
}

.browser-context-submenu-parent {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.browser-context-submenu-parent .browser-context-chevron {
    flex-shrink: 0;
    opacity: 0.7;
    font-size: 1.15rem;
    line-height: 1;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.55);
}

.browser-context-submenu-wrap.is-open .browser-context-submenu-parent,
.browser-context-submenu-wrap:hover .browser-context-submenu-parent {
    background: rgba(110, 220, 180, 0.1);
}

.browser-context-submenu {
    display: none;
    position: absolute;
    left: calc(100% - 6px);
    top: 0;
    z-index: 3;
    min-width: 118px;
    padding: 5px 0;
    margin: 0;
    list-style: none;
    background: linear-gradient(180deg, rgba(44, 48, 62, 0.99) 0%, rgba(30, 32, 44, 0.99) 100%);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 10px;
    box-shadow: 0 10px 32px rgba(0, 0, 0, 0.42);
}

@media (hover: hover) and (pointer: fine) {
    .browser-context-submenu-wrap:hover > .browser-context-submenu {
        display: block;
    }
}

.browser-context-submenu-wrap.is-open > .browser-context-submenu {
    display: block;
}

.browser-context-menu--flip-sub .browser-context-submenu {
    left: auto;
    right: calc(100% - 6px);
}

.browser-context-submenu-item {
    display: block;
    width: 100%;
    padding: 9px 16px;
    border: none;
    background: transparent;
    color: rgba(255, 255, 255, 0.9);
    font-size: 13px;
    text-align: left;
    cursor: pointer;
    transition: background 0.12s ease;
}

.browser-context-submenu-item:hover,
.browser-context-submenu-item:focus {
    background: rgba(79, 172, 254, 0.22);
    outline: none;
}

.browser-context-submenu-item + .browser-context-submenu-item {
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* 移动版：子菜单内嵌展开，避免横向飞出屏外 */
body.mtool-mobile .browser-context-submenu {
    position: static;
    left: auto;
    top: auto;
    min-width: auto;
    margin: 0 8px 6px 12px;
    padding: 4px 0 6px;
    border-radius: 0 8px 8px 8px;
    border-left: 3px solid rgba(79, 172, 254, 0.4);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

body.mtool-mobile .browser-context-submenu-wrap:hover > .browser-context-submenu {
    display: none !important;
}

body.mtool-mobile .browser-context-submenu-wrap.is-open > .browser-context-submenu {
    display: block !important;
}

.screenshot-card-meta {
    padding: 12px 14px 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.screenshot-card-title {
    font-size: 13px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.85);
    word-break: break-all;
}

.screenshot-card-url-row {
    font-size: 11px;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.55);
}

.screenshot-card-url {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.screenshot-card-no-url {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.45);
}

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

.btn-gallery-download {
    align-self: flex-start;
    padding: 8px 14px;
    font-size: 12px;
    border-radius: 8px;
    border: 1px solid rgba(110, 220, 180, 0.5);
    background: rgba(110, 220, 180, 0.12);
    color: #c8f5e8;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.btn-gallery-download:hover {
    background: rgba(110, 220, 180, 0.22);
    border-color: rgba(110, 220, 180, 0.65);
}

.btn-gallery-copy {
    align-self: flex-start;
    padding: 8px 14px;
    font-size: 12px;
    border-radius: 8px;
    border: 1px solid rgba(79, 172, 254, 0.45);
    background: rgba(79, 172, 254, 0.15);
    color: #b8e1ff;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: background 0.2s ease;
}

.btn-gallery-copy:hover {
    background: rgba(79, 172, 254, 0.28);
}

.png-compress-wrap .png-quality-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.png-quality-select {
    flex: 1;
    min-width: 200px;
    max-width: 100%;
}

.png-quality-custom-wrap .png-quality-custom-input {
    max-width: 100%;
    margin-top: 6px;
}

.png-quality-hint {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.45);
    margin: 8px 0 0;
    line-height: 1.5;
}

.png-quality-hint code {
    font-size: 11px;
    color: rgba(184, 225, 255, 0.95);
    background: rgba(0, 0, 0, 0.25);
    padding: 1px 6px;
    border-radius: 4px;
}

.log-entry {
    padding: 8px 12px;
    border-radius: 5px;
    margin-bottom: 8px;
    background: rgba(0, 0, 0, 0.2);
}

.log-entry.info { color: rgba(255, 255, 255, 0.7); }
.log-entry.success { color: #4caf50; }
.log-entry.error { color: #f44336; }
.log-entry.warning { color: #ff9800; }

/* 状态标签 */
.status-badge {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.status-idle { background: rgba(255, 255, 255, 0.1); color: rgba(255, 255, 255, 0.5); }
.status-running { background: rgba(79, 172, 254, 0.2); color: #4facfe; animation: pulse 2s infinite; }
.status-success { background: rgba(76, 175, 80, 0.2); color: #4caf50; }
.status-error { background: rgba(244, 67, 54, 0.2); color: #f44336; }

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

/* 结果文件 */
.result-files {
    margin-top: 20px;
}

.result-file-item {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    padding: 15px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.result-file-item:hover {
    background: rgba(79, 172, 254, 0.1);
    border-color: rgba(79, 172, 254, 0.3);
}

.result-file-item i {
    font-size: 32px;
    margin-bottom: 10px;
}

.result-file-item.image i { color: #4caf50; }
.result-file-item.text i { color: #4facfe; }
.result-file-item.archive i { color: #ff9800; }

.result-file-item .file-name {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
    word-break: break-all;
}

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

.modal.active {
    display: flex;
}

.modal-content {
    background: #1a1a2e;
    border-radius: 16px;
    max-width: 90%;
    max-height: 90%;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-header h3 {
    font-size: 18px;
}

.btn-close {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    font-size: 20px;
    cursor: pointer;
    transition: color 0.3s ease;
}

.btn-close:hover {
    color: #fff;
}

.modal-body {
    padding: 20px;
    max-height: 70vh;
    overflow-y: auto;
}

.modal-body img {
    max-width: 100%;
    border-radius: 8px;
}

.modal-body pre {
    background: rgba(0, 0, 0, 0.3);
    padding: 20px;
    border-radius: 8px;
    overflow-x: auto;
    font-size: 13px;
    line-height: 1.6;
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* 响应式 */
@media (max-width: 1024px) {
    .main-content {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .file-list {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }
}

/* 截图选项区域（勿用 #screenshotOptions * 统配，否则会盖住下拉框与浅色子区域文字） */
#screenshotOptions {
    background: rgba(0, 0, 0, 0.3) !important;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
}

#screenshotOptions .option-label,
#screenshotOptions .checkbox-item span {
    color: rgba(255, 255, 255, 0.92);
}

#screenshotOptions > .screenshot-option > span,
#gridOptions span {
    color: rgba(255, 255, 255, 0.85);
}

.screenshot-count-row .screenshot-count-inline {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 10px;
    margin-top: 4px;
}

.screenshot-count-input {
    width: 80px;
    min-width: 72px;
}

.screenshot-count-presets {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.screenshot-count-preset {
    min-width: 34px;
    padding: 5px 10px;
    border-radius: 8px;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid rgba(79, 172, 254, 0.45);
    background: rgba(0, 0, 0, 0.25);
    color: #7ec8ff;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.screenshot-count-preset:hover {
    background: rgba(79, 172, 254, 0.18);
    color: #fff;
    border-color: rgba(79, 172, 254, 0.65);
}

#screenshotOptions input[type="number"],
#screenshotOptions .screenshot-count-input {
    background: rgba(0, 0, 0, 0.4) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    color: #fff !important;
}

#screenshotOptions input[type="number"]:focus {
    border-color: #4facfe !important;
    outline: none;
}

#screenshotOptions input[type="checkbox"] {
    accent-color: #4facfe;
}

/* 超大图压缩子区：与截图选项区同一深色底；仅下拉框单独配色以保证可读 */
#screenshotOptions #pngCompressWrap .option-label,
#screenshotOptions #pngCompressWrap .checkbox-item span,
#screenshotOptions #pngCompressWrap .png-quality-hint {
    color: rgba(255, 255, 255, 0.92);
}

/* 截图区内全部下拉（字幕语言、压缩工具、画质预设）：深色底 + 浅色字，避免与半透明面板背景混在一起 */
#screenshotOptions select.form-control,
#screenshotOptions select.png-quality-select {
    background: rgba(15, 23, 42, 0.92) !important;
    color: #f1f5f9 !important;
    border: 1px solid rgba(255, 255, 255, 0.28) !important;
}

#screenshotOptions select.form-control:focus,
#screenshotOptions select.png-quality-select:focus {
    border-color: #4facfe !important;
    outline: none;
}

#screenshotOptions select.form-control option,
#screenshotOptions select.png-quality-select option {
    background: #1e293b;
    color: #f8fafc;
}

/* 自定义质量输入仍沿用全局 .form-control，与截图区内其它输入一致 */
#screenshotOptions #pngCompressWrap .png-quality-hint code {
    background: rgba(0, 0, 0, 0.35) !important;
    color: rgba(255, 255, 255, 0.95) !important;
    padding: 2px 6px;
    border-radius: 4px;
}

#gridOptions {
    background: rgba(0, 0, 0, 0.25) !important;
    padding: 10px;
    border-radius: 6px;
    margin-top: 10px;
}

#gridOptions .option-label,
#gridOptions span {
    color: rgba(255, 255, 255, 0.92);
}

/* 表单控件 */
.form-control {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    padding: 8px 12px;
    border-radius: 6px;
}

.form-control:focus {
    border-color: #4facfe;
    outline: none;
}

/* 媒体信息 BBCode 弹窗 */
.modal-bbcode-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.58);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-bbcode-overlay.is-open {
    display: flex;
}

.modal-bbcode-overlay--stack {
    z-index: 10080;
}

/** 文件预览须高于上传传输浮层（.browser-transfer-overlay 12050） */
.modal-bbcode-overlay.browser-preview-overlay {
    z-index: 12100;
}

.modal-bbcode-overlay--behind {
    pointer-events: none;
}

/* 通用提示 / 确认（替代 alert、confirm） */
.modal-mtool-prompt-overlay {
    z-index: 10070;
    background: rgba(6, 10, 22, 0.72);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.modal-mtool-prompt-dialog {
    max-width: 460px;
    width: 100%;
    padding: 20px 22px 18px;
    border-radius: 14px;
}

.modal-mtool-prompt-dialog--info {
    border-color: rgba(56, 189, 248, 0.38);
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.3) inset, 0 18px 48px rgba(0, 0, 0, 0.45);
}

.modal-mtool-prompt-dialog--warning {
    border-color: rgba(251, 191, 36, 0.45);
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.3) inset, 0 18px 48px rgba(0, 0, 0, 0.45);
}

.modal-mtool-prompt-dialog--danger {
    border-color: rgba(248, 113, 113, 0.42);
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.3) inset, 0 18px 48px rgba(0, 0, 0, 0.48), 0 0 60px rgba(220, 38, 38, 0.06);
}

.modal-mtool-prompt-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.modal-mtool-prompt-title {
    margin: 0;
    flex: 1;
    min-width: 0;
    font-size: 17px;
    font-weight: 650;
    color: #f0f9ff;
    line-height: 1.35;
}

.modal-mtool-prompt-close {
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    margin: -4px -4px 0 0;
    padding: 0;
    border: none;
    border-radius: 8px;
    font-size: 20px;
    line-height: 1;
    color: rgba(255, 255, 255, 0.72);
    background: rgba(255, 255, 255, 0.08);
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.modal-mtool-prompt-close:hover {
    color: #fff;
    background: rgba(56, 189, 248, 0.28);
}

.modal-mtool-prompt-body {
    font-size: 14px;
    line-height: 1.65;
    color: rgba(248, 250, 252, 0.9);
    min-height: 1em;
}

.modal-mtool-prompt-text {
    margin: 0;
    white-space: pre-wrap;
    word-break: break-word;
}

.modal-mtool-prompt-actions {
    margin-top: 18px;
    padding-top: 2px;
}

.mtool-mobile .modal-mtool-prompt-dialog {
    max-width: min(460px, calc(100vw - 24px));
    max-height: min(86vh, 520px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.modal-bbcode-dialog {
    background: linear-gradient(145deg, #1e2749 0%, #16213e 100%);
    border: 1px solid rgba(79, 172, 254, 0.28);
    border-radius: 12px;
    padding: 22px 24px;
    max-width: 520px;
    width: 100%;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
}

/* 文件预览弹窗同时带 modal-bbcode-dialog，须覆盖上面 max-width:520px，否则 kk/pdf 预览框过小 */
.modal-bbcode-dialog.browser-preview-dialog {
    max-width: min(98vw, 1320px);
    width: min(98vw, 1320px);
    max-height: min(92vh, 960px);
    min-width: min(96vw, 360px);
    min-height: min(48vh, 320px);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    resize: both;
    overflow: auto;
    box-sizing: border-box;
}

.modal-dialog-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}
.modal-dialog-head .modal-bbcode-title {
    margin-bottom: 0;
    flex: 1;
    min-width: 0;
}
.modal-dialog-close {
    flex-shrink: 0;
    border: none;
    background: transparent;
    color: rgba(255, 255, 255, 0.65);
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
    padding: 0 2px 0 8px;
}
.modal-dialog-close:hover {
    color: #fff;
}

.modal-bbcode-title {
    font-size: 18px;
    font-weight: 600;
    color: #e8f4ff;
    margin-bottom: 10px;
}

.modal-bbcode-hint {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.72);
    line-height: 1.55;
    margin-bottom: 16px;
}

.modal-bbcode-hint code {
    font-size: 12px;
    background: rgba(0, 0, 0, 0.35);
    padding: 2px 6px;
    border-radius: 4px;
    color: #9bdcff;
}

.modal-bbcode-kind-note {
    display: block;
    margin-top: 8px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.55);
}

.modal-bbcode-disc-scope {
    margin-bottom: 16px;
}

.modal-bbcode-disc-scope .modal-bbcode-label {
    display: block;
    margin-bottom: 4px;
}

.modal-bbcode-disc-select {
    width: 100%;
    box-sizing: border-box;
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(12, 18, 32, 0.92);
    color: #e8eef8;
    font-size: 14px;
}

.modal-bbcode-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

.modal-bbcode-row {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.92);
}

.modal-bbcode-row input[type="checkbox"] {
    accent-color: #4facfe;
    width: 16px;
    height: 16px;
}

.modal-bbcode-intro-hint {
    margin: -4px 0 0 26px;
    font-size: 12px;
    line-height: 1.45;
    color: rgba(147, 197, 253, 0.95);
}

.btn-modal-secondary--compact {
    margin: 0 0 8px 26px;
    padding: 4px 12px;
    font-size: 12px;
}

.modal-bbcode-hide-kind {
    margin-left: 26px;
    padding: 10px 12px;
    background: rgba(0, 0, 0, 0.28);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.modal-bbcode-label {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.55);
    margin-bottom: 2px;
}

.modal-bbcode-radio {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.88);
}

.modal-bbcode-radio input[type="radio"] {
    accent-color: #4facfe;
}

.modal-bbcode-radio code {
    font-size: 11px;
    background: rgba(0, 0, 0, 0.35);
    padding: 2px 5px;
    border-radius: 4px;
    color: #9bdcff;
}

.modal-bbcode-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
}

.btn-modal-primary {
    padding: 8px 18px;
    border-radius: 8px;
    border: 1px solid rgba(79, 172, 254, 0.55);
    background: rgba(79, 172, 254, 0.28);
    color: #e8f7ff;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.btn-modal-primary:hover {
    background: rgba(79, 172, 254, 0.42);
    border-color: rgba(79, 172, 254, 0.75);
}

.btn-modal-secondary {
    padding: 8px 18px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.85);
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s ease;
}

.btn-modal-secondary:hover {
    background: rgba(255, 255, 255, 0.12);
}

/* 文件浏览器：删除确认（自定义弹窗，非系统 confirm） */
.modal-delete-confirm-overlay {
    z-index: 10060;
    background: rgba(6, 10, 22, 0.78);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.modal-delete-confirm-dialog {
    max-width: 480px;
    width: 100%;
    max-height: min(88vh, 640px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: 14px;
    border: 1px solid rgba(248, 113, 113, 0.35);
    background: linear-gradient(155deg, #2a1520 0%, #1a1428 42%, #12182e 100%);
    box-shadow:
        0 0 0 1px rgba(0, 0, 0, 0.35) inset,
        0 20px 50px rgba(0, 0, 0, 0.55),
        0 0 80px rgba(220, 38, 38, 0.08);
}

.modal-delete-confirm-head {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 14px;
    flex-shrink: 0;
}

.modal-delete-confirm-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: #fecaca;
    background: rgba(220, 38, 38, 0.22);
    border: 1px solid rgba(248, 113, 113, 0.35);
}

.modal-delete-confirm-title {
    margin: 4px 0 0;
    font-size: 18px;
    font-weight: 650;
    color: #fff5f5;
    letter-spacing: 0.02em;
    line-height: 1.35;
}

.modal-delete-confirm-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    font-size: 14px;
    line-height: 1.65;
    color: rgba(255, 247, 247, 0.88);
}

.modal-delete-lead {
    margin: 0 0 10px;
    color: rgba(255, 250, 250, 0.95);
}

.modal-delete-lead strong {
    color: #fecdd3;
    font-weight: 650;
}

.modal-delete-target-name {
    margin: 0 0 14px;
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    word-break: break-all;
    color: #e0f2fe;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(56, 189, 248, 0.22);
}

.modal-delete-muted {
    margin: 0 0 10px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.62);
}

.modal-delete-muted strong {
    color: #fde68a;
    font-weight: 600;
}

.modal-delete-stats {
    list-style: none;
    margin: 0 0 14px;
    padding: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.modal-delete-stats li {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 6px 8px;
    padding: 12px 14px;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.28);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

/* 批量删除：路径列表（可滚动正文内展示，勿用 modal-delete-stats 网格） */
.modal-delete-path-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.modal-delete-path-list li {
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.45;
    word-break: break-all;
    color: rgba(255, 247, 247, 0.9);
    background: rgba(0, 0, 0, 0.28);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.modal-delete-path-list li + li {
    margin-top: 6px;
}

.modal-delete-stat-k {
    flex: 1 0 100%;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.55);
    text-transform: none;
    letter-spacing: 0.04em;
}

.modal-delete-stat-v {
    font-size: 22px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: #7dd3fc;
    line-height: 1;
}

.modal-delete-stat-u {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.5);
}

.modal-delete-confirm-risk {
    margin: 14px 0 0;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.5;
    color: #fecaca;
    background: rgba(127, 29, 29, 0.35);
    border: 1px solid rgba(248, 113, 113, 0.28);
    flex-shrink: 0;
}

.modal-delete-confirm-actions {
    margin-top: 22px;
    padding-top: 4px;
    flex-shrink: 0;
}

.btn-modal-danger {
    border-color: rgba(248, 113, 113, 0.65) !important;
    background: linear-gradient(180deg, rgba(220, 38, 38, 0.55) 0%, rgba(185, 28, 28, 0.45) 100%) !important;
    color: #fff !important;
}

.btn-modal-danger:hover {
    border-color: rgba(252, 165, 165, 0.85) !important;
    background: linear-gradient(180deg, rgba(239, 68, 68, 0.65) 0%, rgba(220, 38, 38, 0.55) 100%) !important;
}

.mtool-mobile .modal-delete-confirm-dialog {
    max-width: min(480px, calc(100vw - 24px));
    max-height: min(88vh, 640px);
}

@media (max-width: 520px) {
    .modal-delete-stats {
        grid-template-columns: 1fr;
    }
}

/* mktorrent 制作种子弹窗：限制高度 + 可滚动，避免小屏裁切 */
.modal-torrent-overlay.modal-bbcode-overlay {
    background: rgba(6, 10, 22, 0.72);
    backdrop-filter: blur(6px);
    align-items: flex-start;
    justify-content: center;
    padding: 12px 12px 24px;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
}

.modal-bbcode-dialog.modal-torrent-dialog {
    max-width: 520px;
    width: min(520px, calc(100vw - 24px));
    max-height: calc(100vh - 28px);
    max-height: calc(100dvh - 28px);
    padding: 0;
    border-radius: 14px;
    border: 1px solid rgba(120, 190, 255, 0.22);
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.04) inset,
        0 24px 56px rgba(0, 0, 0, 0.55);
    background: linear-gradient(165deg, #1a2342 0%, #121a30 48%, #0f1628 100%);
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    flex-shrink: 0;
}

.modal-torrent-head {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 16px 20px 12px;
    background: linear-gradient(180deg, rgba(79, 172, 254, 0.12) 0%, transparent 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.modal-torrent-head-ico {
    flex-shrink: 0;
    width: 42px;
    height: 42px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: #7dd3fc;
    background: rgba(79, 172, 254, 0.15);
    border: 1px solid rgba(125, 211, 252, 0.35);
}

.modal-torrent-title {
    margin: 0 0 4px;
    font-size: 17px;
    font-weight: 650;
    color: #f0f7ff;
    letter-spacing: 0.02em;
}

.modal-torrent-sub {
    margin: 0;
    font-size: 13px;
    color: rgba(200, 220, 255, 0.75);
    line-height: 1.45;
}

.modal-torrent-sub code {
    font-size: 12px;
    background: rgba(0, 0, 0, 0.35);
    padding: 1px 6px;
    border-radius: 4px;
    color: #9bdcff;
}

.modal-torrent-intro {
    margin: 0;
    padding: 10px 20px 4px;
    font-size: 12px;
    line-height: 1.55;
    color: rgba(220, 232, 255, 0.78);
}

.modal-torrent-form {
    padding: 6px 20px 18px;
}

.modal-torrent-field {
    margin-bottom: 14px;
}

.modal-torrent-label {
    display: block;
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 600;
    color: rgba(232, 244, 255, 0.92);
    letter-spacing: 0.01em;
}

.modal-torrent-dialog .modal-torrent-input,
.modal-torrent-dialog .modal-torrent-textarea {
    width: 100%;
    box-sizing: border-box;
    font-size: 14px;
    line-height: 1.45;
    padding: 10px 12px;
    min-height: 42px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(8, 12, 24, 0.92);
    color: #e8f2ff;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.modal-torrent-dialog .modal-torrent-input:focus,
.modal-torrent-dialog .modal-torrent-textarea:focus {
    outline: none;
    border-color: rgba(79, 172, 254, 0.55);
    box-shadow: 0 0 0 3px rgba(79, 172, 254, 0.18);
}

.modal-torrent-dialog .modal-torrent-input[readonly] {
    color: rgba(200, 215, 240, 0.88);
    background: rgba(6, 10, 20, 0.65);
}

.modal-torrent-dialog .modal-torrent-textarea {
    min-height: 80px;
    max-height: 200px;
    resize: vertical;
    font-family: ui-monospace, "Cascadia Code", "Consolas", monospace;
    font-size: 14px;
    line-height: 1.5;
}

.modal-torrent-private-block {
    margin-bottom: 14px;
    padding: 12px 14px;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.28);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.modal-torrent-private-label {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin: 0;
    cursor: pointer;
    font-size: 14px;
    line-height: 1.5;
    color: rgba(232, 244, 255, 0.95);
}

.modal-torrent-checkbox {
    width: 18px;
    height: 18px;
    margin-top: 2px;
    flex-shrink: 0;
    accent-color: #4facfe;
    cursor: pointer;
}

.modal-torrent-private-text code {
    font-size: 12px;
    background: rgba(0, 0, 0, 0.35);
    padding: 1px 5px;
    border-radius: 4px;
    color: #9bdcff;
}

.modal-torrent-status {
    font-size: 14px;
    color: #7dd3fc;
    min-height: 1.35em;
    margin: 4px 0 8px;
}

.modal-torrent-log {
    margin-top: 6px;
    margin-bottom: 12px;
    max-height: min(120px, 22vh);
    overflow: auto;
    font-size: 12px;
    line-height: 1.45;
    white-space: pre-wrap;
    word-break: break-word;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 10px;
    padding: 12px 14px;
    color: rgba(220, 232, 255, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.07);
}

.modal-torrent-actions {
    margin-top: 8px;
    padding-top: 4px;
    flex-wrap: wrap;
    gap: 10px;
}

.btn-modal-torrent-primary {
    min-width: 132px;
    text-align: center;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

a.btn-modal-torrent-primary:hover {
    color: #e8f7ff;
    text-decoration: none;
}

.modal-torrent-success {
    padding: 20px 20px 18px;
    text-align: center;
}

.modal-torrent-success-icon {
    font-size: 36px;
    color: #4ade80;
    margin-bottom: 10px;
    line-height: 1;
}

.modal-torrent-success-title {
    margin: 0 0 10px;
    font-size: 18px;
    font-weight: 650;
    color: #ecfdf5;
}

.modal-torrent-success-path {
    margin: 0 0 14px;
    font-size: 13px;
    word-break: break-all;
    color: rgba(180, 220, 255, 0.88);
    text-align: left;
    padding: 10px 12px;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.08);
    font-family: ui-monospace, "Consolas", monospace;
}

.modal-torrent-success-hint {
    margin: 0 0 22px;
    font-size: 13px;
    line-height: 1.6;
    color: rgba(210, 225, 255, 0.78);
    text-align: left;
}

.modal-torrent-success-hint code {
    font-size: 11px;
    background: rgba(0, 0, 0, 0.35);
    padding: 2px 6px;
    border-radius: 4px;
    color: #9bdcff;
}

body.mtool-mobile .modal-torrent-overlay.modal-bbcode-overlay {
    padding: 8px 8px 20px;
}

body.mtool-mobile .modal-bbcode-dialog.modal-torrent-dialog {
    max-width: min(520px, 100vw - 16px);
    width: min(520px, calc(100vw - 16px));
    max-height: calc(100dvh - 20px);
}

body.mtool-mobile .modal-torrent-head {
    padding: 14px 16px 10px;
}

body.mtool-mobile .modal-torrent-intro,
body.mtool-mobile .modal-torrent-form {
    padding-left: 16px;
    padding-right: 16px;
}

body.mtool-mobile .modal-torrent-success {
    padding: 16px 16px 14px;
}

/* 文件浏览器下方：种子异步任务列表 */
.torrent-jobs-panel {
    margin-top: 12px;
    border-radius: 12px;
    border: 1px solid rgba(79, 172, 254, 0.22);
    background: rgba(8, 14, 28, 0.55);
    overflow: hidden;
}

.torrent-jobs-head {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 10px;
    padding: 10px 12px;
    background: rgba(79, 172, 254, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.torrent-jobs-title {
    flex: 1;
    min-width: 0;
    font-size: 13px;
    font-weight: 650;
    color: #e8f4ff;
}

.torrent-jobs-badges {
    display: flex;
    align-items: center;
    gap: 6px;
}

.torrent-jobs-clear-btn {
    font-size: 11px;
    padding: 4px 8px;
    border-radius: 8px;
    border: 1px solid rgba(248, 113, 113, 0.35);
    background: rgba(248, 113, 113, 0.12);
    color: #fecaca;
    cursor: pointer;
    white-space: nowrap;
}

.torrent-jobs-clear-btn:hover {
    background: rgba(248, 113, 113, 0.22);
}

.torrent-jobs-title i {
    margin-right: 6px;
    color: #7dd3fc;
}

.torrent-jobs-badge {
    min-width: 22px;
    height: 22px;
    padding: 0 7px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    line-height: 22px;
    text-align: center;
    background: rgba(251, 191, 36, 0.25);
    color: #fde68a;
    border: 1px solid rgba(251, 191, 36, 0.45);
}

.torrent-jobs-badge.is-zero {
    opacity: 0.45;
}

.torrent-jobs-badge--done {
    background: rgba(34, 197, 94, 0.22);
    color: #bbf7d0;
    border-color: rgba(34, 197, 94, 0.45);
}

.torrent-jobs-badge--fail {
    background: rgba(248, 113, 113, 0.22);
    color: #fecaca;
    border-color: rgba(248, 113, 113, 0.45);
}

.torrent-jobs-toggle {
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(0, 0, 0, 0.25);
    color: rgba(230, 240, 255, 0.9);
    cursor: pointer;
}

.torrent-jobs-toggle:hover {
    background: rgba(255, 255, 255, 0.08);
}

.torrent-jobs-body {
    padding: 10px 12px 12px;
}

.torrent-jobs-body.is-collapsed {
    display: none;
}

.torrent-jobs-hint {
    margin: 0 0 10px;
    font-size: 11px;
    line-height: 1.5;
    color: rgba(200, 215, 240, 0.78);
}

.torrent-jobs-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 220px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.torrent-job-row {
    border-radius: 10px;
    padding: 8px 10px;
    background: rgba(0, 0, 0, 0.28);
    border: 1px solid rgba(255, 255, 255, 0.07);
    font-size: 12px;
    color: rgba(225, 235, 255, 0.92);
}

.torrent-job-row-head {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 4px;
}

.torrent-job-id {
    font-family: ui-monospace, Consolas, monospace;
    font-size: 11px;
    color: #9bdcff;
}

.torrent-job-status {
    font-size: 11px;
    font-weight: 650;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(100, 116, 139, 0.35);
    color: #e2e8f0;
}

.torrent-job-status--run {
    background: rgba(59, 130, 246, 0.35);
    color: #bfdbfe;
}

.torrent-job-status--ok {
    background: rgba(34, 197, 94, 0.3);
    color: #bbf7d0;
}

.torrent-job-status--bad {
    background: rgba(248, 113, 113, 0.28);
    color: #fecaca;
}

.torrent-job-path {
    word-break: break-all;
    opacity: 0.88;
    margin-bottom: 4px;
}

.torrent-job-msg {
    font-size: 11px;
    color: rgba(200, 215, 240, 0.85);
    margin-top: 2px;
}

.torrent-job-progress {
    margin-top: 8px;
}

.torrent-job-bar {
    position: relative;
    height: 10px;
    background: rgba(0, 0, 0, 0.22);
    border-radius: 5px;
    overflow: hidden;
}

.torrent-job-bar__fill {
    height: 100%;
    min-width: 0;
    border-radius: 5px;
    background: linear-gradient(90deg, #3b82f6, #7dd3fc);
    transition: width 0.35s ease;
}

.torrent-job-bar__fill--ok {
    background: linear-gradient(90deg, #16a34a, #4ade80);
}

.torrent-job-bar__fill--fail {
    background: linear-gradient(90deg, #b91c1c, #f87171);
}

.torrent-job-bar__fill--cancel {
    background: linear-gradient(90deg, #64748b, #94a3b8);
}

.torrent-job-bar--indeterminate .torrent-job-bar__fill--indeterminate {
    width: 38%;
    animation: torrent-job-indet-move 1.35s ease-in-out infinite;
}

@keyframes torrent-job-indet-move {
    0% {
        transform: translateX(-120%);
    }
    100% {
        transform: translateX(320%);
    }
}

.torrent-job-bar-label {
    display: block;
    font-size: 11px;
    color: rgba(200, 215, 240, 0.88);
    margin-top: 4px;
}

.torrent-job-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
}

.torrent-job-actions a,
.torrent-job-actions button {
    font-size: 11px;
    padding: 4px 10px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: rgba(79, 172, 254, 0.2);
    color: #e8f7ff;
    cursor: pointer;
    text-decoration: none;
}

.torrent-job-actions button.torrent-job-cancel {
    background: rgba(248, 113, 113, 0.15);
    border-color: rgba(248, 113, 113, 0.35);
    color: #fecaca;
}

.torrent-job-actions button.torrent-job-delete {
    background: rgba(148, 163, 184, 0.12);
    border-color: rgba(148, 163, 184, 0.35);
    color: #e2e8f0;
}

.torrent-job-actions button.torrent-job-detail-toggle {
    background: rgba(100, 116, 139, 0.2);
    border-color: rgba(148, 163, 184, 0.28);
    color: #cbd5e1;
}

.torrent-job-detail {
    display: none;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.torrent-job-row.is-detail-open .torrent-job-detail {
    display: block;
}

.torrent-job-log {
    margin: 0;
    max-height: 140px;
    overflow: auto;
    padding: 8px;
    font-size: 10px;
    line-height: 1.45;
    white-space: pre-wrap;
    word-break: break-word;
    background: rgba(0, 0, 0, 0.35);
    border-radius: 6px;
    color: rgba(200, 215, 240, 0.88);
}

.torrent-job-err-detail {
    margin-top: 6px;
    font-size: 11px;
    color: #fecaca;
    word-break: break-word;
}

.torrent-jobs-empty {
    font-size: 12px;
    color: rgba(180, 195, 220, 0.65);
    padding: 6px 2px;
}

/* 生成简介子面板（豆瓣 ID，随 enableIntro 显示/隐藏） */
.intro-options-panel {
    display: none;
    margin-top: 15px;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.04);
}

/* 豆瓣 ID 与搜索 */
.douban-id-block {
    margin-top: 4px;
}
.douban-id-input-wrap {
    display: flex;
    align-items: stretch;
    gap: 0;
    min-height: 46px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.28);
    overflow: hidden;
}
.douban-id-prefix {
    display: flex;
    align-items: center;
    padding: 0 12px;
    font-size: 13px;
    font-weight: 600;
    color: rgba(180, 195, 220, 0.75);
    border-right: 1px solid rgba(255, 255, 255, 0.12);
}
.douban-id-input {
    flex: 1;
    min-width: 0;
    min-height: 46px;
    padding: 10px 12px !important;
    font-size: 15px !important;
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
}
.douban-id-search-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 48px;
    border: none;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(79, 172, 254, 0.12);
    color: rgba(200, 215, 240, 0.95);
    padding: 0 14px;
    cursor: pointer;
    transition: background 0.15s ease;
}
.douban-id-search-btn:hover {
    background: rgba(79, 172, 254, 0.22);
}
.douban-id-hint {
    margin: 8px 2px 0;
    font-size: 11px;
    color: rgba(180, 195, 220, 0.65);
}
.douban-meta-status {
    white-space: pre-line;
    margin-top: 6px;
    font-size: 11px;
    min-height: 16px;
}
.douban-meta-status.is-loading { color: #93c5fd; }
.douban-meta-status.is-ok { color: #86efac; }
.douban-meta-status.is-error { color: #fecaca; }

.douban-meta-refresh-btn {
    display: inline-block;
    margin-top: 6px;
    padding: 4px 10px;
    font-size: 12px;
    border-radius: 8px;
    border: 1px solid rgba(147, 197, 253, 0.45);
    background: rgba(56, 189, 248, 0.12);
    color: #93c5fd;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.douban-meta-refresh-btn:hover {
    background: rgba(56, 189, 248, 0.22);
    color: #e0f2fe;
}

.douban-search-dialog {
    max-width: 680px;
    width: min(96vw, 680px);
    padding: 0;
    overflow: hidden;
}
.douban-search-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 20px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.douban-search-header-title {
    margin: 0;
    font-size: 17px;
    font-weight: 650;
    color: #f0f9ff;
}
.douban-search-header-close {
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    border: none;
    border-radius: 8px;
    font-size: 22px;
    line-height: 1;
    color: rgba(255, 255, 255, 0.75);
    background: rgba(255, 255, 255, 0.08);
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}
.douban-search-header-close:hover {
    color: #fff;
    background: rgba(56, 189, 248, 0.28);
}
.douban-search-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 14px 16px;
    padding: 6px 10px 6px 14px;
    border: 1px solid rgba(79, 172, 254, 0.35);
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.35);
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.25) inset;
}
.douban-search-toolbar-icon {
    color: rgba(147, 197, 253, 0.9);
    font-size: 14px;
}
.douban-search-input {
    flex: 1;
    min-width: 0;
    border: none;
    background: transparent;
    color: #f8fafc;
    font-size: 15px;
    padding: 8px 4px;
    outline: none;
}
.douban-search-input::placeholder {
    color: rgba(180, 195, 220, 0.55);
}
.douban-search-submit {
    flex-shrink: 0;
    border: none;
    border-radius: 999px;
    padding: 8px 18px;
    font-size: 14px;
    font-weight: 600;
    color: #0f172a;
    background: linear-gradient(135deg, #7dd3fc 0%, #38bdf8 100%);
    cursor: pointer;
    transition: filter 0.15s ease, transform 0.1s ease;
}
.douban-search-submit:hover {
    filter: brightness(1.06);
}
.douban-search-results {
    max-height: min(62vh, 520px);
    overflow: auto;
    margin: 0 12px 16px;
    padding: 4px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.22);
}
.douban-search-item {
    display: flex;
    gap: 14px;
    width: 100%;
    text-align: left;
    padding: 12px 14px;
    border: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    background: transparent;
    color: inherit;
    cursor: pointer;
    transition: background 0.15s ease;
}
.douban-search-item:last-child {
    border-bottom: none;
}
.douban-search-item:hover,
.douban-search-item:focus-visible {
    background: rgba(79, 172, 254, 0.14);
    outline: none;
}
.douban-search-poster-wrap {
    flex-shrink: 0;
    width: 56px;
    height: 80px;
}
.douban-search-poster {
    width: 56px;
    height: 80px;
    object-fit: cover;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}
.douban-search-poster--empty,
.douban-search-poster--placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 80px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.06);
    color: rgba(180, 195, 220, 0.45);
    font-size: 11px;
}
.douban-search-body {
    flex: 1;
    min-width: 0;
}
.douban-search-title-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
}
.douban-search-title {
    font-weight: 650;
    font-size: 15px;
    line-height: 1.35;
    color: #f1f5f9;
}
.douban-search-rating {
    flex-shrink: 0;
    font-size: 12px;
    font-weight: 600;
    color: #fbbf24;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(251, 191, 36, 0.12);
}
.douban-search-meta {
    margin-top: 4px;
    font-size: 12px;
    color: rgba(180, 195, 220, 0.8);
    line-height: 1.4;
}
.douban-search-intro {
    margin-top: 6px;
    font-size: 12px;
    line-height: 1.55;
    color: rgba(203, 213, 225, 0.88);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.douban-search-type {
    display: inline-block;
    margin-top: 6px;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 4px;
    color: #93c5fd;
    background: rgba(59, 130, 246, 0.18);
}
.douban-search-section-label {
    margin: 10px 4px 6px;
    font-size: 12px;
    font-weight: 700;
    color: #9ee7ff;
}
.douban-search-section-label:first-child {
    margin-top: 0;
}
.douban-search-empty {
    padding: 28px 16px;
    text-align: center;
    color: rgba(180, 195, 220, 0.65);
    font-size: 13px;
}

.modal-bbcode-dialog--wide { max-width: 720px; width: min(96vw, 720px); }

/* PC：BBCode 预览弹窗与内容区加大（移动端保持原尺寸） */
body:not(.mtool-mobile) .bbcode-preview-dialog.modal-bbcode-dialog--wide {
    max-width: min(96vw, 1100px);
    width: min(96vw, 1100px);
    max-height: min(92vh, 900px);
}
body:not(.mtool-mobile) .bbcode-preview-body,
body:not(.mtool-mobile) .bbcode-preview-pane--raw,
body:not(.mtool-mobile) .bbcode-preview-panels[data-active="raw"] > [data-bbcode-panel="raw"] {
    max-height: min(72vh, 680px);
}
body:not(.mtool-mobile) .bbcode-preview-raw-editor {
    min-height: 320px;
    max-height: min(64vh, 600px);
}

.bbcode-preview-tabs {
    display: flex;
    gap: 8px;
    margin: 0 0 10px;
}
.bbcode-preview-tab {
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(0, 0, 0, 0.25);
    color: rgba(220, 230, 245, 0.85);
    border-radius: 8px;
    padding: 6px 14px;
    font-size: 13px;
    cursor: pointer;
}
.bbcode-preview-tab.is-active {
    background: rgba(56, 189, 248, 0.22);
    border-color: rgba(56, 189, 248, 0.45);
    color: #f0f9ff;
}
.bbcode-preview-body {
    max-height: min(55vh, 420px);
    overflow: auto;
    padding: 12px;
    background: rgba(0, 0, 0, 0.35);
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.5;
}
.bbcode-preview-panels > .bbcode-preview-panel {
    display: none;
}
.bbcode-preview-panels[data-active="render"] > [data-bbcode-panel="render"] {
    display: block;
}
.bbcode-preview-panels[data-active="raw"] > [data-bbcode-panel="raw"] {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: min(55vh, 420px);
}
.bbcode-preview-pane.is-hidden { display: none; }
.bbcode-preview-pane--raw,
.bbcode-preview-panel--raw {
    flex-direction: column;
    gap: 8px;
    max-height: min(55vh, 420px);
}
.bbcode-raw-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}
.bbcode-raw-toolbar-spacer { flex: 1; min-width: 8px; }
.bbcode-raw-tool {
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(0, 0, 0, 0.3);
    color: #e2e8f0;
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 12px;
    cursor: pointer;
}
.bbcode-raw-tool--icon { padding: 4px 8px; }
.bbcode-raw-tool:hover { background: rgba(56, 189, 248, 0.2); }
.bbcode-raw-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 8px;
    flex-wrap: wrap;
}
.bbcode-raw-save-hint {
    flex: 1;
    min-width: 120px;
    font-size: 12px;
    color: #86efac;
    opacity: 0;
    transition: opacity 0.2s ease;
    text-align: right;
}
.bbcode-raw-save-hint.is-visible {
    opacity: 1;
}
#bbcodeRawSaveBtn.is-saved {
    background: #16a34a;
    border-color: #16a34a;
    box-shadow: 0 0 0 2px rgba(74, 222, 128, 0.35);
}
.bbcode-preview-raw-editor {
    flex: 1;
    min-height: 180px;
    max-height: min(48vh, 360px);
    font-family: ui-monospace, Consolas, monospace;
    font-size: 12px;
    line-height: 1.45;
    resize: vertical;
}
.bbcode-preview-raw {
    margin: 0;
    white-space: pre-wrap;
    word-break: break-word;
    font-family: ui-monospace, Consolas, monospace;
    font-size: 12px;
}
.bbcode-preview-box { margin: 10px 0; }
.bbcode-preview-tag { font-size: 11px; color: #93c5fd; margin-bottom: 6px; }
.bbcode-preview-pre { margin: 0; white-space: pre-wrap; font-size: 12px; }
.bbcode-preview-quote {
    margin: 10px 0;
    padding: 10px 14px;
    border-left: 4px solid rgba(251, 191, 36, 0.75);
    background: rgba(251, 191, 36, 0.08);
    border-radius: 0 8px 8px 0;
}
.bbcode-preview-hide {
    margin: 10px 0;
    border: 1px solid rgba(252, 211, 77, 0.35);
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.2);
    padding: 6px 10px;
}
.bbcode-preview-hide-summary {
    cursor: pointer;
    color: #fcd34d;
    font-weight: 600;
    list-style: none;
}
.bbcode-preview-hide-body { margin-top: 8px; }
.bbcode-preview-img img { max-width: 100%; height: auto; border-radius: 4px; }
.bbcode-preview-plain { margin: 8px 0; opacity: 0.92; }

.mi-preview { margin: 4px 0; }
.mi-preview-banner {
    background: linear-gradient(90deg, #f59e0b 0%, #fbbf24 55%, #f59e0b 100%);
    color: #111827;
    font-weight: 700;
    font-size: 14px;
    padding: 8px 12px;
    border-radius: 6px 6px 0 0;
    word-break: break-all;
}
.mi-preview-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-top: none;
    border-radius: 0 0 6px 6px;
    overflow: hidden;
    background: rgba(15, 23, 42, 0.65);
}
.mi-preview-col {
    padding: 10px 12px;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    min-width: 0;
}
.mi-preview-col:last-child { border-right: none; }
.mi-preview-col-title {
    font-weight: 700;
    font-size: 13px;
    color: #e2e8f0;
    margin-bottom: 8px;
    padding-bottom: 4px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.mi-preview-kv { margin: 4px 0; font-size: 12px; line-height: 1.45; }
.mi-preview-k { color: #94a3b8; }
.mi-preview-v { color: #f1f5f9; }
.mi-preview-line { margin: 4px 0; font-size: 12px; color: #e2e8f0; }
.mi-preview-empty { margin: 0; color: #64748b; font-size: 12px; }

@media (max-width: 900px) {
    .mi-preview-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
    .mi-preview-grid { grid-template-columns: 1fr; }
    .title-gen-form-row--pair { grid-template-columns: 1fr; }
}

.title-gen-media-store { display: none; }

/* 复制发种标题弹窗：125% 缩放下可滚动、固定底栏按钮 */
.title-copy-dialog {
    max-width: min(96vw, 1100px);
    width: min(96vw, 1100px);
    max-height: min(92vh, 880px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 18px 20px;
}
.title-copy-dialog__hint {
    flex-shrink: 0;
    margin-bottom: 8px;
}
.title-copy-dialog__body {
    flex: 1;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    padding-right: 4px;
}
.title-copy-dialog__actions {
    flex-shrink: 0;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.title-gen-media-summary {
    margin: 0 0 12px;
    padding: 0;
    background: transparent;
    border-radius: 0;
    font-size: 12px;
    max-height: none;
    overflow: visible;
}
.title-gen-mi-preview .mi-preview { margin: 0; }
.title-gen-mi-preview .bbcode-preview-box { margin: 0; }
.title-media-summary-empty { margin: 0; color: #94a3b8; font-size: 12px; }
.title-media-details { margin-top: 8px; }
.title-media-details summary {
    cursor: pointer;
    color: #93c5fd;
    font-size: 12px;
}
.title-media-details-pre {
    margin: 8px 0 0;
    max-height: 160px;
    overflow: auto;
    font-size: 11px;
    white-space: pre-wrap;
}

.title-gen-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px 12px;
    margin: 0 0 12px;
}
.title-gen-form-row--pair {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px 12px;
}
.title-gen-form--compact .title-gen-input {
    font-size: 14px;
    padding: 8px 10px;
    min-height: 38px;
    line-height: 1.35;
}
.title-gen-form label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; }
.title-gen-results {
    margin-top: 4px;
    max-height: none;
    overflow: visible;
}
.title-gen-result-row {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.title-gen-result-row.is-editing { align-items: center; }
.title-gen-label { flex: 0 0 76px; font-size: 13px; color: #93c5fd; padding-top: 6px; }
.title-gen-text-wrap {
    flex: 1;
    min-width: 0;
    max-height: 72px;
    overflow: auto;
    padding: 6px 8px;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
}
.title-gen-text {
    display: block;
    font-size: 12px;
    word-break: break-all;
    line-height: 1.45;
    white-space: pre-wrap;
}
.title-gen-edit-input {
    flex: 1;
    min-width: 0;
    font-size: 13px;
    padding: 8px 10px;
    min-height: 38px;
}
.btn-title-edit-one {
    flex: 0 0 auto;
    padding: 4px 8px;
    min-width: 32px;
}
.btn-title-copy-one { flex: 0 0 auto; white-space: nowrap; }