/* 不使用 Google Fonts，避免部分地区网络阻塞导致整页样式长时间等待；图标在 index.html 中单独引用。 */

html, body {
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Liberation Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
    background-color: #0f172a; /* Dark tech background */
    color: #e2e8f0;
    height: 100%;
    min-height: 100%;
    overflow-x: hidden;
    /* 页面本身不滚动：避免“没溢出却出现滚动条/能滑动”的体验 */
    overflow-y: hidden;
}

/* 让页面使用 flex，避免 calc(100vh - 76px) 的误差导致“假溢出滚动” */
#app, .page.tech-theme {
    height: 100%;
}

.page.tech-theme {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Prefer dark native UI for form controls (where supported) */
select, input, textarea, button {
    color-scheme: dark;
}

h1:focus {
    outline: none;
}

/* Tech Theme Variables */
:root {
    --tech-primary: #0ea5e9;
    --tech-primary-glow: rgba(14, 165, 233, 0.5);
    --tech-secondary: #38bdf8;
    --tech-bg-card: rgba(30, 41, 59, 0.7);
    --tech-border: rgba(56, 189, 248, 0.2);
    --tech-text: #f8fafc;
    --tech-text-muted: #94a3b8;
    /* 侧栏固定宽；正文+广告整体在 .tech-main-gutter-wrap 内居中，广告紧贴中间内容 */
    --tech-ad-rail-width: 140px;
    --tech-main-gutter-max: 1280px;
}

/* Navbar */
.tech-navbar {
    background-color: rgba(15, 23, 42, 0.8) !important;
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--tech-border);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
    padding: 1rem 2rem;
    /* Keep nav and dropdown above page content */
    position: relative;
    z-index: 3000;
    overflow: visible;
}

.tech-navbar .container-fluid,
.tech-navbar .navbar-collapse,
.tech-navbar .navbar-nav,
.tech-navbar .nav-item {
    overflow: visible;
}

.tech-brand {
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--tech-text) !important;
    letter-spacing: 1px;
    text-shadow: 0 0 10px var(--tech-primary-glow);
}

.tech-nav-link {
    color: var(--tech-text-muted) !important;
    font-weight: 500;
    transition: all 0.3s ease;
    border-radius: 6px;
    padding: 0.5rem 1rem !important;
}

.tech-nav-link:hover, .tech-nav-link.active {
    color: var(--tech-secondary) !important;
    background-color: rgba(56, 189, 248, 0.1);
    text-shadow: 0 0 8px var(--tech-primary-glow);
}

/* Navbar dropdown use Bootstrap component */

/* Language Selector */
.tech-lang-select {
    background-color: rgba(15, 23, 42, 0.6);
    color: var(--tech-text);
    border: 1px solid var(--tech-border);
    border-radius: 6px;
    cursor: pointer;
    width: auto;
    min-width: 88px;
    max-width: 120px;
}

.tech-lang-select:focus {
    background-color: rgba(30, 41, 59, 0.9);
    color: var(--tech-text);
    border-color: var(--tech-secondary);
    box-shadow: 0 0 0 0.25rem rgba(56, 189, 248, 0.25);
}

/* Main Content Area */
.tech-main {
    min-height: 0;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

/* 内容区仅在需要时滚动（把滚动放在 article 上，避免 ::before/::after 造成“假溢出”滚动条） */
.tech-main {
    flex: 1 1 auto;
}

/* 正文滚动：含侧栏时 article 在 .tech-main-center 内；sitemap 等仍为 .tech-main 直接子节点 */
.tech-main > article.content,
.tech-main-center > article.content {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
}

/* 避免 layout 里 mt-4 造成 1-2px 的假溢出 */
.tech-main article.content {
    margin-top: 0 !important;
    padding-top: 1.5rem;
}

/* Footer */
.tech-footer {
    border-top: 1px solid var(--tech-border);
    background-color: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(12px);
}

.tech-footer .container {
    position: relative;
}

.tech-footer-left {
    color: var(--tech-text-muted);
    font-size: 0.9rem;
}

.tech-footer-center {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    color: var(--tech-text-muted);
    font-size: 0.78rem;
    opacity: 0.85;
    white-space: nowrap;
    max-width: 48%;
    overflow: hidden;
    text-overflow: ellipsis;
    pointer-events: none;
}

.tech-footer-link {
    color: var(--tech-text-muted);
    text-decoration: none;
    font-weight: 500;
}

.tech-footer-link:hover {
    color: var(--tech-secondary);
}

@media (max-width: 992px) {
    .tech-footer-center {
        position: static;
        transform: none;
        margin-top: 0.4rem;
        max-width: 100%;
        text-align: center;
    }
}

/* Background Glow Effects */
.tech-main::before {
    content: '';
    position: absolute;
    top: -10%;
    left: -10%;
    width: 40%;
    height: 40%;
    background: radial-gradient(circle, rgba(14, 165, 233, 0.15) 0%, transparent 70%);
    z-index: -1;
    pointer-events: none;
}

.tech-main::after {
    content: '';
    position: absolute;
    bottom: -10%;
    right: -10%;
    width: 40%;
    height: 40%;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.1) 0%, transparent 70%);
    z-index: -1;
    pointer-events: none;
}

/* 正文+侧栏整体居中，避免广告贴在视口最左与中间大块留白；不产生页面横向滚动 */
.tech-main-gutter-wrap {
    flex: 1 1 auto;
    min-height: 0;
    min-width: 0;
    width: 100%;
    max-width: var(--tech-main-gutter-max);
    margin-left: auto;
    margin-right: auto;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
}

.tech-main-with-rails {
    flex: 1 1 auto;
    min-height: 0;
    min-width: 0;
    display: flex;
    flex-direction: row;
    align-items: stretch;
    box-sizing: border-box;
    width: 100%;
}

.tech-main-center {
    flex: 1 1 auto;
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.tech-ad-rail {
    box-sizing: border-box;
    flex: 0 0 var(--tech-ad-rail-width);
    width: var(--tech-ad-rail-width);
    max-width: var(--tech-ad-rail-width);
    min-width: var(--tech-ad-rail-width);
    min-height: 0;
    flex-shrink: 0;
    padding: 0.5rem 0.25rem;
}

.tech-ad-rail-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    position: sticky;
    top: 0.75rem;
    width: 100%;
    max-width: var(--tech-ad-rail-width);
    max-height: calc(100vh - 5.5rem);
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
}

/* 移动端：广告栏与正文之间的可点条（叠在广告栏右缘，避免 iframe/滚动条抢走点击） */
@media (max-width: 992px) {
    .tech-main-with-rails {
        position: relative;
    }

    /* 内层保持完整栏宽，收起时由 aside overflow 裁切；避免 width:100% 随侧栏压窄把广告「收没」 */
    /* 裁掉广告横向溢出；用 clip 避免 hidden+visible 组合把 aside 变成滚动容器、弄坏 sticky */
    .tech-ad-rail-left {
        padding-left: 0;
        padding-right: 0;
        overflow-x: clip;
    }

    .tech-ad-rail-left .tech-ad-rail-inner {
        width: var(--tech-ad-rail-width);
        min-width: var(--tech-ad-rail-width);
        max-width: var(--tech-ad-rail-width);
    }

    @supports not (overflow: clip) {
        .tech-ad-rail-left {
            overflow-x: hidden;
        }
    }

    .tech-ad-rail-splitter {
        display: flex;
        flex: 0 0 36px;
        width: 36px;
        min-width: 36px;
        flex-shrink: 0;
        align-self: stretch;
        min-height: 0;
        /* 向左叠在广告栏右侧（含滚动条区域），保证点到的是切换条而非广告 */
        margin-left: -22px;
        margin-right: 0;
        padding: 0;
        border: none;
        border-radius: 0;
        box-sizing: border-box;
        cursor: pointer;
        touch-action: manipulation;
        -webkit-tap-highlight-color: transparent;
        position: relative;
        z-index: 4500;
        pointer-events: auto;
        background-color: transparent;
        /* 展开态：提示向左收起；收起态：提示向右展开（PNG 视觉与文件名可能不一致，已与反馈对调） */
        background-image: url('../images/ad-rail-chevron-right.png');
        background-repeat: no-repeat;
        background-position: center center;
        background-size: 22px auto;
        box-shadow: none;
    }

    .tech-main-with-rails.tech-ad-left-collapsed-mobile .tech-ad-rail-splitter {
        background-image: url('../images/ad-rail-chevron-left.png');
    }

    .tech-ad-rail-splitter:focus-visible {
        outline: 2px solid var(--tech-secondary);
        outline-offset: -1px;
    }

    .tech-ad-rail-left,
    .tech-ad-rail-left .tech-ad-rail-inner {
        transition: flex-basis 0.28s ease, width 0.28s ease, min-width 0.28s ease, max-width 0.28s ease, transform 0.28s ease, padding 0.28s ease;
    }

    /* 收起后露出约 20% 栏宽（在原先 10% 基础上再加一成），且不少于 28px */
    .tech-main-with-rails.tech-ad-left-collapsed-mobile {
        --tech-ad-rail-collapsed-slip: max(calc(var(--tech-ad-rail-width) * 0.2), 28px);
    }

    .tech-main-with-rails.tech-ad-left-collapsed-mobile .tech-ad-rail-left {
        flex: 0 0 var(--tech-ad-rail-collapsed-slip);
        width: var(--tech-ad-rail-collapsed-slip);
        max-width: var(--tech-ad-rail-collapsed-slip);
        min-width: var(--tech-ad-rail-collapsed-slip);
        overflow: hidden;
        padding-left: 0;
        padding-right: 0;
    }

    .tech-main-with-rails.tech-ad-left-collapsed-mobile .tech-ad-rail-left .tech-ad-rail-inner {
        width: var(--tech-ad-rail-width);
        min-width: var(--tech-ad-rail-width);
        max-width: var(--tech-ad-rail-width);
        transform: translateX(calc(var(--tech-ad-rail-collapsed-slip) - var(--tech-ad-rail-width)));
    }
}

@media (min-width: 993px) {
    .tech-ad-rail-splitter {
        display: none !important;
    }
}

/* Page Components */
.tech-title {
    font-weight: 700;
    font-size: 2.5rem;
    background: linear-gradient(to right, #38bdf8, #818cf8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
    outline: none;
    border: none;
}

.tech-title:focus {
    outline: none;
    border: none;
}

.tech-subtitle {
    color: var(--tech-text-muted);
    font-size: 1.1rem;
}

/* Glassmorphism Card */
.tech-card {
    background: var(--tech-bg-card);
    backdrop-filter: blur(16px);
    border: 1px solid var(--tech-border);
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.tech-card:hover {
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 0 20px rgba(14, 165, 233, 0.1);
}

/* Thai / JP ruby previews: Latin or romaji above base text */
.form-control.tech-thai-ruby-wrap {
    font-size: 1.22rem;
    line-height: 2.35;
    white-space: normal;
    word-break: break-word;
    overflow-wrap: anywhere;
    min-height: 6.5rem;
    padding: 0.85rem 1.1rem;
}

.tech-thai-ruby {
    font-size: inherit;
    ruby-position: over;
    ruby-align: center;
}

.tech-thai-ruby rt {
    font-size: 0.74em;
    font-weight: 500;
    color: var(--tech-text-muted);
    letter-spacing: 0.02em;
    user-select: text;
}

.tech-thai-ruby--block rt {
    font-size: 0.68em;
}

/* Home: tool index cards */
.home-tool-link {
    color: inherit;
}

.home-tool-link:hover .tech-text {
    color: var(--tech-secondary);
}

.home-group-desc {
    line-height: 1.65;
    max-width: 72rem;
}

.home-tool-card {
    transition: border-color 0.2s ease, transform 0.15s ease;
}

.home-tool-link:hover .home-tool-card {
    border-color: var(--tech-secondary);
    transform: translateY(-2px);
}

.home-tool-icon {
    width: 2.75rem;
    height: 2.75rem;
    background: rgba(14, 165, 233, 0.15);
    color: var(--tech-secondary);
    font-size: 1.35rem;
}

.home-tool-copy {
    min-width: 0;
    flex: 1 1 auto;
}

/* Unit converter: category pills */
.unit-cat-nav .nav-link {
    white-space: nowrap;
    color: var(--tech-text-muted);
    border-radius: 8px;
    font-size: 0.9rem;
}

.unit-cat-nav .nav-link:hover {
    color: var(--tech-text);
    background-color: rgba(56, 189, 248, 0.12);
}

.unit-cat-nav .nav-link.active {
    background: linear-gradient(135deg, #0ea5e9 0%, #3b82f6 100%);
    color: #fff;
    box-shadow: 0 0 12px rgba(14, 165, 233, 0.35);
}

/* Form Elements */
.tech-label {
    color: var(--tech-text);
    font-weight: 500;
    letter-spacing: 0.5px;
}

.tech-text {
    color: var(--tech-text);
}

/* 声明一行显示：父级不换行 + 本节点不收缩（flex 子项默认 shrink 会把文字挤换行） */
.tech-navbar-right {
    flex-wrap: nowrap;
}

.tech-navbar-lang {
    margin-left: 0.75rem;
}

.tech-privacy-note {
    flex: 0 0 auto;
    min-width: max-content;
    white-space: nowrap !important;
    word-break: keep-all;
}

@media (max-width: 1366px) {
    .tech-navbar {
        padding: 0.75rem 1rem;
    }

    .tech-brand {
        font-size: 1.2rem;
    }

    .tech-nav-link {
        font-size: 0.9rem;
        padding: 0.45rem 0.6rem !important;
    }
}

@media (max-width: 992px) {
    .tech-navbar-lang .bi-globe {
        display: none;
    }
}

.tech-input, .tech-select {
    background-color: rgba(15, 23, 42, 0.5);
    border: 1px solid var(--tech-border);
    color: var(--tech-text);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    transition: all 0.3s ease;
}

.tech-select option,
.tech-lang-select option {
    background-color: #0f172a;
    color: var(--tech-text);
}

.tech-select optgroup,
.tech-lang-select optgroup {
    background-color: #0f172a;
    color: var(--tech-text);
}

/* 下拉与主题一致：优先使用 Components/TechDropdownSelect（与音频「目标格式」同款，自定义深色列表）。
   若页面仍用原生 <select>，弹出层在部分系统上由浏览器/OS 绘制，以下作暗色兜底（无法 100% 统一）。 */
select.form-select.tech-input,
select.form-select.tech-lang-select,
select.tech-lang-select {
    color-scheme: dark;
}

/* Bootstrap dropdown menus (if used anywhere) */
.dropdown-menu {
    background-color: rgba(15, 23, 42, 0.95);
    border: 1px solid var(--tech-border);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
    /* Ensure menu is clickable above navbar layers */
    z-index: 5000 !important;
    pointer-events: auto;
    overflow: visible;
}

.dropdown-item {
    color: var(--tech-text);
    position: relative;
    z-index: 2001;
}

.dropdown-item:hover,
.dropdown-item:focus {
    color: var(--tech-secondary);
    background-color: rgba(56, 189, 248, 0.12);
}

.dropdown-divider {
    border-top-color: var(--tech-border);
}

/* Tech dropdown select (custom, non-native select) */
.tech-dropdown {
    width: 100%;
}

.tech-dropdown-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.35rem;
    min-width: 0;
}

.tech-dropdown-text {
    flex: 1 1 auto;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: start;
}

.tech-dropdown-menu {
    width: 100%;
    padding: 0.25rem;
    border-radius: 10px;
}

.tech-dropdown-item {
    border-radius: 8px;
    padding: 0.6rem 0.75rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.tech-dropdown-item.active {
    background-color: rgba(56, 189, 248, 0.16);
    color: var(--tech-secondary);
}

/* 与音频「目标格式」一致但取消列表项悬停/选中变色（加密页等） */
.tech-dropdown--static .dropdown-item.tech-dropdown-item:hover,
.tech-dropdown--static .dropdown-item.tech-dropdown-item:focus,
.tech-dropdown--static .dropdown-item.tech-dropdown-item:focus-visible {
    color: var(--tech-text) !important;
    background-color: transparent !important;
}

.tech-dropdown--static .dropdown-item.tech-dropdown-item.active {
    color: var(--tech-text) !important;
    background-color: transparent !important;
    font-weight: 600;
}

/* 静态模式：触发按钮保持与默认态一致，聚焦无青边/光晕变色 */
.tech-dropdown--static .tech-dropdown-btn.tech-select:focus,
.tech-dropdown--static .tech-dropdown-btn.tech-select:focus-visible {
    background-color: rgba(15, 23, 42, 0.5);
    border-color: var(--tech-border);
    color: var(--tech-text);
    box-shadow: none;
}

.tech-dropdown-caret {
    flex-shrink: 0;
    opacity: 0.7;
}

.tech-input-group-text {
    background-color: rgba(14, 165, 233, 0.2);
    color: var(--tech-text);
    border: 1px solid var(--tech-border);
    border-right: none;
}

.tech-input:focus, .tech-select:focus {
    background-color: rgba(15, 23, 42, 0.8);
    color: var(--tech-text);
    border-color: var(--tech-secondary);
    box-shadow: 0 0 0 0.25rem rgba(56, 189, 248, 0.25), 0 0 10px rgba(56, 189, 248, 0.2);
}

/* Custom File Input Styling for Multi-language support */
.tech-file-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    background-color: rgba(15, 23, 42, 0.5);
    border: 1px solid var(--tech-border);
    border-radius: 8px;
    transition: all 0.3s ease;
    overflow: hidden;
}

.tech-file-wrapper:focus-within {
    border-color: var(--tech-secondary);
    box-shadow: 0 0 0 0.25rem rgba(56, 189, 248, 0.25), 0 0 10px rgba(56, 189, 248, 0.2);
}

.tech-file-input {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 2;
}

.tech-file-btn {
    background-color: var(--tech-primary);
    color: white;
    padding: 0.75rem 1.5rem;
    font-weight: 500;
    border-right: 1px solid var(--tech-border);
    z-index: 1;
    transition: all 0.3s ease;
    flex-shrink: 0;
    white-space: nowrap;
}

.tech-file-wrapper:hover .tech-file-btn {
    background-color: var(--tech-secondary);
    box-shadow: 0 0 10px var(--tech-primary-glow);
}

.tech-file-name {
    padding: 0.75rem 1rem;
    color: var(--tech-text-muted);
    flex-grow: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    z-index: 1;
}

.tech-file-name.has-file {
    color: var(--tech-text);
}

/* ICO crop: selection overlay ignores pointer so host receives drag/wheel with correct offsets */
.ico-crop-host {
    position: relative;
    display: inline-block;
    max-width: 100%;
    vertical-align: top;
}

.ico-crop-host img {
    display: block;
    max-width: 100%;
    max-height: 65vh;
    border-radius: 8px;
    pointer-events: none;
    user-select: none;
}

.ico-crop-sel {
    position: absolute;
    border: 2px solid #38bdf8;
    pointer-events: none;
    box-sizing: border-box;
    z-index: 2;
}

/* Buttons */
.tech-btn-primary {
    background: linear-gradient(135deg, #0ea5e9 0%, #3b82f6 100%);
    border: none;
    color: white;
    font-weight: 600;
    letter-spacing: 1px;
    border-radius: 8px;
    padding: 0.75rem 1.5rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(14, 165, 233, 0.3);
}

.tech-btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(14, 165, 233, 0.5);
    background: linear-gradient(135deg, #38bdf8 0%, #60a5fa 100%);
}

.tech-btn-primary:disabled {
    background: #475569;
    color: #94a3b8;
    box-shadow: none;
    cursor: not-allowed;
}

/* Alerts */
.tech-alert-success {
    background-color: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #34d399;
    border-radius: 8px;
}

.tech-inline-success {
    color: #34d399;
    font-weight: 600;
    font-size: 0.95rem;
}

.tech-alert-danger {
    background-color: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #f87171;
    border-radius: 8px;
}

/* Page usage guide (bottom) */
.other-tools-desc {
    white-space: pre-wrap;
    word-break: break-word;
    max-width: 36rem;
}

.tech-usage-section {
    margin-top: 2rem;
    padding: 1.25rem 1.5rem;
    background: rgba(30, 41, 59, 0.45);
    border: 1px solid var(--tech-border);
    border-radius: 12px;
    border-left: 4px solid var(--tech-primary);
}

/* JSON tool output */
.tech-json-output {
    margin-top: 0.25rem;
    background-color: rgba(15, 23, 42, 0.5);
    border: 1px solid var(--tech-border);
    border-radius: 10px;
    padding: 0.75rem 0.9rem;
    max-height: 360px;
    overflow: auto;
}

.tech-json-output-pre {
    margin: 0;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    color: var(--tech-text);
    font-size: 0.9rem;
    white-space: pre;
    word-break: break-word;
}

.tech-json-output--small {
    max-height: 180px !important;
}

/* Simple panels for two-layer tools */
.tech-subpanel {
    background-color: rgba(15, 23, 42, 0.35);
    border: 1px solid var(--tech-border);
    border-radius: 12px;
    padding: 1rem;
}

.tech-subpanel-title {
    font-weight: 700;
    color: var(--tech-secondary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}

.tech-subpanel-label {
    font-weight: 700;
    color: var(--tech-text-muted);
    margin-bottom: 0.5rem;
}

.tech-two-tabs {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    align-items: center;
}

.tech-text-muted {
    color: var(--tech-text-muted);
}

/* Isolate gestures from scrolling parent (article.content overflow-y: auto on mobile). */
.tech-nine-grid-interactive-host {
    position: relative;
    z-index: 2;
    touch-action: none;
    overscroll-behavior: contain;
    isolation: isolate;
}

.tech-nine-grid-preview {
    max-width: 480px;
    margin-left: auto;
    margin-right: auto;
    touch-action: none;
    overscroll-behavior: contain;
}

.tech-nine-grid-canvas {
    display: block;
    border-radius: 12px;
    border: 1px solid var(--tech-border);
    background: rgba(15, 23, 42, 0.4);
    cursor: grab;
    touch-action: none;
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
}

.tech-nine-grid-canvas:active {
    cursor: grabbing;
}

.tech-nine-grid-sliders .form-range {
    width: 100%;
}

.tech-sql-er-host {
    background-color: rgba(15, 23, 42, 0.35);
    border-color: var(--tech-border) !important;
    min-height: 120px;
    overflow-x: auto;
}

.tech-sql-er-host svg {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
}

.tech-m3u8-video {
    max-height: min(70vh, 720px);
    background-color: #000;
    object-fit: contain;
}

/* JSON tree */
.json-tree-wrap {
    background-color: rgba(15, 23, 42, 0.35);
    border: 1px solid var(--tech-border);
    border-radius: 10px;
    padding: 0.75rem 0.9rem;
    max-height: 360px;
    overflow: auto;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 0.9rem;
}

.json-tree-node {
    line-height: 1.45;
    margin: 2px 0;
    color: var(--tech-text);
    font-family: inherit;
    font-size: inherit;
}

.json-tree-details {
    margin: 0;
}

.json-tree-summary {
    cursor: pointer;
    list-style: none;
    user-select: none;
    display: flex;
    align-items: center;
    gap: 0.45rem;
    font-family: inherit;
    font-size: inherit;
}

.json-tree-summary::-webkit-details-marker {
    display: none;
}

.json-tree-summary::before {
    content: "▸";
    color: var(--tech-secondary);
    font-size: 0.85rem;
}

.json-tree-details[open] .json-tree-summary::before {
    content: "▾";
}

.json-tree-label {
    color: var(--tech-text-muted);
    font-weight: 600;
    font-family: inherit;
}

.json-tree-type {
    color: var(--tech-secondary);
    font-weight: 600;
    opacity: 0.95;
    font-family: inherit;
}

.json-tree-punct {
    color: var(--tech-text-muted);
    font-family: inherit;
}

.json-tree-value {
    color: var(--tech-text);
    font-family: inherit;
}

.tech-usage-heading {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--tech-secondary);
    margin-bottom: 0.85rem;
}

.tech-usage-steps {
    margin: 0;
    padding-left: 1.35rem;
    color: var(--tech-text-muted);
    font-size: 0.9rem;
    line-height: 1.65;
}

.tech-usage-steps li {
    margin-bottom: 0.5rem;
}

.tech-usage-steps li:last-child {
    margin-bottom: 0;
}

.tech-guide-accordion .accordion-item {
    border: 1px solid var(--tech-border);
    background: #fffaf3;
}

.tech-guide-accordion .accordion-button {
    background: #fff3e2;
    color: var(--tech-text);
    font-weight: 600;
    box-shadow: none !important;
}

.tech-guide-accordion .accordion-button:not(.collapsed) {
    background: #ffe9cd;
    color: #8f4a16;
}

.tech-guide-accordion .accordion-button:focus {
    box-shadow: 0 0 0 0.2rem rgba(245, 158, 11, 0.16) !important;
}

.tech-guide-accordion .accordion-body {
    color: var(--tech-text);
    line-height: 1.72;
}

.tech-faq-list {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.tech-faq-item {
    background: #fff8ec;
    border: 1px solid #f2e2ca;
    border-radius: 0.6rem;
    padding: 0.6rem 0.75rem;
}

.tech-faq-item summary {
    cursor: pointer;
    font-weight: 600;
    color: #8f4a16;
}

/* Crypto tool tab bar：无位移动效，仅颜色变化 + 轻微按下色 */
.tech-crypto-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    align-items: center;
}

/* 加密页：成功提示在「复制输出」或操作按钮同一行右侧 */
.tech-crypto-hint-row .tech-inline-success {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 0.95rem;
}

.tech-crypto-tabs .btn {
    border-radius: 8px;
    font-weight: 500;
    transition: none !important;
    transform: none !important;
    box-shadow: none !important;
}

.tech-crypto-tabs .btn:hover:not(:disabled),
.tech-crypto-tabs .btn:focus-visible:not(:disabled) {
    transform: none !important;
    box-shadow: none !important;
}

.tech-crypto-tabs .btn.tech-btn-primary {
    background: #0ea5e9;
    border: 1px solid rgba(56, 189, 248, 0.45);
    color: #fff;
    letter-spacing: 0.02em;
}

.tech-crypto-tabs .btn.tech-btn-primary:hover:not(:disabled) {
    background: #0284c7;
    border-color: rgba(56, 189, 248, 0.55);
}

.tech-crypto-tabs .btn.tech-btn-primary:active:not(:disabled) {
    background: #0369a1;
    border-color: rgba(14, 165, 233, 0.6);
}

.tech-crypto-tabs .btn.btn-outline-secondary {
    border-color: rgba(148, 163, 184, 0.45);
    color: var(--tech-text-muted);
    background: transparent;
}

.tech-crypto-tabs .btn.btn-outline-secondary:hover:not(:disabled) {
    background: rgba(56, 189, 248, 0.12);
    border-color: rgba(56, 189, 248, 0.4);
    color: var(--tech-secondary);
}

.tech-crypto-tabs .btn.btn-outline-secondary:active:not(:disabled) {
    background: rgba(56, 189, 248, 0.22);
    border-color: rgba(56, 189, 248, 0.55);
    color: var(--tech-text);
}

/* Word count result tables */
.tech-wordcount-results {
    margin-top: 1.75rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--tech-border);
    display: flex;
    flex-direction: column;
    gap: 1.75rem;
}

.tech-wordcount-section {
    margin: 0;
}

.tech-wordcount-section-heading {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--tech-secondary);
    letter-spacing: 0.02em;
    margin: 0 0 0.65rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding-left: 0.35rem;
    border-left: 3px solid var(--tech-primary);
    line-height: 1.35;
}

.tech-wordcount-section-heading--filtered {
    border-left-color: #a78bfa;
    color: #c4b5fd;
}

.tech-wordcount-section-hint {
    font-size: 0.875rem;
    color: var(--tech-text-muted);
    margin: -0.25rem 0 0.75rem 0;
    line-height: 1.5;
    padding-left: 0.5rem;
}

.tech-wordcount-panel {
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid var(--tech-border);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.tech-wordcount-panel--filtered {
    border-color: rgba(167, 139, 250, 0.35);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.04),
        0 0 0 1px rgba(167, 139, 250, 0.08);
}

.tech-wordcount-table {
    --tech-wc-cell-y: 0.7rem;
    --tech-wc-cell-x: 1rem;
    /* 覆盖 Bootstrap 默认浅色表底，避免整块纯白 */
    --bs-table-bg: transparent;
    --bs-table-accent-bg: rgba(255, 255, 255, 0.2);
    --bs-table-hover-color: var(--tech-text);
    margin-bottom: 0;
    color: var(--tech-text);
    table-layout: fixed;
    background-color: transparent !important;
}

.tech-wordcount-table > :not(caption) > * > * {
    background-color: transparent;
    box-shadow: none;
    color: inherit;
}

.tech-wordcount-table thead th {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--tech-text-muted);
    font-weight: 600;
    border-bottom: 1px solid var(--tech-border);
    /* 约 20% 白透明叠在深色上，不用实色白底 */
    background: linear-gradient(
        180deg,
        rgba(255, 255, 255, 0.2) 0%,
        rgba(14, 165, 233, 0.12) 100%
    ) !important;
    padding: 0.55rem var(--tech-wc-cell-x);
    vertical-align: middle;
}

.tech-wordcount-panel--filtered .tech-wordcount-table thead th {
    background: linear-gradient(
        180deg,
        rgba(255, 255, 255, 0.2) 0%,
        rgba(167, 139, 250, 0.14) 100%
    ) !important;
}

.tech-wordcount-table tbody th {
    font-weight: 500;
    color: var(--tech-text-muted);
    padding: var(--tech-wc-cell-y) var(--tech-wc-cell-x);
    border-bottom: 1px solid rgba(56, 189, 248, 0.1);
    width: 58%;
    vertical-align: middle;
    line-height: 1.45;
    background-color: transparent !important;
}

.tech-wordcount-table tbody td {
    padding: var(--tech-wc-cell-y) var(--tech-wc-cell-x);
    border-bottom: 1px solid rgba(56, 189, 248, 0.1);
    text-align: end;
    vertical-align: middle;
    background-color: transparent !important;
}

.tech-wordcount-panel--filtered .tech-wordcount-table tbody th,
.tech-wordcount-panel--filtered .tech-wordcount-table tbody td {
    border-bottom-color: rgba(167, 139, 250, 0.12);
}

.tech-wordcount-table tbody tr:nth-child(even) th,
.tech-wordcount-table tbody tr:nth-child(even) td {
    background-color: rgba(255, 255, 255, 0.2) !important;
}

.tech-wordcount-table tbody tr:hover th,
.tech-wordcount-table tbody tr:hover td {
    background-color: rgba(14, 165, 233, 0.18) !important;
}

.tech-wordcount-panel--filtered .tech-wordcount-table tbody tr:hover th,
.tech-wordcount-panel--filtered .tech-wordcount-table tbody tr:hover td {
    background-color: rgba(167, 139, 250, 0.22) !important;
}

.tech-wordcount-table tbody tr:last-child th,
.tech-wordcount-table tbody tr:last-child td {
    border-bottom: none;
}

.tech-wordcount-value {
    display: inline-block;
    min-width: 2.5rem;
    padding: 0.2rem 0.65rem;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 1rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    color: var(--tech-text);
    background: rgba(14, 165, 233, 0.12);
    border: 1px solid rgba(56, 189, 248, 0.25);
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset;
}

.tech-wordcount-panel--filtered .tech-wordcount-value {
    background: rgba(167, 139, 250, 0.14);
    border-color: rgba(167, 139, 250, 0.35);
}

/* Global toast (techToast.show) — bottom-right bubbles */
.tech-toast-stack {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    z-index: 10800;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: flex-end;
    pointer-events: none;
    max-width: min(22rem, calc(100vw - 2rem));
}

.tech-toast {
    pointer-events: auto;
    padding: 0.75rem 1rem;
    border-radius: 0.75rem;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
    font-size: 0.9rem;
    line-height: 1.45;
    max-height: min(40vh, 16rem);
    overflow-y: auto;
    word-break: break-word;
    opacity: 0;
    transform: translateY(10px) scale(0.98);
    transition: opacity 0.28s ease, transform 0.28s ease;
}

.tech-toast--visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.tech-toast--success {
    background: linear-gradient(145deg, #15803d 0%, #166534 100%);
    color: #ecfdf5;
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.tech-toast--error {
    background: linear-gradient(145deg, #b91c1c 0%, #7f1d1d 100%);
    color: #fef2f2;
    border: 1px solid rgba(255, 255, 255, 0.12);
}

/* Long image stitch — + on image edge midpoints, no corner hole boxes */
.long-stitch-grid--layout {
    display: grid;
    grid-template-columns: repeat(var(--cols, 1), auto);
    gap: var(--gap, 8px);
    justify-content: center;
    align-items: start;
    overflow: visible;
    padding: 1.25rem;
    margin: -0.5rem;
}

.long-stitch-grid--layout .long-stitch-cell {
    overflow: visible;
    min-width: 0;
    line-height: 0;
}

.long-stitch-grid--single {
    justify-content: center;
}

.long-stitch-grid--empty {
    min-height: 8rem;
}

.long-stitch-add--initial {
    width: 120px;
    height: 120px;
    cursor: pointer;
}

.long-stitch-image-cell {
    position: relative;
    display: block;
    line-height: 0;
}

.long-stitch-replace-label {
    display: inline-block;
    cursor: pointer;
}

.long-stitch-action-btn {
    position: absolute;
    z-index: 4;
    border-radius: 0.5rem;
    padding: 0.15rem 0.45rem;
    line-height: 1.2;
}

.long-stitch-action-btn--replace {
    top: 0.35rem;
    right: 0.35rem;
}

.long-stitch-action-btn--remove {
    right: 0.35rem;
    bottom: 0.35rem;
}

.long-stitch-img {
    vertical-align: middle;
}

.long-stitch-add-edge {
    position: absolute;
    z-index: 3;
    width: 2.25rem;
    height: 2.25rem;
    min-width: 2.25rem;
    min-height: 2.25rem;
    padding: 0 !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    cursor: pointer;
    line-height: 1;
    user-select: none;
}

.long-stitch-add-edge-icon {
    font-size: 1.35rem;
    font-weight: 600;
    line-height: 1;
}

.long-stitch-add-edge--top {
    top: 0;
    left: 50%;
    transform: translate(-50%, -50%);
}

.long-stitch-add-edge--bottom {
    bottom: 0;
    left: 50%;
    transform: translate(-50%, 50%);
}

.long-stitch-add-edge--left {
    left: 0;
    top: 50%;
    transform: translate(-50%, -50%);
}

.long-stitch-add-edge--right {
    right: 0;
    top: 50%;
    transform: translate(50%, -50%);
}

/* L 形等布局中 bbox 内未放图的位置：仅占位，不显示线框 */
.long-stitch-bbox-hole {
    visibility: hidden;
    min-height: 1px;
    width: 100%;
    pointer-events: none;
}

/* Disable button motion/transition when requested */
.no-anim-btn,
.no-anim-btn:hover,
.no-anim-btn:focus,
.no-anim-btn:active {
    transition: none !important;
    animation: none !important;
    transform: none !important;
}

.regex-example-groups {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0.75rem;
}

.regex-example-group {
    border: 1px solid rgba(56, 189, 248, 0.22);
    border-radius: 0.65rem;
    background: rgba(15, 23, 42, 0.35);
    padding: 0.6rem 0.65rem;
}

.regex-example-group-title {
    font-size: 0.85rem;
    color: #7dd3fc;
    letter-spacing: 0.02em;
    font-weight: 600;
}

.regex-example-chip {
    border-radius: 999px;
}

.drawing-board-wrap {
    width: 100%;
    overflow: auto;
    background: rgba(15, 23, 42, 0.35);
    border-radius: 0.6rem;
    padding: 0.5rem;
}

.drawing-board-canvas {
    display: block;
    width: 100%;
    max-width: 1200px;
    background: #ffffff;
    cursor: crosshair;
}

.markdown-preview {
    min-height: 28rem;
    max-height: 42rem;
    overflow: auto;
    background: rgba(15, 23, 42, 0.55);
}

.markdown-preview h1,
.markdown-preview h2,
.markdown-preview h3 {
    margin-top: 1.1rem;
}

.markdown-preview pre {
    background: rgba(2, 8, 23, 0.7);
    border: 1px solid rgba(56, 189, 248, 0.2);
    border-radius: 0.5rem;
    padding: 0.75rem;
}

.markdown-cheatsheet table th,
.markdown-cheatsheet table td {
    text-align: left !important;
    vertical-align: top;
}

.cron-builder-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0.75rem;
}

/* Blazor defaults overrides */
#blazor-error-ui {
    background: #7f1d1d;
    color: white;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.5);
}

/* Warm light theme overrides */
:root {
    --tech-primary: #d97706;
    --tech-primary-glow: rgba(217, 119, 6, 0.28);
    --tech-secondary: #ea580c;
    --tech-bg-card: #fffaf2;
    --tech-border: #ecdcc8;
    --tech-text: #3f3229;
    --tech-text-muted: #7d6b5f;
}

html, body {
    background-color: #fff8ee;
    color: var(--tech-text);
}

select, input, textarea, button {
    color-scheme: light;
}

.tech-navbar {
    background-color: rgba(255, 250, 242, 0.94) !important;
    border-bottom: 1px solid #eedfcd;
    box-shadow: 0 8px 28px rgba(166, 124, 82, 0.12);
}

.tech-brand {
    color: #8b4513 !important;
    text-shadow: none;
}

.tech-nav-link {
    color: #5b4636 !important;
    font-weight: 600;
}

.tech-nav-link:hover,
.tech-nav-link.active {
    color: #8f3f11 !important;
    background-color: #ffe7c7;
    text-shadow: none;
}

.tech-lang-select,
.tech-input,
.tech-select,
.tech-file-wrapper {
    background-color: #fffdf8;
    color: var(--tech-text);
    border-color: var(--tech-border);
}

.tech-main::before {
    background: radial-gradient(circle, rgba(252, 211, 153, 0.24) 0%, transparent 70%);
}

.tech-main::after {
    background: radial-gradient(circle, rgba(251, 191, 142, 0.2) 0%, transparent 72%);
}

.tech-title {
    background: linear-gradient(to right, #c2410c, #d97706);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.tech-card {
    background: var(--tech-bg-card);
    border: 1px solid var(--tech-border);
    box-shadow: 0 10px 28px rgba(184, 146, 108, 0.12);
}

.tech-card:hover {
    box-shadow: 0 14px 34px rgba(184, 146, 108, 0.18);
}

.home-tool-icon {
    background: #ffedd5;
    color: #c2410c;
}

.dropdown-menu {
    background-color: #fffaf3;
    border-color: var(--tech-border);
    box-shadow: 0 10px 28px rgba(166, 124, 82, 0.16);
}

.dropdown-item {
    color: #4f3a2a;
}

.dropdown-item:hover,
.dropdown-item:focus {
    background-color: #ffe4bf;
    color: #7a340d;
}

.tech-navbar .bi {
    color: #7a5537 !important;
}

/* 浅色暖色导航栏上：navbar-dark 默认仍是浅色汉堡线，对比度不足 */
.tech-navbar .navbar-toggler {
    border: 1px solid rgba(139, 69, 19, 0.45);
    background-color: rgba(255, 253, 248, 0.98);
}

.tech-navbar .navbar-toggler:hover {
    border-color: rgba(139, 69, 19, 0.65);
    background-color: #fff5e6;
}

.tech-navbar .navbar-toggler:focus {
    box-shadow: 0 0 0 0.2rem rgba(217, 119, 6, 0.28);
}

.tech-navbar .navbar-toggler-icon {
    width: 1.35em;
    height: 1.35em;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28139, 69, 19, 0.98%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2.5' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

.tech-footer {
    background-color: #fff5e8;
    border-top: 1px solid #eddcc7;
}

.tech-footer-link {
    color: #8a6f59;
}

.tech-footer-link:hover {
    color: #c05621;
}

.tech-btn-primary {
    background: linear-gradient(135deg, #ea580c 0%, #d97706 100%);
    box-shadow: 0 6px 18px rgba(217, 119, 6, 0.26);
}

.tech-btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
    box-shadow: 0 9px 22px rgba(217, 119, 6, 0.34);
}

.tech-input:focus,
.tech-select:focus,
.tech-lang-select:focus,
.tech-file-wrapper:focus-within {
    border-color: #f59e0b;
    box-shadow: 0 0 0 0.2rem rgba(245, 158, 11, 0.18);
    background-color: #fffdf8;
    color: var(--tech-text);
}

.tech-usage-section,
.tech-subpanel,
.tech-json-output,
.json-tree-wrap,
.markdown-preview,
.drawing-board-wrap,
.regex-example-group,
.tech-wordcount-panel {
    background-color: #fffaf3 !important;
    border-color: var(--tech-border) !important;
    color: var(--tech-text);
}

.tech-breadcrumb-wrap {
    padding-top: 1rem;
    padding-bottom: 0.15rem;
}

.tech-breadcrumb-nav {
    display: inline-flex;
    padding: 0.4rem 0.8rem;
    border-radius: 999px;
    background: #fff3e2;
    border: 1px solid #f3dcc0;
}

.tech-breadcrumb-nav .breadcrumb {
    font-size: 0.88rem;
}

.tech-breadcrumb-nav .breadcrumb-item,
.tech-breadcrumb-nav .breadcrumb-item.active {
    color: #8b6a4d;
}

.tech-breadcrumb-nav .breadcrumb-item + .breadcrumb-item::before {
    color: #c4a585;
}

.tech-breadcrumb-nav a {
    color: #b45309;
    text-decoration: none;
}

.tech-breadcrumb-nav a:hover {
    color: #c2410c;
    text-decoration: underline;
}

/* Crawler-visible index in wwwroot/index.html (#app shell) until Blazor replaces it */
.static-prerender-tool-index {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1rem 2rem;
    border-top: 1px solid rgba(148, 163, 184, 0.25);
    padding-top: 1.25rem;
}

.static-prerender-tool-index-lead {
    font-size: 0.875rem;
    color: var(--tech-text-muted, #94a3b8);
}

.static-prerender-tool-index-h3 {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--tech-secondary, #38bdf8);
    margin-bottom: 0.5rem;
}

.static-prerender-tool-index-ul {
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 0.875rem;
    line-height: 1.45;
}

.static-prerender-tool-index-ul li {
    margin-bottom: 0.25rem;
}

.static-prerender-tool-index-ul a {
    color: #cbd5e1;
    text-decoration: none;
}

.static-prerender-tool-index-ul a:hover {
    text-decoration: underline;
    color: var(--tech-secondary, #38bdf8);
}

.static-prerender-tool-index-ul-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 0 1.25rem;
}