/* 护眼暗色：柔和深灰蓝 + 低饱和青绿点缀 */
:root {
    --net-bg-1: #000000;
    --net-bg-2: #000000;
    --net-bg-3: #000000;
    --net-primary: #7eb8da;
    --net-primary-soft: #5a8fad;
    --net-primary-dim: rgba(126, 184, 218, 0.14);
    --net-accent: #6db3a8;
    --net-accent-dim: rgba(109, 179, 168, 0.12);
    --net-warm: #c9a87c;
    --net-warm-dim: rgba(201, 168, 124, 0.12);
    --net-text: #d4dee8;
    --net-text-body: #b8c5d4;
    --net-text-muted: #7a8d9e;
    --net-surface: rgba(32, 42, 56, 0.88);
    --net-surface-solid: #252f3d;
    --net-surface-raised: #2c3848;
    --net-border: rgba(126, 184, 218, 0.12);
    --net-border-strong: rgba(126, 184, 218, 0.22);
    --net-shadow: 0 4px 24px rgba(0, 0, 0, 0.28);
    --net-radius: 10px;
    --net-input-bg: #1e2834;
    --net-canvas-bg: rgba(0, 0, 0, 0.35);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', 'Microsoft YaHei', 'PingFang SC', sans-serif;
    background: #000000;
    color: var(--net-text-body);
    min-height: 100vh;
    overflow: hidden;
}

.net-bg-deco {
    display: none;
}

.net-topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: var(--net-surface);
    border-bottom: 1px solid var(--net-border);
    box-shadow: var(--net-shadow);
    backdrop-filter: blur(14px);
    flex-wrap: wrap;
}

.net-topbar h1 {
    font-size: 15px;
    font-weight: 600;
    color: var(--net-text);
    white-space: nowrap;
    margin-right: 4px;
}

.net-topbar h1 span {
    color: var(--net-accent);
    font-weight: 400;
    font-size: 11px;
    margin-left: 6px;
    opacity: 0.85;
}

.net-btn,
.net-back-word {
    border: 1px solid var(--net-border-strong);
    background: var(--net-surface-raised);
    color: var(--net-text-body);
    border-radius: 20px;
    padding: 6px 12px;
    cursor: pointer;
    font-size: 12px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
    white-space: nowrap;
}

.net-btn:hover,
.net-back-word:hover {
    background: var(--net-primary-dim);
    border-color: rgba(126, 184, 218, 0.35);
    color: var(--net-text);
}

.net-btn.primary {
    background: linear-gradient(135deg, rgba(90, 143, 173, 0.55), rgba(70, 120, 150, 0.65));
    border-color: rgba(126, 184, 218, 0.35);
    color: var(--net-text);
}

.net-btn.primary:hover {
    background: linear-gradient(135deg, rgba(100, 155, 185, 0.65), rgba(80, 130, 160, 0.75));
}

.net-btn-group {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    align-items: center;
}

.net-topbar-actions-wrap {
    display: contents;
}

.net-root-input {
    border: 1px solid var(--net-border-strong);
    background: var(--net-input-bg);
    color: var(--net-text);
    border-radius: 20px;
    padding: 6px 12px;
    font-size: 13px;
    width: 140px;
    outline: none;
}

.net-root-input:focus {
    border-color: rgba(126, 184, 218, 0.45);
    box-shadow: 0 0 0 2px rgba(126, 184, 218, 0.12);
}

.net-status {
    margin-left: auto;
    font-size: 11px;
    color: var(--net-text-muted);
}

.net-layout {
    position: fixed;
    top: 52px;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    --net-catalog-w: 220px;
    --net-sidebar-w: 368px;
}

.net-catalog-panel {
    width: var(--net-catalog-w);
    flex-shrink: 0;
    background: var(--net-surface);
    border-right: 1px solid var(--net-border);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: width 0.22s ease, opacity 0.18s ease, border-color 0.18s;
}

.net-layout.is-left-collapsed {
    --net-catalog-w: 0px;
}

.net-layout.is-left-collapsed .net-catalog-panel {
    opacity: 0;
    pointer-events: none;
    border-right-color: transparent;
}

.net-catalog-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    border-bottom: 1px solid var(--net-border);
    background: rgba(38, 50, 64, 0.45);
}

.net-catalog-head-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.net-catalog-head h2 {
    font-size: 12px;
    color: var(--net-primary);
    letter-spacing: 0.05em;
    font-weight: 600;
    opacity: 0.9;
}

.net-catalog-add {
    border: 1px solid var(--net-border-strong);
    background: var(--net-primary-dim);
    color: var(--net-primary);
    border-radius: 8px;
    width: 28px;
    height: 28px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.net-catalog-add:hover {
    background: rgba(126, 184, 218, 0.22);
}

.net-catalog-tree {
    flex: 1;
    overflow-y: auto;
    padding: 8px 6px;
}

.net-catalog-node {
    user-select: none;
}

.net-catalog-row {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 8px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 12px;
    color: var(--net-text-body);
    transition: background 0.15s;
}

.net-catalog-row:hover {
    background: var(--net-primary-dim);
}

.net-catalog-row.active {
    background: rgba(90, 130, 160, 0.22);
    color: var(--net-text);
    box-shadow: inset 3px 0 0 var(--net-primary-soft);
}

.net-catalog-toggle {
    width: 16px;
    flex-shrink: 0;
    border: none;
    background: transparent;
    color: var(--net-text-muted);
    cursor: pointer;
    padding: 0;
    font-size: 10px;
    line-height: 1;
}

.net-catalog-toggle.placeholder {
    visibility: hidden;
}

.net-catalog-icon {
    color: var(--net-warm);
    font-size: 11px;
    flex-shrink: 0;
    opacity: 0.85;
}

.net-catalog-label {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.net-catalog-sub {
    font-size: 10px;
    color: var(--net-text-muted);
    margin-left: 2px;
    font-weight: 400;
}

.net-catalog-children {
    margin-left: 14px;
}

.net-catalog-hint {
    padding: 8px 10px;
    font-size: 10px;
    line-height: 1.45;
    color: var(--net-text-muted);
    border-top: 1px solid var(--net-border);
    background: var(--net-warm-dim);
}

.net-map-area {
    flex: 1;
    min-width: 0;
    position: relative;
    display: flex;
    flex-direction: column;
}

.net-rail-toggle {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 25;
    width: 24px;
    height: 58px;
    padding: 0;
    border: 1px solid var(--net-border-strong);
    background: rgba(38, 50, 66, 0.97);
    color: var(--net-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    box-shadow: 0 2px 14px rgba(0, 0, 0, 0.45);
    transition: background 0.15s, color 0.15s, border-color 0.15s, left 0.22s ease, right 0.22s ease;
}

.net-rail-toggle:hover {
    background: rgba(52, 68, 86, 0.98);
    color: var(--net-text);
    border-color: rgba(126, 184, 218, 0.5);
}

.net-rail-toggle-left {
    left: calc(var(--net-catalog-w) - 12px);
    border-radius: 0 10px 10px 0;
}

.net-layout.is-left-collapsed .net-rail-toggle-left {
    left: 0;
}

.net-rail-toggle-right {
    right: calc(var(--net-sidebar-w) - 12px);
    border-radius: 10px 0 0 10px;
}

.net-layout.is-right-collapsed .net-rail-toggle-right {
    right: 0;
}

.net-map-toolbar {
    padding: 6px 12px;
    font-size: 11px;
    color: var(--net-text-muted);
    border-bottom: 1px solid var(--net-border);
    background: rgba(28, 38, 50, 0.6);
}

.net-map-toolbar kbd {
    display: inline-block;
    padding: 1px 5px;
    border-radius: 4px;
    background: var(--net-surface-raised);
    border: 1px solid var(--net-border-strong);
    color: var(--net-primary);
    font-size: 10px;
    margin: 0 1px;
}

#mindmap-svg {
    flex: 1;
    width: 100%;
    min-height: 200px;
    display: block;
    background: var(--net-canvas-bg);
    cursor: grab;
    user-select: none;
}

#mindmap-svg:active {
    cursor: grabbing;
}

.mm-node {
    cursor: grab;
}

.mm-node.mm-selected {
    filter: drop-shadow(0 0 12px rgba(126, 184, 218, 0.55)) drop-shadow(0 3px 10px rgba(0, 0, 0, 0.38));
}

.mm-node.mm-center-node .mm-node-bg {
    stroke-opacity: 0.95;
}

.mm-node.mm-dragging {
    cursor: grabbing;
}

.mm-node-ghost {
    pointer-events: none;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.45));
}

.mm-drag-placeholder {
    pointer-events: none;
}

.mm-edge-preview {
    pointer-events: none;
}

.mm-edge-ghost {
    pointer-events: none;
}

.mm-edge {
    pointer-events: none;
}

.net-sidebar-note {
    font-size: 11px;
    color: var(--net-text-muted);
    margin: -6px 0 10px;
    line-height: 1.45;
}

.net-context-menu {
    position: fixed;
    z-index: 300;
    min-width: 168px;
    background: var(--net-surface-solid);
    border: 1px solid var(--net-border-strong);
    border-radius: var(--net-radius);
    padding: 6px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    display: none;
    flex-direction: column;
    gap: 2px;
}

.net-context-menu.show {
    display: flex;
}

.net-context-menu button {
    border: none;
    background: transparent;
    color: var(--net-text-body);
    text-align: left;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.net-context-menu button:hover {
    background: var(--net-primary-dim);
    color: var(--net-text);
}

.net-context-menu button.danger {
    color: #d4a0a0;
}

.net-context-menu button.danger:hover {
    background: rgba(180, 100, 100, 0.15);
}

.net-context-menu hr {
    border: none;
    border-top: 1px solid var(--net-border);
    margin: 4px 0;
}

.net-context-menu button .net-menu-swatch {
    width: 14px;
    height: 14px;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    margin-left: auto;
    flex-shrink: 0;
}

.net-context-menu button .net-menu-icon-preview {
    margin-left: auto;
    color: var(--net-text-muted);
    font-size: 12px;
    flex-shrink: 0;
}

#net-context-menu {
    min-width: 248px;
    padding: 10px;
    gap: 4px;
    border-radius: 12px;
}

#net-context-menu button {
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 16px;
    gap: 10px;
}

#net-context-menu button i {
    width: 18px;
    text-align: center;
    font-size: 15px;
}

#net-context-menu hr {
    margin: 6px 0;
}

#net-context-menu button .net-menu-swatch {
    width: 22px;
    height: 22px;
    border-radius: 5px;
    border-width: 2px;
}

#net-context-menu button .net-menu-icon-preview {
    font-size: 16px;
}

.net-picker-panel {
    position: fixed;
    z-index: 310;
    width: min(440px, calc(100vw - 24px));
    background: var(--net-surface-solid);
    border: 1px solid var(--net-border-strong);
    border-radius: 14px;
    padding: 14px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
}

.net-picker-panel.hidden {
    display: none;
}

.net-picker-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 16px;
    font-weight: 600;
    color: var(--net-text);
}

.net-picker-clear {
    border: none;
    background: transparent;
    color: var(--net-text-muted);
    font-size: 14px;
    cursor: pointer;
    padding: 4px 10px;
    border-radius: 6px;
}

.net-picker-clear:hover {
    background: var(--net-primary-dim);
    color: var(--net-text);
}

.net-picker-preview {
    height: 54px;
    border-radius: 10px;
    border: 2px solid var(--net-border-strong);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    overflow: hidden;
}

.net-picker-preview-eng {
    font-size: 20px;
    font-weight: 600;
    line-height: 1;
}

.net-picker-preview-zh {
    font-size: 16px;
    line-height: 1;
}

.net-picker-preview.net-icon-preview {
    background: rgba(38, 50, 66, 0.94);
    font-size: 28px;
    color: #9eb8cc;
}

.net-picker-preview-label {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.85);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
    padding: 0 6px;
    text-align: center;
    word-break: break-all;
}

.net-picker-preview-default {
    font-size: 14px;
    color: var(--net-text-muted);
}

.net-picker-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 6px;
}

.net-color-swatch {
    width: 100%;
    aspect-ratio: 1;
    min-height: 44px;
    border: 2px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    overflow: hidden;
}

.net-swatch-eng {
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
}

.net-swatch-zh {
    font-size: 10px;
    line-height: 1;
}

.net-color-swatch:hover {
    transform: scale(1.08);
}

.net-color-swatch.is-active {
    border-color: #fff;
    box-shadow: 0 0 0 1px rgba(126, 184, 218, 0.6);
}

.net-icon-swatch {
    width: 100%;
    aspect-ratio: 1;
    min-height: 44px;
    border: 2px solid var(--net-border);
    border-radius: 8px;
    background: rgba(38, 50, 66, 0.6);
    color: #9eb8cc;
    cursor: pointer;
    padding: 0;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.net-icon-swatch:hover {
    background: var(--net-primary-dim);
    color: var(--net-text);
}

.net-icon-swatch.is-active {
    border-color: rgba(126, 184, 218, 0.65);
    background: rgba(62, 86, 112, 0.85);
    color: #eef4fa;
}

@media (max-width: 520px) {
    #net-context-menu {
        min-width: 220px;
    }

    #net-context-menu button {
        padding: 11px 14px;
        font-size: 15px;
    }

    .net-picker-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 8px;
    }

    .net-color-swatch,
    .net-icon-swatch {
        min-height: 52px;
    }

    .net-icon-swatch {
        font-size: 22px;
    }
}

.mm-node-icon-block-inner {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    line-height: 1;
}

.net-sidebar {
    width: var(--net-sidebar-w);
    flex-shrink: 0;
    background: var(--net-surface);
    border-left: 1px solid var(--net-border);
    padding: 14px;
    overflow-y: auto;
    transition: width 0.22s ease, opacity 0.18s ease, padding 0.18s ease, border-color 0.18s;
}

.net-layout.is-right-collapsed {
    --net-sidebar-w: 0px;
}

.net-layout.is-right-collapsed .net-sidebar {
    opacity: 0;
    pointer-events: none;
    padding: 0;
    border-left-color: transparent;
    overflow: hidden;
}

.net-sidebar h2 {
    font-size: 12px;
    color: var(--net-accent);
    margin-bottom: 10px;
    letter-spacing: 0.05em;
    font-weight: 600;
    opacity: 0.9;
}

.net-sidebar-details {
    margin-bottom: 16px;
}

.net-sidebar-summary {
    list-style: none;
    cursor: pointer;
    font-size: 12px;
    color: var(--net-accent);
    letter-spacing: 0.05em;
    font-weight: 600;
    opacity: 0.95;
    padding: 4px 0;
    user-select: none;
    display: flex;
    align-items: center;
    gap: 8px;
}

.net-sidebar-summary::-webkit-details-marker {
    display: none;
}

.net-fold-icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    background: var(--net-surface-raised);
    border: 1px solid var(--net-border-strong);
    color: var(--net-primary);
    font-size: 10px;
    transition: transform 0.18s ease, background 0.15s, border-color 0.15s, color 0.15s;
}

.net-sidebar-summary:hover .net-fold-icon {
    background: var(--net-primary-dim);
    border-color: rgba(126, 184, 218, 0.45);
    color: var(--net-text);
}

.net-sidebar-details[open] > .net-sidebar-summary .net-fold-icon {
    transform: rotate(90deg);
    background: rgba(109, 179, 168, 0.14);
    border-color: rgba(109, 179, 168, 0.35);
    color: var(--net-accent);
}

.net-md-details {
    margin-bottom: 14px;
}

.net-md-details .net-md-panel {
    margin-top: 10px;
    margin-bottom: 0;
}

.net-sidebar-details .net-shortcut-list {
    margin-top: 8px;
    margin-bottom: 0;
}

.net-sidebar-details .net-sidebar-note {
    margin-top: 8px;
    margin-bottom: 10px;
}

.net-sidebar-details .net-template-grid {
    margin-top: 0;
    margin-bottom: 0;
}

.net-sidebar-details .net-collect-list {
    margin-top: 0;
}

.net-sidebar-details .net-collect-pager {
    margin-bottom: 0;
}

.net-sidebar-details .net-history-list {
    margin-top: 0;
}

.net-history-details > .net-sidebar-summary .net-sync-status {
    width: 20px;
    height: 20px;
    font-size: 10px;
}

.net-shortcut-list {
    list-style: none;
    font-size: 12px;
    line-height: 1.85;
    color: var(--net-text-body);
    margin-bottom: 16px;
}

.net-shortcut-list kbd {
    display: inline-block;
    min-width: 52px;
    padding: 1px 6px;
    border-radius: 4px;
    background: var(--net-surface-raised);
    border: 1px solid var(--net-border-strong);
    color: var(--net-primary);
    font-size: 10px;
    text-align: center;
    margin-right: 6px;
}

.net-template-grid {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 16px;
}

.net-template-btn {
    border: 1px solid var(--net-border);
    background: var(--net-surface-raised);
    color: var(--net-text-body);
    border-radius: 8px;
    padding: 8px 10px 8px 8px;
    cursor: pointer;
    font-size: 11px;
    text-align: left;
    transition: background 0.2s, border-color 0.2s, filter 0.2s;
    line-height: 1.35;
    display: flex;
    align-items: center;
    gap: 8px;
}

.net-template-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    background: var(--tpl-color, var(--net-accent));
    box-shadow: 0 0 6px var(--tpl-color, var(--net-accent));
}

.net-template-btn:hover {
    filter: brightness(1.08);
    border-color: var(--tpl-border, rgba(109, 179, 168, 0.45));
}

.net-template-btn .tag {
    display: none;
}

.net-collect-list {
    max-height: 380px;
    overflow-y: auto;
    border: 1px solid var(--net-border);
    border-radius: 8px;
    background: var(--net-input-bg);
    margin-bottom: 8px;
    scrollbar-width: thin;
    scrollbar-color: rgba(126, 184, 218, 0.42) rgba(30, 40, 52, 0.65);
}

.net-collect-list::-webkit-scrollbar {
    width: 7px;
}

.net-collect-list::-webkit-scrollbar-track {
    background: rgba(30, 40, 52, 0.55);
    border-radius: 0 8px 8px 0;
}

.net-collect-list::-webkit-scrollbar-thumb {
    background: rgba(126, 184, 218, 0.35);
    border-radius: 4px;
    border: 2px solid transparent;
    background-clip: padding-box;
}

.net-collect-list::-webkit-scrollbar-thumb:hover {
    background: rgba(109, 179, 168, 0.52);
    border: 2px solid transparent;
    background-clip: padding-box;
}

.net-collect-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--net-border);
    cursor: pointer;
    transition: background 0.15s;
}

.net-collect-item:last-child {
    border-bottom: none;
}

.net-collect-item:hover {
    background: var(--net-primary-dim);
}

.net-collect-item-body {
    flex: 1;
    min-width: 0;
}

.net-collect-item-eng {
    font-size: 14px;
    font-weight: 600;
    color: var(--net-text);
    line-height: 1.4;
}

.net-collect-item-zh {
    font-size: 12px;
    color: var(--net-text-muted);
    margin-top: 3px;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.net-collect-empty {
    padding: 16px;
    text-align: center;
    font-size: 13px;
    color: var(--net-text-muted);
}

.net-collect-pager {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 8px;
    margin-bottom: 0;
}

.net-collect-page-btn {
    padding: 4px 10px;
    font-size: 11px;
}

.net-collect-page-info {
    font-size: 11px;
    color: var(--net-text-muted);
    min-width: 72px;
    text-align: center;
}

.net-sync-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    font-size: 11px;
    flex-shrink: 0;
}

.net-sync-status.is-idle {
    color: var(--net-text-muted);
    background: rgba(122, 141, 158, 0.15);
}

.net-sync-status.is-synced {
    color: #6ee7b7;
    background: rgba(16, 120, 90, 0.22);
}

.net-sync-status.is-pending {
    color: #fbbf24;
    background: rgba(180, 120, 20, 0.22);
}

.net-history-list {
    max-height: 260px;
    overflow-y: auto;
    border: 1px solid var(--net-border);
    border-radius: 8px;
    background: var(--net-input-bg);
}

.net-history-list::-webkit-scrollbar {
    width: 6px;
}

.net-history-list::-webkit-scrollbar-thumb {
    background: rgba(126, 184, 218, 0.25);
    border-radius: 6px;
}

.net-history-empty {
    padding: 16px 12px;
    text-align: center;
    color: var(--net-text-muted);
    font-size: 12px;
}

.net-history-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-bottom: 1px solid rgba(126, 184, 218, 0.08);
}

.net-history-item:last-child {
    border-bottom: none;
}

.net-history-item.is-current {
    background: rgba(126, 184, 218, 0.08);
}

.net-history-body {
    flex: 1;
    min-width: 0;
}

.net-history-label {
    font-size: 12px;
    color: var(--net-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.net-history-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 2px;
}

.net-history-time {
    font-size: 10px;
    color: var(--net-text-muted);
}

.net-history-synced,
.net-history-pending {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 9px;
    line-height: 1;
}

.net-history-synced {
    color: #6ee7b7;
}

.net-history-synced i {
    font-size: 10px;
}

.net-history-pending {
    color: #fbbf24;
}

.net-history-pending i {
    font-size: 9px;
}

.net-history-restore {
    border: 1px solid var(--net-border-strong);
    background: transparent;
    color: var(--net-text-muted);
    border-radius: 8px;
    width: 28px;
    height: 28px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.net-history-restore:hover:not(:disabled) {
    color: var(--net-primary);
    border-color: rgba(126, 184, 218, 0.45);
    background: rgba(126, 184, 218, 0.12);
}

.net-history-restore:disabled {
    opacity: 0.35;
    cursor: default;
}

.net-edit-batch-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
    padding: 8px 10px;
    border: 1px solid var(--net-border);
    border-radius: 8px;
    background: rgba(38, 50, 64, 0.45);
}

.net-edit-batch-bar.hidden {
    display: none;
}

.net-edit-check-all-label {
    font-size: 12px;
    color: var(--net-text-body);
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    user-select: none;
}

.net-edit-result-check {
    flex-shrink: 0;
    margin-top: 3px;
    accent-color: var(--net-primary);
}

.net-edit-batch-bar .net-btn.primary {
    padding: 5px 12px;
    font-size: 11px;
}

.net-md-panel {
    margin-bottom: 14px;
}

.net-md-textarea {
    width: 100%;
    min-height: 120px;
    resize: vertical;
    border: 1px solid var(--net-border-strong);
    background: var(--net-input-bg);
    color: var(--net-text-body);
    border-radius: 8px;
    padding: 8px;
    font-size: 11px;
    font-family: Consolas, 'Courier New', monospace;
    line-height: 1.45;
    outline: none;
}

.net-md-textarea:focus {
    border-color: rgba(126, 184, 218, 0.4);
    box-shadow: 0 0 0 2px rgba(126, 184, 218, 0.1);
}

.net-hint {
    font-size: 11px;
    line-height: 1.55;
    color: var(--net-text-muted);
}

.net-sidebar-details .net-hint {
    border-top: none;
    padding-top: 0;
    margin-bottom: 0;
}

.net-hint code {
    font-size: 10px;
    color: var(--net-primary);
}

.net-toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(80px);
    background: var(--net-surface-solid);
    border: 1px solid var(--net-border-strong);
    color: var(--net-text);
    padding: 10px 18px;
    border-radius: 24px;
    font-size: 13px;
    z-index: 200;
    opacity: 0;
    transition: transform 0.3s, opacity 0.3s;
    pointer-events: none;
    box-shadow: var(--net-shadow);
}

.net-toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.net-loading {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(26, 34, 45, 0.75);
    color: var(--net-primary);
    font-size: 14px;
    z-index: 10;
}

.net-loading.hidden {
    display: none;
}

.net-edit-modal {
    position: fixed;
    inset: 0;
    z-index: 400;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.net-edit-modal.show {
    display: flex;
}

.net-edit-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(12, 18, 26, 0.72);
    backdrop-filter: blur(6px);
}

.net-edit-dialog {
    position: relative;
    width: min(580px, 100%);
    max-height: min(88vh, 740px);
    display: flex;
    flex-direction: column;
    background: var(--net-surface-solid);
    border: 1px solid var(--net-border-strong);
    border-radius: 16px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.45);
    overflow: hidden;
}

.net-edit-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid var(--net-border);
    background: rgba(38, 50, 64, 0.5);
}

.net-edit-header h3 {
    font-size: 15px;
    color: var(--net-text);
    font-weight: 600;
}

.net-edit-close {
    border: none;
    background: transparent;
    color: var(--net-text-muted);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 14px;
}

.net-edit-close:hover {
    background: var(--net-primary-dim);
    color: var(--net-text);
}

.net-edit-body {
    padding: 14px 16px;
    overflow-y: auto;
    flex: 1;
}

.net-edit-search-row {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
}

.net-edit-search-input {
    flex: 1;
    border: 1px solid var(--net-border-strong);
    background: var(--net-input-bg);
    color: var(--net-text);
    border-radius: 20px;
    padding: 8px 14px;
    font-size: 13px;
    outline: none;
}

.net-edit-search-input:focus {
    border-color: rgba(126, 184, 218, 0.4);
    box-shadow: 0 0 0 2px rgba(126, 184, 218, 0.1);
}

.net-edit-results {
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 14px;
    border: 1px solid var(--net-border);
    border-radius: 8px;
    background: var(--net-input-bg);
}

.net-edit-results:empty {
    display: none;
}

.net-edit-result-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 8px 10px;
    border-bottom: 1px solid var(--net-border);
    cursor: pointer;
    transition: background 0.15s;
}

.net-edit-result-item:last-child {
    border-bottom: none;
}

.net-edit-result-item:hover {
    background: var(--net-primary-dim);
}

.net-edit-result-body {
    flex: 1;
    min-width: 0;
}

.net-edit-result-eng {
    font-size: 13px;
    font-weight: 600;
    color: var(--net-text);
}

.net-edit-result-zh {
    font-size: 11px;
    color: var(--net-text-muted);
    margin-top: 2px;
    line-height: 1.4;
}

.net-edit-result-quote {
    flex-shrink: 0;
    border: 1px solid rgba(109, 179, 168, 0.35);
    background: var(--net-accent-dim);
    color: var(--net-accent);
    border-radius: 14px;
    padding: 4px 10px;
    font-size: 11px;
    cursor: pointer;
}

.net-edit-result-quote:hover {
    background: rgba(109, 179, 168, 0.22);
}

.net-edit-results-empty {
    padding: 16px;
    text-align: center;
    font-size: 12px;
    color: var(--net-text-muted);
}

.net-edit-fields label {
    display: block;
    font-size: 11px;
    color: var(--net-primary);
    margin-bottom: 4px;
    opacity: 0.85;
}

.net-edit-fields label + label {
    margin-top: 10px;
}

.net-edit-eng,
.net-edit-zh {
    width: 100%;
    border: 1px solid var(--net-border-strong);
    background: var(--net-input-bg);
    color: var(--net-text-body);
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 13px;
    outline: none;
    font-family: inherit;
}

.net-edit-eng:focus,
.net-edit-zh:focus {
    border-color: rgba(126, 184, 218, 0.4);
    box-shadow: 0 0 0 2px rgba(126, 184, 218, 0.1);
}

.net-edit-zh {
    resize: vertical;
    min-height: 64px;
    line-height: 1.45;
}

.net-edit-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 12px 16px;
    border-top: 1px solid var(--net-border);
    background: rgba(28, 38, 50, 0.5);
}

.mm-play {
    cursor: pointer;
}

.mm-play .mm-play-hit {
    cursor: pointer;
}

.mm-play .mm-play-icon,
.mm-play circle:not(.mm-play-hit) {
    pointer-events: none;
}

.net-edit-play-btn {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid rgba(126, 184, 218, 0.35);
    background: rgba(90, 130, 160, 0.25);
    color: var(--net-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    font-size: 10px;
}

.net-edit-play-btn:hover {
    background: rgba(100, 150, 180, 0.4);
    color: var(--net-text);
}

.net-mobile-only {
    display: none !important;
}

.net-desktop-only {
    display: initial;
}

.net-icon-btn {
    border: 1px solid var(--net-border-strong);
    background: var(--net-surface-raised);
    color: var(--net-text-body);
    border-radius: 10px;
    width: 34px;
    height: 34px;
    padding: 0;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.net-icon-btn:hover {
    background: var(--net-primary-dim);
    border-color: rgba(126, 184, 218, 0.35);
    color: var(--net-text);
}

.net-catalog-backdrop,
.net-sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 200;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(2px);
}

.net-mobile-pick-hint {
    position: absolute;
    inset: 0;
    z-index: 5;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 24px;
    text-align: center;
    color: var(--net-text-muted);
    pointer-events: none;
}

.net-mobile-pick-hint.hidden {
    display: none;
}

.net-mobile-pick-hint i {
    font-size: 36px;
    color: var(--net-primary);
    opacity: 0.75;
}

.net-mobile-pick-hint p {
    font-size: 14px;
    line-height: 1.5;
    max-width: 240px;
}

.net-mobile-pick-hint .net-btn {
    pointer-events: auto;
}

.net-catalog-close {
    border: 1px solid var(--net-border-strong);
    background: transparent;
    color: var(--net-text-muted);
    border-radius: 8px;
    width: 28px;
    height: 28px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.net-catalog-close:hover {
    color: var(--net-text);
    background: rgba(126, 184, 218, 0.12);
}

@media (max-width: 900px) {
    :root {
        --net-topbar-h: 44px;
    }

    body.is-net-mobile {
        overflow: hidden;
    }

    .net-mobile-only {
        display: inline-flex !important;
    }

    .net-desktop-only {
        display: none !important;
    }

    .net-topbar {
        padding: 6px 10px;
        gap: 6px;
        min-height: var(--net-topbar-h);
    }

    .net-topbar h1 {
        font-size: 14px;
        flex: 1;
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        margin-right: 0;
    }

    .net-back-word {
        padding: 6px 10px;
    }

    .net-back-label {
        display: none;
    }

    .net-topbar-actions-wrap {
        display: none;
        position: fixed;
        top: calc(var(--net-topbar-h) + 6px);
        right: 10px;
        left: 10px;
        z-index: 230;
        max-width: 320px;
        margin-left: auto;
    }

    .net-topbar.is-tools-open .net-topbar-actions-wrap {
        display: block;
    }

    .net-topbar-actions-wrap .net-btn-group {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
        padding: 10px;
        border-radius: 12px;
        border: 1px solid var(--net-border-strong);
        background: rgba(32, 42, 56, 0.98);
        box-shadow: var(--net-shadow);
    }

    .net-topbar-actions-wrap .net-btn {
        width: 100%;
        justify-content: flex-start;
    }

    .net-layout {
        top: var(--net-topbar-h);
        flex-direction: row;
        --net-catalog-w: 0px;
        --net-sidebar-w: 0px;
    }

    .net-rail-toggle {
        display: none;
    }

    .net-catalog-panel {
        position: fixed;
        top: var(--net-topbar-h);
        left: 0;
        bottom: 0;
        width: min(88vw, 320px);
        max-height: none;
        z-index: 210;
        transform: translateX(-105%);
        opacity: 1;
        pointer-events: auto;
        border-right: 1px solid var(--net-border);
        border-bottom: none;
        transition: transform 0.24s ease;
    }

    .net-layout.is-catalog-open .net-catalog-panel {
        transform: translateX(0);
    }

    .net-layout.is-left-collapsed .net-catalog-panel {
        transform: translateX(-105%);
    }

    .net-catalog-backdrop {
        display: block;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.2s ease;
    }

    .net-layout.is-catalog-open .net-catalog-backdrop {
        opacity: 1;
        pointer-events: auto;
    }

    .net-sidebar {
        position: fixed;
        top: var(--net-topbar-h);
        right: 0;
        bottom: 0;
        width: min(92vw, 360px);
        max-height: none;
        z-index: 210;
        transform: translateX(105%);
        opacity: 1;
        pointer-events: auto;
        border-left: 1px solid var(--net-border);
        border-top: none;
        transition: transform 0.24s ease;
        overflow-y: auto;
    }

    .net-layout.is-sidebar-open .net-sidebar {
        transform: translateX(0);
    }

    .net-layout.is-right-collapsed .net-sidebar {
        transform: translateX(105%);
        max-height: none;
        padding-bottom: 0;
    }

    .net-sidebar-backdrop {
        display: block;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.2s ease;
    }

    .net-layout.is-sidebar-open .net-sidebar-backdrop {
        opacity: 1;
        pointer-events: auto;
    }

    .net-map-area {
        flex: 1;
        min-height: 0;
        width: 100%;
    }

    #mindmap-svg {
        touch-action: none;
    }

    .net-sidebar .net-collect-list {
        max-height: 220px;
    }

    .net-sidebar .net-history-list {
        max-height: 200px;
    }

    .net-edit-dialog {
        width: min(96vw, 480px);
        max-height: 92vh;
    }
}

.mm-img-fo {
    overflow: visible;
}

.mm-img-toggle-wrap {
    display: flex;
    justify-content: center;
}

.mm-img-toggle {
    border: 1px solid rgba(126, 184, 218, 0.28);
    background: rgba(38, 50, 66, 0.95);
    color: var(--net-text-muted);
    border-radius: 12px;
    padding: 2px 10px;
    font-size: 10px;
    cursor: pointer;
    white-space: nowrap;
    line-height: 1.4;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.mm-img-toggle:hover {
    color: var(--net-primary);
    border-color: rgba(126, 184, 218, 0.45);
    background: rgba(52, 68, 86, 0.98);
}

.mm-node-imgs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
    align-content: flex-start;
}

.mm-node-img {
    width: auto;
    height: auto;
    max-width: 200px;
    max-height: 200px;
    object-fit: contain;
    border-radius: 8px;
    border: 1px solid rgba(126, 184, 218, 0.22);
    background: rgba(0, 0, 0, 0.35);
    cursor: zoom-in;
    display: block;
    transition: border-color 0.15s, transform 0.15s;
}

.mm-node-img:hover {
    border-color: rgba(126, 184, 218, 0.55);
    transform: scale(1.02);
}

.net-edit-search-pager {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 10px;
}

.net-edit-search-pager.hidden {
    display: none;
}

.net-edit-page-btn {
    padding: 4px 10px;
    font-size: 11px;
}

.net-edit-page-info {
    font-size: 11px;
    color: var(--net-text-muted);
    min-width: 72px;
    text-align: center;
}

.net-settings-dialog {
    max-width: 420px;
    width: min(420px, 100%);
    max-height: min(88vh, 640px);
}

.net-settings-option {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 13px;
    color: var(--net-text);
    cursor: pointer;
    margin-bottom: 10px;
}

.net-settings-option input {
    margin-top: 3px;
    flex-shrink: 0;
}

.net-img-lightbox {
    position: fixed;
    inset: 0;
    z-index: 500;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.net-img-lightbox.show {
    display: flex;
}

.net-img-lightbox-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.82);
    backdrop-filter: blur(4px);
}

.net-img-lightbox img {
    position: relative;
    z-index: 1;
    max-width: min(92vw, 960px);
    max-height: 88vh;
    object-fit: contain;
    border-radius: 10px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.55);
}

.net-img-lightbox-close {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 2;
    width: 40px;
    height: 40px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.45);
    color: #fff;
    cursor: pointer;
    font-size: 16px;
}

.net-img-lightbox-close:hover {
    background: rgba(0, 0, 0, 0.65);
}
