/**
 * 工具箱模块样式 — 商用简洁风（实心按钮、小圆角、弱青绿点缀）
 */

.tb-page {
    --tb-primary: var(--primary, #0d9488);
    --tb-primary-dark: var(--primary-dark, #0f766e);
    --tb-primary-light: var(--primary-bg, rgba(13, 148, 136, 0.08));
    --tb-l1-rail-w: 108px;
    --tb-l2-drawer-w: 220px;
    --tb-sidebar-w: calc(var(--tb-l1-rail-w) + var(--tb-l2-drawer-w));
    --tb-bg: var(--bg, #f4f7f9);
    --tb-surface: var(--surface, #ffffff);
    --tb-border: var(--border, #e2e8f0);
    --tb-text: var(--text, #1e293b);
    --tb-text-secondary: var(--text-secondary, #475569);
    --tb-radius: var(--radius, 6px);
    --tb-radius-sm: var(--radius-sm, 4px);
    --tb-radius-lg: var(--radius-lg, 8px);
    --tb-radius-pill: var(--radius-pill, 6px);
    --tb-shadow: var(--shadow, 0 1px 2px rgba(15, 23, 42, 0.06));

    min-height: 100vh;
    background: var(--tb-bg);
    font-family: var(--font-sans, "Microsoft YaHei", "PingFang SC", sans-serif);
    font-size: 14px;
    color: var(--tb-text);
}

.tb-shell a {
    text-decoration: none;
    color: inherit;
}

.tb-shell button {
    cursor: pointer;
    font-family: inherit;
    font-size: inherit;
}

.tb-page .hidden {
    display: none !important;
}

/* ========== 整体布局 ========== */
.tb-shell {
    display: flex;
    width: 100%;
    min-height: calc(100vh - var(--nav-h, 56px));
    max-width: 1540px;
    margin: 0 auto;
    padding: 0 8px;
    gap: 0;
}

/* ========== 左侧导航（一级窄列 + 二级右滑抽屉） ========== */
.tb-sidebar {
    width: var(--tb-l1-rail-w);
    min-width: var(--tb-l1-rail-w);
    background: var(--tb-surface);
    border-right: 1px solid var(--tb-border);
    flex-shrink: 0;
    max-height: calc(100vh - var(--nav-h, 56px));
    position: sticky;
    top: var(--nav-h, 56px);
    overflow: hidden;
    transition: width 0.28s cubic-bezier(0.4, 0, 0.2, 1),
                min-width 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

.tb-sidebar.is-expanded {
    width: var(--tb-sidebar-w);
    min-width: var(--tb-sidebar-w);
}

.tb-sidebar-inner {
    display: flex;
    height: 100%;
    min-height: calc(100vh - var(--nav-h, 56px));
}

/* 一级窄列 */
.tb-nav-l1-rail {
    width: var(--tb-l1-rail-w);
    min-width: var(--tb-l1-rail-w);
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 16px 10px;
    background: #f8fafc;
    border-right: 1px solid var(--tb-border);
}

.tb-nav-l1-rail::before {
    content: '工具分类';
    display: block;
    padding: 0 4px 10px;
    font-size: 11px;
    font-weight: 700;
    color: #94a3b8;
    letter-spacing: 0.12em;
    text-align: center;
}

.tb-nav-l1-btn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 56px;
    padding: 14px 8px;
    border: 1px solid var(--tb-border);
    background: #fff;
    color: var(--tb-text-secondary);
    line-height: 1.35;
    text-align: center;
    border-radius: var(--tb-radius);
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.tb-nav-l1-btn:hover {
    background: #fff;
    color: var(--tb-primary);
    border-color: #cbd5e1;
}

.tb-nav-l1-btn.active {
    background: #f0fdfa;
    color: var(--tb-primary-dark);
    border-color: var(--tb-primary);
}

.tb-nav-l1-btn.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 12px;
    bottom: 12px;
    width: 3px;
    border-radius: 0 2px 2px 0;
    background: var(--tb-primary);
}

.tb-nav-l1-label {
    display: block;
    width: 100%;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

/* 二级抽屉容器（左右展开） */
.tb-nav-l2-wrap {
    width: 0;
    overflow: hidden;
    flex-shrink: 0;
    transition: width 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    background: var(--tb-surface);
}

.tb-sidebar.is-expanded .tb-nav-l2-wrap {
    width: var(--tb-l2-drawer-w);
}

.tb-nav-l2-drawer {
    display: none;
    width: var(--tb-l2-drawer-w);
    height: 100%;
    max-height: calc(100vh - var(--nav-h, 56px));
    overflow-x: hidden;
    overflow-y: auto;
    padding: 14px 10px 20px;
    animation: tb-drawer-in 0.22s ease-out;
}

.tb-nav-l2-drawer.open {
    display: block;
}

@keyframes tb-drawer-in {
    from {
        opacity: 0;
        transform: translateX(-12px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.tb-nav-l2-block + .tb-nav-l2-block {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed var(--tb-border);
}

.tb-nav-l2-title {
    margin: 0;
    padding: 0 10px 6px;
    font-size: 12px;
    font-weight: 700;
    color: var(--tb-text-secondary);
    letter-spacing: 0.04em;
}

.tb-nav-l2-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.tb-nav-l2-item {
    display: block;
    padding: 8px 10px;
    font-size: 13px;
    color: var(--tb-text-secondary);
    border-radius: var(--tb-radius);
    margin: 1px 0;
    border-left: 3px solid transparent;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tb-nav-l2-item:hover {
    background: #f8fafc;
    color: var(--tb-primary-dark);
}

.tb-nav-l2-item.active {
    background: #f1f5f9;
    color: var(--tb-text);
    font-weight: 600;
    border-left-color: var(--tb-primary);
}

/* ========== 主内容 ========== */
.tb-main {
    flex: 1;
    min-width: 0;
    padding: 14px 12px 24px 14px;
}

.tb-content {
    background: var(--tb-surface);
    border-radius: var(--tb-radius-lg);
    border: 1px solid var(--tb-border);
    box-shadow: var(--tb-shadow);
    padding: 26px 30px 30px;
    min-height: calc(100vh - var(--nav-h, 56px) - 38px);
}

.tb-billing-bar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 14px;
    padding: 10px 14px;
    margin-bottom: 18px;
    background: #f8fafc;
    border: 1px solid var(--tb-border);
    border-radius: var(--tb-radius);
}

.tb-billing-label {
    font-size: 13px;
    color: var(--tb-text-secondary);
}

.tb-billing-cost {
    font-size: 16px;
    color: var(--tb-text);
}

.tb-billing-tip {
    font-size: 12px;
    color: var(--tb-text-secondary);
}

.tb-engine-warn {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 10px 14px;
    margin-bottom: 16px;
    font-size: 13px;
    line-height: 1.5;
    color: #92400e;
    background: #fffbeb;
    border: 1px solid #fcd34d;
    border-radius: var(--tb-radius);
}

.tb-engine-warn i {
    flex-shrink: 0;
    margin-top: 2px;
}

.tb-engine-warn code {
    font-size: 12px;
    padding: 1px 4px;
    background: rgba(0, 0, 0, 0.06);
    border-radius: 4px;
}

.tb-page.tb-converting {
    overflow: hidden;
}

.tb-result-hint {
    margin: 12px 0 0;
    font-size: 13px;
    color: var(--tb-primary-dark);
    text-align: center;
}

.tb-options {
    margin-top: 16px;
    padding: 14px 16px;
    border: 1px dashed var(--tb-border);
    border-radius: var(--tb-radius);
    background: var(--tb-surface-muted, #f8fafc);
    text-align: center;
}

.tb-options-title {
    margin: 0 0 12px;
    font-size: 14px;
    font-weight: 600;
    color: var(--tb-text);
    text-align: center;
}

.tb-option {
    margin-bottom: 10px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.tb-option:last-child {
    margin-bottom: 0;
}

.tb-option label {
    display: block;
    width: 100%;
    max-width: 420px;
    margin-bottom: 4px;
    font-size: 13px;
    color: var(--tb-text-secondary);
    text-align: center;
}

.tb-option-input {
    width: 100%;
    max-width: 360px;
    padding: 8px 10px;
    border: 1px solid var(--tb-border);
    border-radius: var(--tb-radius-sm, 6px);
    font-size: 14px;
    background: var(--tb-surface);
    margin-left: auto;
    margin-right: auto;
}

.tb-option--center {
    text-align: center;
}

.tb-format-support {
    margin: 0 0 12px;
    font-size: 12px;
    color: var(--tb-text-secondary);
    line-height: 1.6;
}

.tb-format-label {
    margin: 0 0 10px;
    font-size: 13px;
    font-weight: 600;
    color: var(--tb-text);
}

.tb-format-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}

.tb-format-chip {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 68px;
    padding: 8px 16px;
    border: 1px solid var(--tb-border);
    border-radius: var(--tb-radius);
    background: #fff;
    color: var(--tb-text-secondary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s, color 0.15s;
    user-select: none;
}

.tb-format-chip input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.tb-format-chip:hover {
    border-color: #cbd5e1;
    color: var(--tb-primary);
}

.tb-format-chip:has(input:checked) {
    border-color: var(--tb-primary);
    background: #f0fdfa;
    color: var(--tb-primary-dark);
    font-weight: 600;
}

.tb-format-chip.is-disabled {
    opacity: 0.45;
    cursor: not-allowed;
    pointer-events: none;
    border-style: dashed;
}

.tb-format-chip.is-disabled:has(input:checked) {
    border-color: var(--tb-border);
    background: #f8fafc;
    color: var(--tb-text-secondary);
    font-weight: 500;
    box-shadow: none;
}

.tb-option-hint {
    margin: 8px auto 0;
    max-width: 480px;
    font-size: 12px;
    line-height: 1.6;
    color: var(--tb-text-secondary);
    text-align: center;
}

.tb-range-label {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    width: 100%;
    max-width: 420px;
    margin-bottom: 8px;
    font-size: 13px;
    color: var(--tb-text-secondary);
    text-align: center;
}

.tb-range-input {
    width: 100%;
    max-width: 420px;
    accent-color: var(--tb-primary);
    margin-left: auto;
    margin-right: auto;
}

.tb-dim-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px 16px;
    max-width: 420px;
    margin: 0 auto;
}

.tb-dim-field label {
    display: block;
    margin-bottom: 4px;
    font-size: 13px;
    color: var(--tb-text-secondary);
    text-align: center;
}

.tb-dim-field .tb-option-input {
    max-width: none;
    width: 100%;
}

.tb-check-row {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    font-size: 13px;
    color: var(--tb-text-secondary);
    cursor: pointer;
}

.tb-crop-tip {
    text-align: center;
    margin-bottom: 12px;
}

.tb-crop-stage {
    position: relative;
    display: inline-block;
    max-width: 100%;
    margin: 0 auto 12px;
    border-radius: var(--tb-radius);
    overflow: hidden;
    border: 1px solid var(--tb-border);
    background: #0f172a;
}

.tb-option#tb-opt-crop,
.tb-option#tb-opt-resize,
.tb-option#tb-opt-compress,
.tb-option#tb-opt-watermark,
.tb-option#tb-opt-pdf-compress,
.tb-option#tb-opt-image-format {
    text-align: center;
}

.tb-crop-image {
    display: block;
    max-width: 100%;
    max-height: 420px;
    width: auto;
    height: auto;
    user-select: none;
}

.tb-crop-mask {
    position: absolute;
    inset: 0;
    cursor: crosshair;
}

.tb-crop-selection {
    position: absolute;
    border: 2px solid var(--tb-primary);
    box-shadow: 0 0 0 9999px rgba(15, 23, 42, 0.55);
    cursor: move;
    pointer-events: auto;
}

.tb-crop-fields {
    max-width: 420px;
    margin: 0 auto;
}

.tb-crop-ratio-grid {
    margin-bottom: 14px;
}

.tb-image-meta {
    margin: 0 0 12px;
    padding: 8px 12px;
    font-size: 13px;
    color: var(--tb-text-secondary);
    background: #f8fafc;
    border: 1px solid var(--tb-border);
    border-radius: var(--tb-radius-sm);
    text-align: center;
}

.tb-resize-preview {
    margin: 0 auto 12px;
    font-size: 13px;
    color: var(--tb-text-secondary);
    text-align: center;
}

.tb-resize-calc {
    margin: 8px auto 0;
    font-size: 12px;
    color: var(--tb-primary-dark);
    text-align: center;
}

.tb-quick-size {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-top: 12px;
}

.tb-quick-btn {
    padding: 6px 14px;
    border: 1px solid var(--tb-border);
    border-radius: var(--tb-radius);
    background: #fff;
    color: var(--tb-text-secondary);
    font-size: 12px;
    cursor: pointer;
    transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.tb-quick-btn:hover {
    border-color: var(--tb-primary);
    color: var(--tb-primary-dark);
    background: #f0fdfa;
}

.tb-dim-field--single {
    max-width: 360px;
    margin: 12px auto 0;
}

.tb-dim-field--single label {
    display: block;
    margin-bottom: 4px;
    font-size: 13px;
    color: var(--tb-text-secondary);
    text-align: center;
}

.tb-dim-field--single .tb-option-input {
    max-width: none;
    width: 100%;
}

.tb-watermark-color-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 4px;
}

.tb-watermark-color-input {
    width: 48px;
    height: 36px;
    padding: 2px;
    border: 1px solid var(--tb-border);
    border-radius: var(--tb-radius-sm, 6px);
    background: #fff;
    cursor: pointer;
}

.tb-watermark-color-val {
    font-size: 13px;
    font-family: ui-monospace, Consolas, monospace;
    color: var(--tb-text-secondary);
}

.tb-watermark-color-presets {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-top: 12px;
}

.tb-watermark-color-btn {
    width: 28px;
    height: 28px;
    padding: 0;
    border: 2px solid #fff;
    border-radius: 50%;
    box-shadow: 0 0 0 1px var(--tb-border);
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
}

.tb-watermark-color-btn:hover {
    transform: scale(1.08);
}

.tb-watermark-color-btn.is-active {
    box-shadow: 0 0 0 2px var(--tb-primary);
}

.tb-content-header {
    margin-bottom: 22px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--tb-border);
}

.tb-content-title {
    margin: 0 0 10px;
    font-size: 24px;
    font-weight: 700;
    color: var(--tb-text);
    display: flex;
    align-items: center;
    gap: 8px;
}

.tb-content-title::before {
    content: '';
    width: 4px;
    height: 22px;
    border-radius: 2px;
    background: var(--tb-primary);
}

.tb-content-summary {
    margin: 0 0 12px;
    font-size: 14px;
    line-height: 1.65;
    color: var(--tb-text-secondary);
}

.tb-content-steps {
    margin: 0;
    font-size: 13px;
    color: var(--tb-text-secondary);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: #f8fafc;
    border: 1px solid var(--tb-border);
    border-radius: var(--tb-radius);
}

.tb-content-steps i {
    font-size: 15px;
}

/* ========== 上传区 ========== */
.tb-upload-section {
    margin-bottom: 28px;
}

.tb-upload-zone {
    border: 2px dashed #cbd5e1;
    border-radius: var(--tb-radius-lg);
    background: #f8fafc;
    padding: 44px 24px 32px;
    text-align: center;
    transition: border-color 0.2s, background 0.2s;
}

.tb-upload-zone--drag {
    border-color: var(--tb-primary);
    background: #f8fafc;
}

.tb-upload-icon {
    font-size: 44px;
    color: #94a3b8;
    margin-bottom: 14px;
    line-height: 1;
}

.tb-upload-btn {
    display: inline-block;
    padding: 10px 22px;
    background: var(--tb-primary);
    color: #fff;
    border: 1px solid var(--tb-primary);
    border-radius: var(--tb-radius-pill);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: none;
    transition: background 0.15s, border-color 0.15s;
}

.tb-upload-btn:hover {
    background: var(--tb-primary-dark);
    border-color: var(--tb-primary-dark);
}

.tb-upload-hint {
    margin: 12px 0 0;
    font-size: 12px;
    color: var(--tb-text-secondary);
}

.tb-file-list {
    list-style: none;
    margin: 18px auto 0;
    padding: 0;
    max-width: 520px;
    text-align: left;
}

.tb-file-list li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: #fff;
    border: 1px solid var(--tb-border);
    border-radius: var(--tb-radius);
    margin-bottom: 6px;
    font-size: 13px;
}

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

.tb-file-size {
    color: var(--tb-text-secondary);
    font-size: 12px;
    flex-shrink: 0;
}

.tb-file-remove {
    border: none;
    background: none;
    color: #94a3b8;
    font-size: 18px;
    cursor: pointer;
    line-height: 1;
    padding: 0 4px;
}

.tb-file-remove:hover {
    color: #ef4444;
}

.tb-agreement {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 8px;
    margin: 0 0 14px;
    cursor: pointer;
    font-size: 13px;
    color: var(--tb-text-secondary);
    max-width: 100%;
}

.tb-agreement input {
    margin-top: 3px;
    accent-color: var(--tb-primary);
}

.tb-agreement a {
    color: var(--tb-primary-dark);
}

.tb-agreement a:hover {
    text-decoration: underline;
}

.tb-action-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 16px;
    text-align: center;
}

.tb-action-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
}

.tb-coin-hint {
    margin: 10px 0 0;
    font-size: 12px;
    color: #dc2626;
    font-weight: 500;
}

.tb-btn-primary:disabled {
    opacity: 0.65;
    cursor: not-allowed;
    box-shadow: none;
}

/* ========== 全屏转换进度 ========== */
.tb-progress-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(4px);
}

.tb-progress-panel {
    width: min(360px, calc(100vw - 48px));
    padding: 32px 28px 28px;
    background: var(--tb-surface);
    border-radius: var(--tb-radius-lg);
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.2);
    text-align: center;
}

.tb-progress-ring {
    width: 48px;
    height: 48px;
    margin: 0 auto 16px;
    border: 3px solid var(--tb-primary-light);
    border-top-color: var(--tb-primary);
    border-radius: 50%;
    animation: tb-spin 0.9s linear infinite;
}

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

.tb-progress-title {
    margin: 0 0 6px;
    font-size: 18px;
    font-weight: 600;
    color: var(--tb-text);
}

.tb-progress-sub {
    margin: 0 0 18px;
    font-size: 13px;
    color: var(--tb-text-secondary);
}

.tb-progress-track {
    height: 6px;
    background: #e2e8f0;
    border-radius: var(--tb-radius-pill);
    overflow: hidden;
    margin-bottom: 14px;
}

.tb-progress-fill {
    height: 100%;
    width: 0%;
    background: var(--tb-primary);
    border-radius: var(--tb-radius-pill);
    transition: width 0.35s ease;
}

.tb-progress-warn {
    margin: 0;
    font-size: 12px;
    color: #b45309;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.tb-btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 22px;
    background: var(--tb-primary);
    color: #fff;
    border: 1px solid var(--tb-primary);
    border-radius: var(--tb-radius-pill);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: none;
    transition: background 0.15s, border-color 0.15s;
}

.tb-btn-primary:hover {
    background: var(--tb-primary-dark);
    border-color: var(--tb-primary-dark);
}

.tb-btn-secondary {
    padding: 10px 20px;
    background: #fff;
    color: var(--tb-text);
    border: 1px solid var(--tb-border);
    border-radius: var(--tb-radius-pill);
    font-size: 14px;
    cursor: pointer;
}

.tb-btn-secondary:hover {
    border-color: #cbd5e1;
    color: var(--tb-text);
    background: #f8fafc;
}

/* ========== 特性卡片 ========== */
.tb-features {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    padding-top: 4px;
}

.tb-feature-card {
    text-align: center;
    padding: 18px 14px;
    border: 1px solid var(--tb-border);
    border-radius: var(--tb-radius-lg);
    background: #fafbfc;
    transition: box-shadow 0.18s, border-color 0.18s;
}

.tb-feature-card:hover {
    border-color: #cbd5e1;
    box-shadow: var(--tb-shadow);
}

.tb-feature-icon {
    width: 40px;
    height: 40px;
    margin: 0 auto 10px;
    border-radius: var(--tb-radius);
    background: #f1f5f9;
    color: var(--tb-text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.tb-feature-card h3 {
    margin: 0 0 6px;
    font-size: 14px;
    font-weight: 700;
    color: var(--tb-text);
}

.tb-feature-card p {
    margin: 0;
    font-size: 12px;
    line-height: 1.65;
    color: var(--tb-text-secondary);
}

/* ========== 弹窗 ========== */
.tb-dialog {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.tb-dialog-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(2px);
}

.tb-dialog-panel {
    position: relative;
    width: 100%;
    max-width: 380px;
    background: #fff;
    border-radius: var(--tb-radius-lg);
    padding: 28px 24px 22px;
    text-align: center;
    box-shadow: var(--shadow-md, 0 6px 20px rgba(15, 23, 42, 0.08));
    animation: tb-dialog-in 0.22s ease-out;
}

@keyframes tb-dialog-in {
    from {
        opacity: 0;
        transform: scale(0.92) translateY(-8px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.tb-dialog-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 14px;
    border-radius: var(--tb-radius-lg);
    background: #f1f5f9;
    color: var(--tb-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
}

.tb-dialog-title {
    margin: 0 0 10px;
    font-size: 18px;
    font-weight: 700;
}

.tb-dialog-message {
    margin: 0 0 20px;
    font-size: 14px;
    line-height: 1.6;
    color: var(--tb-text-secondary);
}

.tb-dialog-ok {
    min-width: 120px;
    justify-content: center;
}

/* ========== 响应式 ========== */
@media (max-width: 1024px) {
    .tb-shell {
        flex-direction: column;
        max-width: none;
        padding: 0;
    }

    .tb-sidebar {
        width: 100%;
        min-width: 0;
        max-height: none;
        position: static;
        border-right: none;
        border-bottom: 1px solid var(--tb-border);
    }

    .tb-sidebar.is-expanded {
        width: 100%;
        min-width: 0;
    }

    .tb-sidebar-inner {
        min-height: auto;
        flex-direction: column;
    }

    .tb-nav-l1-rail {
        flex-direction: row;
        width: 100%;
        min-width: 0;
        border-right: none;
        border-bottom: 1px solid var(--tb-border);
        padding: 10px 12px;
        gap: 10px;
    }

    .tb-nav-l1-rail::before {
        display: none;
    }

    .tb-nav-l1-btn {
        flex: 1;
        flex-direction: row;
        gap: 10px;
        min-height: auto;
        padding: 12px 14px;
    }

    .tb-nav-l1-btn.active::before {
        display: none;
    }

    .tb-nav-l1-btn.active::after {
        display: none;
    }

    .tb-nav-l1-label {
        white-space: normal;
        text-align: left;
    }

    .tb-nav-l2-wrap,
    .tb-sidebar.is-expanded .tb-nav-l2-wrap {
        width: 100%;
    }

    .tb-nav-l2-drawer,
    .tb-sidebar.is-expanded .tb-nav-l2-wrap {
        width: 100%;
    }

    .tb-nav-l2-drawer {
        max-height: 280px;
    }

    .tb-main {
        padding: 12px;
    }

    .tb-content {
        padding: 20px 16px;
        min-height: auto;
    }

    .tb-features {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .tb-content-title {
        font-size: 20px;
    }

    .tb-upload-zone {
        padding: 32px 16px 24px;
    }

    .tb-dim-grid {
        grid-template-columns: 1fr;
    }

    .tb-format-chip {
        min-width: 60px;
        padding: 7px 12px;
        font-size: 12px;
    }

    .tb-crop-image {
        max-height: 280px;
    }

    .tb-crop-stage {
        width: 100%;
    }
}
