/* ============================================================
   Office Tools · Refined Editorial Design System
   暖纸底 + 焦橙点缀，细腻边框与柔和分层阴影
   ============================================================ */

/* ========== 设计令牌 ========== */
:root {
    /* 品牌色 */
    --amber: #B87A0E;
    --amber-dark: #8F5F0B;
    --orange: #BC5223;
    --orange-deep: #9E4219;
    --orange-ink: #7E3413;
    --orange-tint: #F7E9DE;

    /* 中性色 */
    --cream: #F5F1E8;
    --cream-soft: #FAF7F0;
    --paper: #FEFDFA;
    --ink: #221D17;
    --ink-soft: #554C40;
    --ink-muted: #94897A;

    /* 语义色 */
    --success: #15803D;
    --warning: #B45309;
    --danger: #B3261E;

    /* 线条与阴影 */
    --line: #E4DCC8;
    --line-soft: #EFE9D9;
    --line-strong: #CFC5AC;
    --shadow-sm: 0 1px 2px rgba(34, 29, 23, 0.05);
    --shadow-md: 0 1px 2px rgba(34, 29, 23, 0.04), 0 6px 18px -8px rgba(34, 29, 23, 0.10);
    --shadow-lg: 0 2px 4px rgba(34, 29, 23, 0.04), 0 16px 40px -16px rgba(34, 29, 23, 0.16);
    --shadow-modal: 0 24px 64px -16px rgba(34, 29, 23, 0.28);

    /* 圆角 */
    --radius-lg: 14px;
    --radius-md: 10px;
    --radius-sm: 7px;

    /* 字体 */
    --font-display: 'Fraunces', Georgia, 'Times New Roman', serif;
    --font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    --font-mono: 'JetBrains Mono', 'SFMono-Regular', Consolas, 'Courier New', monospace;

    /* 渐变 */
    --gradient-primary: linear-gradient(150deg, #C95E2C 0%, var(--orange) 100%);
}

/* ========== 全局重置 ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

::selection {
    background: rgba(184, 122, 14, 0.22);
}

body {
    font-family: var(--font-body);
    background-color: var(--cream);
    background-image: radial-gradient(rgba(34, 29, 23, 0.045) 1px, transparent 1.3px);
    background-size: 22px 22px;
    height: 100vh;
    overflow: hidden;
    display: flex;
    color: var(--ink);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

/* 全局焦点可见性（WCAG 2.2 AA） */
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
a:focus-visible {
    outline: 2px solid var(--amber);
    outline-offset: 2px;
}

/* 滑块统一品牌色 */
input[type="range"] {
    accent-color: var(--orange);
}

input[type="checkbox"],
input[type="radio"] {
    accent-color: var(--orange);
}

/* ========== 主内容区域 ========== */
.main-content {
    margin-left: 256px;
    flex: 1;
    padding: 20px;
    height: 100vh;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.container {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: 22px 26px 26px;
    width: 100%;
    height: calc(100vh - 40px);
    display: grid;
    grid-template-columns: minmax(0, 1fr) 336px;
    gap: 20px 24px;
    overflow: hidden;
}

/* 跨列工具类 */
.span-all {
    grid-column: 1 / -1;
}

/* ========== 工具头部 ========== */
.tool-header {
    grid-column: 1 / -1;
    border-bottom: 1px solid var(--line);
    padding-bottom: 14px;
    flex-shrink: 0;
}

.tool-kicker {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-mono);
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 2.5px;
    color: var(--amber-dark);
    text-transform: uppercase;
    margin-bottom: 8px;
}

.tool-kicker::before {
    content: '';
    width: 18px;
    height: 2px;
    background: var(--amber);
    flex-shrink: 0;
}

.tool-header h1 {
    font-family: var(--font-display);
    font-size: 28px;
    font-weight: 600;
    letter-spacing: 0.5px;
    color: var(--ink);
    line-height: 1.15;
}

/* ========== 上传区域 ========== */
.upload-area {
    border: 1.5px dashed var(--line-strong);
    border-radius: var(--radius-md);
    padding: 22px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.25s ease, background 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
    background: var(--cream-soft);
    margin-bottom: 4px;
    grid-column: 1 / -1;
    flex-shrink: 0;
}

.upload-area:hover {
    background: #F6F0E1;
    border-color: var(--orange);
}

.upload-area.dragover {
    background: #F6ECDD;
    border-color: var(--orange);
    border-style: solid;
    transform: scale(1.005);
    box-shadow: var(--shadow-md);
}

/* 已选择文件的高亮状态 */
.upload-area.selected {
    border-style: solid;
    border-color: var(--success);
    background: #EEF7F0;
}

.upload-area.selected:hover {
    border-color: var(--success);
    background: #EEF7F0;
}

.upload-area.selected .upload-icon,
.upload-area.selected .upload-text {
    color: var(--success);
}

.upload-area.selected .upload-text {
    font-weight: 600;
}

.upload-icon {
    display: flex;
    justify-content: center;
    margin-bottom: 8px;
    color: var(--ink-muted);
}

.upload-icon svg {
    width: 30px;
    height: 30px;
}

.upload-area:hover .upload-icon,
.upload-area.dragover .upload-icon {
    color: var(--orange);
}

.upload-text {
    color: var(--ink-soft);
    font-size: 13px;
    letter-spacing: 0.3px;
}

.upload-sub {
    color: var(--ink-muted);
    font-size: 12px;
    margin-top: 4px;
    line-height: 1.5;
}

/* ========== 图片处理工具上传区域高度统一 ========== */
/* 以图片水印工具（imageWatermarkUploadArea）上传区域的高度为基准，统一 12 个图片处理工具 */
/* 容器为固定高度 grid 且未定义行高时，align-content:stretch 会把剩余空间均分拉伸各行，
   导致上传区域行被拉高。这里显式固定前两行（头部、上传区域）按内容高度，第三行吸收剩余空间。 */
#watermarkTool,
#imageWatermarkTool,
#compressTool,
#convertTool,
#colorTool,
#mattingTool,
#colorExtractionTool,
#watermarkRemovalTool,
#imageCropTool,
#imageResizeTool,
#gridImageTool,
#base64Tool {
    grid-template-rows: auto auto minmax(0, 1fr);
}

#uploadArea,
#imageWatermarkUploadArea,
#compressUploadArea,
#convertUploadArea,
#colorUploadArea,
#mattingUploadArea,
#colorExtractionUploadArea,
#watermarkRemovalUploadArea,
#cropUploadArea,
#resizeUploadArea,
#gridImageUploadArea,
#base64UploadArea,
#base64DecodeInputArea {
    min-height: 103px;
}

/* Base64 输入区域（与上传区同位，内部排版左对齐） */
#base64DecodeInputArea .panel-title {
    text-align: left;
    margin-bottom: 8px;
}

#base64DecodeInputArea textarea {
    width: 100%;
    box-sizing: border-box;
    font-family: var(--font-mono);
    font-size: 12px;
    line-height: 1.6;
    word-break: break-all;
    resize: vertical;
}

#base64DecodeInputArea .hint-text {
    margin-top: 6px;
}

#uploadArea .upload-text,
#imageWatermarkUploadArea .upload-text,
#compressUploadArea .upload-text,
#convertUploadArea .upload-text,
#colorUploadArea .upload-text,
#mattingUploadArea .upload-text,
#colorExtractionUploadArea .upload-text,
#watermarkRemovalUploadArea .upload-text,
#cropUploadArea .upload-text,
#resizeUploadArea .upload-text,
#gridImageUploadArea .upload-text,
#base64UploadArea .upload-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

input[type="file"] {
    display: none;
}

/* ========== 左侧工具区 ========== */
.tool-area {
    display: flex;
    flex-direction: column;
    gap: 14px;
    overflow-y: auto;
    padding-right: 8px;
    height: 100%;
    min-height: 0;
}

.tool-area::-webkit-scrollbar,
.action-panel::-webkit-scrollbar,
.colors-grid::-webkit-scrollbar,
#colorsResultContainer::-webkit-scrollbar {
    width: 5px;
}

.tool-area::-webkit-scrollbar-thumb,
.action-panel::-webkit-scrollbar-thumb,
.colors-grid::-webkit-scrollbar-thumb,
#colorsResultContainer::-webkit-scrollbar-thumb {
    background: #D3C8AC;
    border-radius: 4px;
}

/* 对比容器 */
.comparison-container {
    display: none;
    width: 100%;
    gap: 16px;
    align-items: flex-start;
    flex: 1;
    min-height: 0;
    max-height: 62vh;
    overflow: auto;
}

.comparison-container.show {
    display: flex;
}

.comparison-item,
.preview-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
    background: var(--cream-soft);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    padding: 12px;
}

.preview-label {
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 10.5px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--amber-dark);
    margin-bottom: 8px;
    flex-shrink: 0;
}

.preview-image {
    width: 100%;
    height: auto;
    max-height: 52vh;
    object-fit: contain;
    border-radius: var(--radius-sm);
    border: 1px solid var(--line);
    background: var(--paper);
    display: block;
}

/* canvas 预览（消除水印涂抹画布）：保持等比缩放显示，避免 max-height 压缩导致图片变形、涂抹坐标错位 */
canvas.preview-image {
    width: auto;
    max-width: 100%;
    height: auto;
    max-height: 52vh;
    margin: 0 auto;
    cursor: crosshair;
}

/* ========== 表单控件 ========== */
.input-group {
    margin-top: 0;
    flex-shrink: 0;
}

.input-group label {
    display: block;
    margin-bottom: 6px;
    color: var(--ink);
    font-weight: 600;
    font-size: 13px;
    letter-spacing: 0.2px;
}

.container input[type="text"],
.container input[type="number"],
.container input[type="url"],
.container textarea,
.container select,
.modal input[type="text"],
.modal input[type="number"],
.modal input[type="url"],
.modal textarea,
.modal select {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-family: inherit;
    background: var(--paper);
    color: var(--ink);
    transition: border-color 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}

.container input[type="text"]:focus,
.container input[type="number"]:focus,
.container input[type="url"]:focus,
.container textarea:focus,
.container select:focus,
.modal input:focus,
.modal textarea:focus,
.modal select:focus {
    outline: none;
    border-color: var(--amber);
    background: #FFFFFF;
    box-shadow: 0 0 0 3px rgba(184, 122, 14, 0.14);
}

.container input[type="color"],
.modal input[type="color"] {
    width: 100%;
    height: 40px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    cursor: pointer;
    background: var(--paper);
    padding: 3px;
    transition: border-color 0.25s ease;
}

.container input[type="color"]:hover {
    border-color: var(--amber);
}

/* 勾选行 */
label.check-row,
.check-row {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: var(--ink);
}

.check-row input {
    width: 15px;
    height: 15px;
    cursor: pointer;
    flex-shrink: 0;
}

.hint-text {
    font-size: 11.5px;
    color: var(--ink-muted);
    line-height: 1.7;
    margin-top: 5px;
}

.slider-value {
    text-align: center;
    color: var(--orange);
    font-size: 12.5px;
    font-weight: 700;
    font-family: var(--font-mono);
}

/* 信息卡片（图片/PDF 信息展示） */
.info-card {
    background: var(--cream-soft);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    padding: 12px 14px;
    font-size: 13px;
    color: var(--ink-soft);
    flex-shrink: 0;
}

.info-card .info-title {
    font-family: var(--font-mono);
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--amber-dark);
    margin-bottom: 4px;
}

.info-card .info-line {
    line-height: 1.9;
}

/* ========== 右侧操作面板 ========== */
.action-panel {
    background: var(--cream-soft);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    padding: 16px;
    height: 100%;
    min-height: 0;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.panel-title {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 700;
    color: var(--ink-soft);
    letter-spacing: 2px;
    text-transform: uppercase;
    padding-bottom: 2px;
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    gap: 9px;
    flex-shrink: 0;
    margin: 0;
}

.panel-title::before {
    content: '';
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--orange);
    flex-shrink: 0;
}

/* 设置卡片 */
.setting-card {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    padding: 13px 14px;
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
    flex-shrink: 0;
}

.setting-card:hover {
    border-color: var(--line-strong);
    box-shadow: var(--shadow-sm);
}

.setting-card .card-label {
    font-family: var(--font-mono);
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--amber-dark);
    margin-bottom: 8px;
}

/* ========== 按钮 ========== */
.button-group {
    display: flex;
    flex-direction: column;
    gap: 9px;
    flex-shrink: 0;
}

button,
a.btn-primary,
a.btn-secondary {
    padding: 11px 18px;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.3px;
    cursor: pointer;
    font-family: inherit;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.2s ease, color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
}

.button-group button {
    width: 100%;
}

.btn-primary {
    background: var(--orange);
    color: #FDF8F0;
    box-shadow: 0 1px 2px rgba(34, 29, 23, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.btn-primary:hover:not(:disabled) {
    background: var(--orange-deep);
    transform: translateY(-1px);
    box-shadow: 0 6px 14px -6px rgba(158, 66, 25, 0.45);
}

.btn-primary:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(34, 29, 23, 0.1);
}

.btn-primary:disabled {
    opacity: 0.42;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-secondary {
    background: var(--paper);
    color: var(--ink);
    border-color: var(--line-strong);
}

.btn-secondary:hover {
    background: #F4EEDF;
    border-color: var(--ink-muted);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.btn-secondary:active {
    transform: translateY(0);
    box-shadow: none;
}

.btn-danger {
    background: var(--danger);
    color: #FDF8F0;
}

/* ========== 加载动画 ========== */
.loading {
    display: none;
    text-align: center;
    margin: 12px 0;
    flex-shrink: 0;
    color: var(--ink-soft);
    font-size: 13px;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.loading.show {
    display: block;
}

.spinner {
    border: 3px solid var(--line-soft);
    border-top: 3px solid var(--orange);
    border-radius: 50%;
    width: 26px;
    height: 26px;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 6px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ========== 错误信息 ========== */
.error-message {
    background: #FAECEA;
    color: var(--danger);
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    margin: 8px 0;
    display: none;
    font-size: 13px;
    font-weight: 500;
    border: 1px solid #EBCFC9;
    border-left: 3px solid var(--danger);
    flex-shrink: 0;
}

.error-message.show {
    display: block;
}

/* ========== 结果/下载区域 ========== */
.result-container {
    margin-top: 16px;
    display: none;
}

.result-container.show {
    display: block;
}

.download-btn {
    display: inline-block;
    margin-top: 8px;
    padding: 11px 22px;
    background: var(--ink);
    color: #F5F1E8;
    text-decoration: none;
    border: 1px solid var(--ink);
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 13px;
    letter-spacing: 0.3px;
    box-shadow: var(--shadow-sm);
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.2s ease;
}

.download-btn:hover {
    background: #3A332B;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.download-btn:active {
    transform: translateY(0);
    box-shadow: none;
}

.download-container {
    text-align: center;
    margin-top: 12px;
    display: none;
    flex-shrink: 0;
}

.download-container.show {
    display: block;
}

/* ========== 色彩提取工具 ========== */
#colorsResultContainer {
    max-height: 460px;
    overflow-y: auto;
    padding-right: 4px;
}

.color-card {
    border: 1px solid var(--line-strong) !important;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.color-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md) !important;
}

#viewAllColorsBtn:hover {
    transform: translateY(-1px);
}

.dominant-color-section {
    border: 1px solid var(--line-strong) !important;
    box-shadow: var(--shadow-sm);
}

/* ========== 弹窗 ========== */
.modal {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(34, 29, 23, 0.45);
    backdrop-filter: blur(4px);
    animation: fadeIn 0.2s ease-out;
}

#uaEditModal {
    align-items: center;
    justify-content: center;
}

.modal-content {
    position: relative;
    background: var(--paper);
    border: 1px solid var(--line);
    margin: 3% auto;
    padding: 30px;
    border-radius: var(--radius-lg);
    width: 92%;
    max-width: 640px;
    max-height: 84vh;
    overflow-y: auto;
    box-shadow: var(--shadow-modal);
    animation: modalSlideIn 0.3s ease-out;
}

#colorExtractionModal .modal-content {
    max-width: 1080px;
}

#pdfResultModal .modal-content {
    max-width: 1180px;
}

.modal-content h2 {
    margin-top: 0;
    margin-bottom: 20px;
    color: var(--ink);
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 22px;
    letter-spacing: 0.3px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--line);
}

.modal-close {
    position: absolute;
    right: 18px;
    top: 14px;
    color: var(--ink-muted);
    font-size: 26px;
    font-weight: 400;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s ease, transform 0.2s ease;
}

.modal-close:hover {
    color: var(--orange);
    transform: rotate(90deg);
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-18px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ========== 登录/注册弹窗 ========== */
#authModal {
    display: none;
    align-items: center;
    justify-content: center;
}

.auth-modal-content {
    max-width: 420px !important;
    padding: 0 !important;
    overflow: hidden !important;
    margin: 0 auto !important;
}

.auth-tabs {
    display: flex;
    border-bottom: 1px solid var(--line);
}

.auth-tab {
    flex: 1;
    text-align: center;
    padding: 15px 10px;
    cursor: pointer;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--ink-muted);
    background: var(--cream-soft);
    transition: all 0.2s ease;
    letter-spacing: 0.5px;
    border-right: 1px solid var(--line-soft);
}

.auth-tab:last-child {
    border-right: none;
}

.auth-tab:hover {
    background: #F1EAD9;
    color: var(--ink);
}

.auth-tab.active {
    background: var(--paper);
    color: var(--orange);
    box-shadow: inset 0 -2px 0 var(--orange);
}

.auth-panel {
    display: none;
    padding: 24px 30px 22px;
}

.auth-panel.active {
    display: block;
    animation: fadeIn 0.25s ease-out;
}

.auth-input-group {
    margin-bottom: 13px;
}

.auth-input-group label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.2px;
    color: var(--ink-soft);
    margin-bottom: 6px;
    text-transform: uppercase;
}

.auth-input-group input {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-family: inherit;
    background: var(--paper);
    color: var(--ink);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    box-sizing: border-box;
}

.auth-input-group input:focus {
    outline: none;
    border-color: var(--amber);
    box-shadow: 0 0 0 3px rgba(184, 122, 14, 0.14);
}

.auth-code-row {
    margin-bottom: 14px;
}

.auth-code-wrap {
    display: flex;
    gap: 10px;
    align-items: center;
}

.auth-code-wrap input {
    flex: 1;
    min-width: 0;
}

.auth-code-btn {
    white-space: nowrap;
    padding: 12px 16px;
    background: var(--paper);
    color: var(--orange);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.3px;
    transition: all 0.18s ease;
}

.auth-code-btn:hover:not(:disabled) {
    border-color: var(--orange);
    background: var(--orange-tint);
}

.auth-code-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.auth-agreement {
    display: flex;
    align-items: flex-start;
    gap: 7px;
    margin-bottom: 10px;
    font-size: 12px;
    line-height: 1.5;
    color: var(--ink-muted);
}

.auth-agreement input[type="checkbox"] {
    width: 14px;
    height: 14px;
    margin-top: 2px;
    accent-color: var(--orange);
    cursor: pointer;
    flex-shrink: 0;
}

.auth-agreement label {
    cursor: pointer;
    user-select: none;
}

.auth-agreement a {
    color: var(--orange);
    text-decoration: none;
    font-weight: 600;
}

.auth-agreement a:hover {
    text-decoration: underline;
}

.auth-error {
    min-height: 18px;
    color: var(--danger);
    font-size: 12px;
    font-weight: 500;
    margin-bottom: 10px;
    line-height: 1.4;
}

.auth-error:empty {
    margin-bottom: 0;
}

.auth-submit-btn {
    width: 100%;
    padding: 13px;
    background: var(--gradient-primary);
    color: #FDF8F0;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 2px;
    box-shadow: 0 4px 12px -4px rgba(158, 66, 25, 0.4);
    transition: all 0.18s ease;
    margin-top: 0;
}

.auth-submit-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 18px -6px rgba(158, 66, 25, 0.5);
}

.auth-submit-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px -2px rgba(158, 66, 25, 0.4);
}

/* ========== 忘记密码 / 重置密码 ========== */
.auth-forgot-row {
    text-align: right;
    margin: -6px 0 12px;
}

.auth-forgot-link {
    font-size: 12.5px;
    color: var(--orange);
    text-decoration: none;
    transition: color 0.2s ease;
}

.auth-forgot-link:hover {
    color: #B43D0E;
    text-decoration: underline;
}

.auth-reset-title {
    font-family: var(--font-body), serif;
    font-size: 20px;
    font-weight: 700;
    color: var(--ink);
    margin-bottom: 4px;
}

.auth-reset-subtitle {
    font-size: 12.5px;
    color: var(--ink-muted);
    margin-bottom: 18px;
}

.auth-back-login {
    text-align: center;
    margin-top: 14px;
}

.auth-back-login a {
    font-size: 13px;
    color: var(--orange);
    text-decoration: none;
    transition: color 0.2s ease;
}

.auth-back-login a:hover {
    text-decoration: underline;
}

/* ========== 个人资料弹窗 ========== */
.profile-modal-content {
    max-width: 420px;
    text-align: center;
}

.profile-avatar-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 16px;
}

.profile-avatar-box {
    position: relative;
    width: 84px;
    height: 84px;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid var(--line);
    background: #F1EAD9;
    margin-bottom: 10px;
}

.profile-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: none;
}

.profile-avatar-img.visible {
    display: block;
}

.profile-avatar-empty {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    color: var(--ink-muted);
}

.profile-avatar-btn {
    padding: 7px 22px;
    background: var(--gradient-primary);
    color: #FDF8F0;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 1px;
    transition: all 0.18s ease;
}

.profile-avatar-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 10px -3px rgba(158, 66, 25, 0.4);
}

.profile-avatar-tip {
    margin-top: 8px;
    font-size: 11.5px;
    color: var(--ink-muted);
}

/* ========== 兑换码弹窗 ========== */
.redeem-code-modal-content {
    max-width: 420px;
}

.redeem-score-box {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 10px;
    margin-bottom: 16px;
    padding: 12px 16px;
    border: 1px dashed var(--line);
    border-radius: var(--radius-sm);
    background: rgba(249, 115, 22, 0.06);
}

.redeem-score-label {
    font-size: 13px;
    color: var(--ink-muted);
}

.redeem-score-value {
    font-size: 26px;
    font-weight: 700;
    color: var(--orange);
    line-height: 1;
}

#redeemCodeInput {
    text-transform: uppercase;
    letter-spacing: 1px;
}

.redeem-detail-link {
    margin-top: 12px;
    font-size: 12.5px;
    color: var(--orange);
    text-align: center;
    cursor: pointer;
    transition: color 0.2s ease;
}

.redeem-detail-link:hover {
    color: var(--orange-deep);
    text-decoration: underline;
}

/* ========== 积分明细弹窗 ========== */
#scoreDetailModal {
    align-items: center;
    justify-content: center;
}

.score-detail-modal-content {
    max-width: 720px;
}

.score-detail-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 16px;
}

.score-detail-stat {
    padding: 10px 12px;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
}

.score-detail-stat-accent {
    background: var(--orange-tint);
    border-color: #E9D2C0;
}

.score-detail-stat-label {
    display: block;
    margin-bottom: 4px;
    font-size: 11.5px;
    color: var(--ink-muted);
}

.score-detail-stat-value {
    display: block;
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 700;
    line-height: 1.2;
    color: var(--ink);
}

.score-detail-stat-accent .score-detail-stat-value {
    color: var(--orange-ink);
}

.score-detail-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.score-detail-tab {
    padding: 6px 14px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    background: var(--paper);
    color: var(--ink-soft);
    font-size: 12.5px;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
}

.score-detail-tab:hover {
    border-color: var(--amber);
    color: var(--ink);
}

.score-detail-tab.active {
    background: var(--gradient-primary);
    color: #FDF8F0;
    border-color: transparent;
}

.score-detail-list {
    max-height: 380px;
    overflow-y: auto;
    padding-right: 4px;
}

.score-detail-table td {
    white-space: nowrap;
}

.score-detail-type {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 12px;
    white-space: nowrap;
    background: #F3EDDD;
    color: var(--ink-soft);
}

.score-detail-type-redeem {
    background: var(--orange-tint);
    color: var(--orange-ink);
}

.score-detail-type-share_income {
    background: #E7F3E9;
    color: var(--success);
}

.score-detail-type-share_pay {
    background: #FBE9E7;
    color: var(--danger);
}

.score-detail-amount {
    text-align: right;
    font-family: var(--font-mono);
    font-weight: 700;
}

.score-detail-amount.income {
    color: var(--success);
}

.score-detail-amount.expense {
    color: var(--danger);
}

.score-detail-balance {
    text-align: right;
    color: var(--ink-soft);
}

.score-detail-time {
    font-size: 12px;
    color: var(--ink-muted);
}

.score-detail-peer {
    margin-left: 4px;
    font-size: 12px;
    color: var(--ink-muted);
}

.score-detail-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 12px;
}

.score-detail-page-btn {
    padding: 4px 14px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    background: var(--paper);
    color: var(--ink-soft);
    font-size: 12.5px;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
}

.score-detail-page-btn:hover {
    border-color: var(--amber);
    color: var(--ink);
}

.score-detail-page-info {
    font-size: 12.5px;
    color: var(--ink-muted);
}

@media (max-width: 640px) {
    .score-detail-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* ========== 修改密码弹窗 ========== */
.change-pwd-modal-content {
    max-width: 420px;
}

/* ========== 确认弹窗 ========== */
/* ========== 意见反馈弹窗 ========== */
#feedbackModal {
    align-items: center;
    justify-content: center;
}

.feedback-modal-content {
    max-width: 480px;
}

.feedback-char-count {
    text-align: right;
    font-size: 12px;
    color: var(--ink-muted);
    margin-top: 4px;
}

#feedbackModal .auth-submit-btn {
    margin-top: 16px;
}

/* ========== 反馈管理弹窗（系统管理员） ========== */
.feedback-admin-modal-content {
    max-width: 720px;
}

.feedback-admin-toolbar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    row-gap: 8px;
    column-gap: 8px;
    margin-bottom: 12px;
    font-size: 13px;
    color: var(--ink-muted);
}

.feedback-admin-toolbar label {
    flex-shrink: 0;
    white-space: nowrap;
}

.feedback-admin-toolbar select {
    padding: 6px 10px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--paper);
    color: var(--ink);
    font-size: 13px;
    outline: none;
    flex-shrink: 0;
}

.feedback-admin-total {
    margin-left: auto;
    flex-shrink: 0;
    white-space: nowrap;
    font-size: 12px;
    color: var(--ink-muted);
}

.feedback-admin-list {
    max-height: 420px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-right: 4px;
}

.feedback-admin-item {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 12px 14px;
    background: var(--paper);
}

.feedback-admin-item-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
    font-size: 12px;
    flex-wrap: wrap;
}

.feedback-admin-type {
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 12px;
    background: rgba(249, 115, 22, 0.1);
    color: var(--orange);
}

.feedback-admin-user {
    color: var(--ink-muted);
}

.feedback-admin-time {
    margin-left: auto;
    color: var(--ink-muted);
}

.feedback-admin-content {
    font-size: 14px;
    line-height: 1.6;
    color: var(--ink);
    white-space: pre-wrap;
    word-break: break-word;
}

.feedback-admin-contact {
    margin-top: 6px;
    font-size: 12px;
    color: var(--ink-muted);
}

.feedback-admin-empty {
    text-align: center;
    color: var(--ink-muted);
    padding: 40px 0;
    font-size: 14px;
}

.feedback-admin-loading {
    text-align: center;
    color: var(--ink-muted);
    padding: 30px 0;
    font-size: 14px;
}

.feedback-admin-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 14px;
}

.feedback-admin-page-btn {
    padding: 6px 14px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--paper);
    color: var(--ink);
    font-size: 13px;
    cursor: pointer;
    transition: border-color 0.2s ease, color 0.2s ease;
}

.feedback-admin-page-btn:hover {
    border-color: var(--orange);
    color: var(--orange);
}

.feedback-admin-page-info {
    font-size: 13px;
    color: var(--ink-muted);
}

.confirm-modal-content {
    max-width: 340px;
    padding: 28px 32px 16px;
    margin: auto;
    text-align: center;
}

.confirm-text {
    font-family: var(--font-body), serif;
    font-size: 16px;
    font-weight: 500;
    color: var(--ink);
    margin: 0 0 20px;
    line-height: 1.6;
    letter-spacing: 0.5px;
}

.confirm-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
}

.confirm-btn {
    flex: 1;
    max-width: 130px;
    padding: 11px 0;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 1px;
    transition: all 0.18s ease;
    border: none;
    font-family: var(--font-body), sans-serif;
}

.confirm-btn-cancel {
    background: #F1EAD9;
    color: var(--ink-soft);
    border: 1px solid var(--line);
}

.confirm-btn-cancel:hover {
    background: #E5DCC7;
    color: var(--ink);
}

.confirm-btn-ok {
    background: var(--gradient-primary);
    color: #FDF8F0;
    box-shadow: 0 4px 12px -4px rgba(158, 66, 25, 0.35);
}

.confirm-btn-ok:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px -4px rgba(158, 66, 25, 0.45);
}

.confirm-btn-ok:active {
    transform: translateY(0);
}

/* ---------- 我的二维码 ---------- */
.myqr-modal-content {
    max-width: 760px;
}

.myqr-detail-content {
    max-width: 480px;
}

.myqr-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--line);
    padding-bottom: 12px;
}

.myqr-tab {
    padding: 8px 20px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    background: var(--paper);
    color: var(--ink-soft);
    font-size: 13px;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
}

.myqr-tab:hover {
    border-color: var(--amber);
    color: var(--ink);
}

.myqr-tab.active {
    background: var(--gradient-primary);
    color: #FDF8F0;
    border-color: transparent;
}

.myqr-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.myqr-table th {
    padding: 10px;
    text-align: left;
    background: #F5F1E8;
    border-bottom: 1px solid #E4DCC8;
    color: var(--ink-soft);
    font-weight: 600;
}

.myqr-table td {
    padding: 10px;
    border-bottom: 1px solid #EFE9D9;
    vertical-align: middle;
    word-break: break-all;
}

.myqr-table code {
    background: #F3EDDD;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 12px;
}

.myqr-table .myqr-op-btn {
    padding: 4px 12px;
    font-size: 12px;
    margin-right: 4px;
    width: auto;
}

.myqr-table .myqr-op-btn.danger {
    background: #B3261E;
    color: #FDF8F0;
    border-color: #B3261E;
}

.myqr-empty {
    text-align: center;
    color: var(--ink-muted);
    padding: 32px 0;
    font-size: 13px;
}

.myqr-qrcode-box {
    text-align: center;
    margin-bottom: 18px;
}

.myqr-qrcode-img {
    width: 200px;
    height: 200px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: #FFFFFF;
    padding: 6px;
}

.myqr-short-url {
    margin-top: 10px;
    font-size: 12px;
    color: var(--ink-muted);
    word-break: break-all;
}

.myqr-short-url a {
    color: var(--amber);
    text-decoration: none;
}

.myqr-short-url a:hover {
    text-decoration: underline;
}

.myqr-download-btn {
    display: inline-block;
    margin-top: 10px;
    width: auto;
    padding: 6px 18px;
    font-size: 13px;
    text-decoration: none;
}

.myqr-url-item {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
    align-items: center;
}

.myqr-url-item input {
    min-width: 0;
}

.myqr-url-item .myqr-label-input {
    flex: 1;
}

.myqr-url-item .myqr-url-input {
    flex: 2;
}

.myqr-url-item .myqr-remove-btn {
    width: auto;
    padding: 6px 14px;
    font-size: 16px;
    flex-shrink: 0;
    line-height: 1;
}

/* ========== 专属工具 ========== */

/* 工具内容区（内嵌页面 / 占位提示） */
.custom-tool-frame-wrap {
    position: relative;
    min-width: 0;
    height: 100%;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--cream-soft);
    overflow: hidden;
}

.custom-tool-frame {
    display: none;
    width: 100%;
    height: 100%;
    border: none;
    background: #FFFFFF;
}

.custom-tool-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 28px;
    text-align: center;
    color: var(--ink-muted);
    font-size: 13.5px;
    line-height: 1.7;
}

.custom-tool-placeholder-icon {
    width: 46px;
    height: 46px;
    color: var(--line-strong);
}

.custom-tool-placeholder-icon svg {
    width: 100%;
    height: 100%;
}

.custom-tool-side {
    height: 100%;
}

.custom-tool-op-btn {
    width: 100%;
    margin-top: 8px;
    padding: 8px 0;
    font-size: 13px;
}

/* 弹窗尺寸 */
.custom-tool-modal-content {
    max-width: 700px;
}

.custom-tool-price-content {
    max-width: 460px;
}

.custom-tool-admin-content {
    max-width: 780px;
}

/* 分享 / 支付信息块 */
.custom-tool-qr-info,
.custom-tool-pay-info {
    font-size: 13px;
}

.custom-tool-qr-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px dashed var(--line-soft);
    color: var(--ink-muted);
}

.custom-tool-qr-row:last-of-type {
    border-bottom: none;
}

.custom-tool-qr-row strong {
    color: var(--ink);
    font-weight: 600;
    text-align: right;
    word-break: break-all;
}

.custom-tool-qr-tip {
    margin-top: 10px;
    padding: 9px 12px;
    background: #F7F3E8;
    border-radius: var(--radius-sm);
    font-size: 12px;
    color: var(--ink-soft);
    line-height: 1.7;
}

/* ========== 分享二维码弹窗（专属工具） ========== */
.custom-tool-qr-modal {
    max-width: 560px;
    padding: 26px 28px 20px;
}

.custom-tool-qr-modal h2 {
    margin-bottom: 18px;
}

/* 顶部：二维码 + 关键信息 */
.ctq-hero {
    display: flex;
    gap: 20px;
    padding: 18px;
    margin-bottom: 16px;
    background: linear-gradient(158deg, #FBF7EE 0%, var(--cream-soft) 100%);
    border: 1px solid var(--line-soft);
    border-radius: var(--radius-md);
}

.ctq-qr {
    flex: 0 0 168px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.ctq-qr-frame {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 168px;
    height: 168px;
    padding: 8px;
    background: #FFFFFF;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.ctq-qr-img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.ctq-qr-download {
    padding-bottom: 1px;
    font-size: 12.5px;
    color: var(--ink-soft);
    text-decoration: none;
    border-bottom: 1px dashed var(--line-strong);
    transition: color 0.2s ease, border-color 0.2s ease;
}

.ctq-qr-download:hover {
    color: var(--orange);
    border-bottom-color: var(--orange);
}

.ctq-summary {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
    gap: 8px;
}

.ctq-sum-label {
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: 1px;
    color: var(--ink-muted);
}

.ctq-sum-tool {
    font-family: var(--font-display);
    font-size: 19px;
    font-weight: 600;
    line-height: 1.35;
    color: var(--ink);
    word-break: break-all;
}

.ctq-sum-stats {
    display: flex;
    gap: 10px;
    margin-top: 2px;
}

.ctq-stat {
    flex: 1 1 0;
    min-width: 0;
    padding: 9px 12px;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
}

.ctq-stat-accent {
    background: var(--orange-tint);
    border-color: #E9D2C0;
}

.ctq-stat-label {
    display: block;
    margin-bottom: 3px;
    font-size: 11.5px;
    color: var(--ink-muted);
}

.ctq-stat-value {
    display: block;
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 700;
    line-height: 1.2;
    color: var(--ink);
}

.ctq-stat-value em {
    margin-left: 3px;
    font-size: 11.5px;
    font-weight: 500;
    font-style: normal;
    color: var(--ink-muted);
}

.ctq-stat-accent .ctq-stat-value {
    color: var(--orange-ink);
}

.ctq-sum-tip {
    font-size: 12px;
    line-height: 1.65;
    color: var(--ink-muted);
}

/* 可复制的分享码 / 分享链接 */
.ctq-copy {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ctq-copy-label {
    display: block;
    margin-bottom: 6px;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--ink-soft);
}

.ctq-copy-row {
    display: flex;
    gap: 8px;
}

.ctq-copy-input {
    flex: 1 1 auto;
    min-width: 0;
    padding: 9px 12px;
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--ink);
    background: var(--cream-soft);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    text-overflow: ellipsis;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.ctq-copy-input:focus {
    outline: none;
    background: var(--paper);
    border-color: var(--amber);
}

.ctq-copy-btn {
    flex: 0 0 auto;
    width: auto;
    margin: 0;
    padding: 9px 16px;
    font-size: 12.5px;
}

.ctq-hint {
    font-size: 12px;
    line-height: 1.7;
    color: var(--ink-muted);
}

.ctq-hint a {
    color: var(--amber);
    text-decoration: none;
}

.ctq-hint a:hover {
    text-decoration: underline;
}

/* 底部操作 */
.ctq-actions {
    display: flex;
    justify-content: center;
    margin-top: 6px;
    padding-top: 12px;
    border-top: 1px dashed var(--line);
}

.ctq-close-share {
    padding: 7px 18px;
    font-family: inherit;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--danger);
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.ctq-close-share:hover {
    background: #FBECEA;
    border-color: #F0C9C3;
}

@media (max-width: 560px) {
    .custom-tool-qr-modal {
        padding: 22px 18px 16px;
    }

    .ctq-hero {
        flex-direction: column;
        align-items: center;
    }

    .ctq-summary {
        width: 100%;
    }

    .ctq-sum-tool,
    .ctq-sum-label {
        text-align: center;
    }
}

.custom-tool-price-tag {
    color: var(--orange);
    font-weight: 700;
}

/* 积分不足 */
.custom-tool-lack-tip {
    margin-top: 12px;
    padding: 9px 12px;
    background: #FBECEA;
    border: 1px solid #F0C9C3;
    border-radius: var(--radius-sm);
    font-size: 12.5px;
    color: var(--danger);
    line-height: 1.7;
}

.custom-tool-lack-tip strong {
    color: var(--danger);
}

.custom-tool-lack-score {
    color: var(--danger);
}

.custom-tool-recharge-btn {
    width: 100%;
    margin-top: 10px;
    padding: 8px 0;
    font-size: 13px;
}

.custom-tool-recharge-inline {
    width: auto;
    margin: 0 0 0 6px;
    padding: 2px 10px;
    font-size: 12px;
}

/* 扫码添加工具 */
.custom-tool-scan-input {
    display: flex;
    gap: 8px;
    align-items: center;
}

.custom-tool-scan-btn {
    width: auto;
    min-width: 64px;
    padding: 8px 14px;
    font-size: 13px;
    flex-shrink: 0;
}

.custom-tool-scan-upload {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.custom-tool-scan-file-label {
    display: inline-block;
    padding: 7px 14px;
    border: 1px dashed var(--line-strong);
    border-radius: var(--radius-sm);
    font-size: 12.5px;
    color: var(--ink-soft);
    cursor: pointer;
    transition: border-color 0.2s, color 0.2s;
}

.custom-tool-scan-file-label:hover {
    border-color: var(--orange);
    color: var(--orange);
}

.custom-tool-scan-file-name {
    font-size: 12px;
    color: var(--ink-muted);
    word-break: break-all;
}

.custom-tool-scan-result {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid var(--line);
}

/* 管理端 */
.custom-tool-admin-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.custom-tool-admin-tip {
    font-size: 12px;
    color: var(--ink-muted);
}

.custom-tool-status {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
}

.custom-tool-status.on {
    background: #E8F3EA;
    color: var(--success);
}

.custom-tool-status.off {
    background: #F3E8E4;
    color: var(--danger);
}

.custom-tool-grant-add {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-top: 12px;
}

.custom-tool-grant-add input {
    flex: 1;
}

.custom-tool-user-result {
    margin-top: 10px;
}

.custom-tool-grant-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid var(--line);
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 2px;
    color: var(--ink-soft);
    text-transform: uppercase;
}

.custom-tool-grant-head span:last-child {
    font-family: var(--font-body);
    letter-spacing: 0;
    color: var(--ink-muted);
    font-weight: 500;
}

/* 侧边栏登录按钮 */
.sidebar-login-btn {
    display: block;
    width: 100%;
    padding: 9px 0;
    margin-bottom: 8px;
    background: var(--gradient-primary);
    color: #FDF8F0;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 2px;
    box-shadow: 0 2px 8px -2px rgba(158, 66, 25, 0.35);
    transition: all 0.18s ease;
}

.sidebar-login-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 12px -3px rgba(158, 66, 25, 0.45);
}

.sidebar-login-btn:active {
    transform: translateY(0);
}

.sidebar-login-btn.logged-in {
    background: #4E7A50;
    box-shadow: 0 2px 8px -2px rgba(78, 122, 80, 0.35);
}

/* 登录后的用户按钮（头像 + 昵称） */
.sidebar-login-btn.logged-in {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.sidebar-login-btn .sidebar-user-avatar {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    object-fit: cover;
    background: #FDF8F0;
    flex-shrink: 0;
}

.sidebar-login-btn .sidebar-user-avatar-placeholder {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.22);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    color: #FDF8F0;
    flex-shrink: 0;
}

.sidebar-footer-text {
    font-size: 10.5px;
    letter-spacing: 1.5px;
}

/* PDF 结果弹窗 */
#pdfModalImagesContainer {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 18px;
}

#pdfModalBatchDownloadBtn,
#pdfBatchDownloadBtn {
    padding: 12px 30px;
    background: var(--gradient-primary);
    color: #FDF8F0;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 12px -4px rgba(158, 66, 25, 0.4);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

#pdfModalBatchDownloadBtn:hover,
#pdfBatchDownloadBtn:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 18px -6px rgba(158, 66, 25, 0.5);
}

.pdf-single-download-btn,
.pdf-modal-download-btn {
    border: 1px solid var(--line-strong) !important;
    font-weight: 600;
}

/* ========== 网址聚合码工具 ========== */
.ua-url-item {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
    align-items: center;
}

.ua-label-input {
    flex: 1;
    min-width: 0;
}

.ua-url-input {
    flex: 2;
    min-width: 0;
}

.ua-url-item .btn-secondary {
    padding: 8px 12px;
    flex-shrink: 0;
}

#uaResultContainer {
    margin-top: 20px;
    background: var(--cream-soft);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    padding: 20px;
}

#uaResultQrCode {
    max-width: 200px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: #fff;
}

#uaResultGroupCode,
#uaEditGroupCode {
    background: #F3EDDD;
    border: 1px solid var(--line);
    padding: 2px 8px;
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 12px;
}

#uaResultH5Url {
    color: var(--orange);
    word-break: break-all;
}

#uaAggregationList table th {
    font-family: var(--font-mono);
    font-size: 10.5px;
    letter-spacing: 1px;
    text-transform: uppercase;
}

#uaListEmpty {
    text-align: center;
    color: var(--ink-muted);
    padding: 20px;
    font-size: 13px;
}

/* ========== 二维码工具 ========== */
/* 二维码工具内容超出时允许滚动，避免遮挡 */
#qrcodeTool {
    overflow-y: auto;
}

.qr-tabs {
    display: flex;
    gap: 10px;
    margin-top: 14px;
}

/* 二维码各功能区：允许收缩，内部 tool-area 滚动，避免挤压选项卡面板 */
#textQrSection,
#urlQrSection,
#livingQrSection,
#avLivingQrSection,
#decodeQrSection {
    min-height: 0;
    overflow: hidden;
}

/* 二维码功能选项卡面板：不允许被压缩 */
#qrcodeTabsPanel {
    flex-shrink: 0;
    min-height: fit-content;
    overflow: visible;
}

#textQrResult,
#urlQrResult,
#livingQrResult {
    max-width: 280px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: #fff;
    box-shadow: var(--shadow-sm);
}

#decodeResultContainer {
    margin-top: 16px;
    background: var(--paper);
    padding: 14px;
    border-radius: var(--radius-md);
    border: 1px solid var(--line);
}

#decodeResult {
    font-size: 13px;
    color: var(--ink);
    word-break: break-all;
    background: var(--cream-soft);
    padding: 10px;
    border-radius: 6px;
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid var(--line-soft);
}

#copyDecodeResult {
    margin-top: 10px;
    padding: 8px 16px;
    background: var(--orange);
    color: #FDF8F0;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.2s ease;
}

#copyDecodeResult:hover {
    background: var(--orange-deep);
    transform: translateY(-1px);
}

/* 短链接展示 */
.short-url-card {
    background: var(--cream-soft);
    border: 1px solid var(--line);
    padding: 15px;
    border-radius: var(--radius-sm);
    margin-bottom: 15px;
}

.short-url-card a,
.short-url-card span {
    word-break: break-all;
}

.chat-tool-area {
    gap: 10px;
}

.chat-messages {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 14px;
    background: var(--cream-soft);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
}

.chat-messages::-webkit-scrollbar {
    width: 5px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: #D3C8AC;
    border-radius: 4px;
}

.chat-empty {
    text-align: center;
    color: var(--ink-muted);
    font-size: 13px;
    padding: 40px 0;
}

.chat-message {
    display: flex;
    flex-direction: column;
    max-width: 85%;
}

.chat-message.user {
    align-self: flex-end;
    align-items: flex-end;
}

.chat-message.ai {
    align-self: flex-start;
    align-items: flex-start;
}

.chat-meta {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1px;
    color: var(--ink-muted);
    margin-bottom: 4px;
    text-transform: uppercase;
}

.chat-bubble {
    padding: 10px 14px;
    border-radius: var(--radius-md);
    font-size: 13.5px;
    line-height: 1.7;
    word-break: break-word;
    white-space: pre-wrap;
}

.chat-message.user .chat-bubble {
    background: var(--gradient-primary);
    color: #FDF8F0;
    border-bottom-right-radius: 4px;
}

.chat-message.ai .chat-bubble {
    background: var(--paper);
    border: 1px solid var(--line);
    color: var(--ink);
    border-bottom-left-radius: 4px;
}

.chat-input-wrap {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.chat-input-wrap textarea {
    width: 100%;
    resize: none;
    padding: 10px 12px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 13.5px;
    background: var(--paper);
    color: var(--ink);
    box-sizing: border-box;
}

.chat-input-wrap textarea:focus {
    outline: none;
    border-color: var(--amber);
    box-shadow: 0 0 0 3px rgba(184, 122, 14, 0.14);
}

.chat-input-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.chat-input-actions .btn-primary,
.chat-input-actions .btn-secondary {
    min-width: 90px;
}

/* ========== AI 视觉测试工具 ========== */
.vc-upload-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.vc-upload-box {
    position: relative;
    width: 160px;
    height: 120px;
    border: 1.5px dashed var(--line-strong);
    border-radius: var(--radius-md);
    cursor: pointer;
    overflow: hidden;
    transition: border-color .2s;
    background: var(--cream-soft);
    flex-shrink: 0;
}

.vc-upload-box:hover {
    border-color: var(--amber);
}

.vc-upload-box input[type="file"] {
    display: none;
}

.vc-upload-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    height: 100%;
    color: var(--ink-muted);
}

.vc-upload-placeholder .upload-icon svg {
    width: 30px;
    height: 30px;
}

.vc-upload-preview {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
}

.vc-upload-preview img,
.vc-upload-preview video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.vc-remove-btn {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 22px;
    height: 22px;
    border: none;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.65);
    color: #fff;
    font-size: 15px;
    line-height: 1;
    cursor: pointer;
    z-index: 2;
}

.vc-remove-btn:hover {
    background: rgba(180, 40, 40, 0.85);
}

/* 思考过程区域 */
.vc-reasoning {
    max-width: 85%;
    margin-bottom: 6px;
    align-self: flex-start;
    width: 100%;
}

.vc-reasoning-header {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    font-weight: 600;
    color: var(--ink-muted);
    cursor: pointer;
    user-select: none;
    padding: 3px 0;
}

.vc-reasoning-header:hover {
    color: var(--amber);
}

.vc-reasoning-toggle {
    font-size: 11px;
    color: var(--ink-muted);
    opacity: 0.7;
}

.vc-arrow {
    display: inline-block;
    font-size: 10px;
    transition: transform .15s;
}

.vc-reasoning-body {
    background: #F4EFE1;
    border: 1px solid var(--line);
    border-left: 3px solid var(--amber);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    font-size: 12.5px;
    line-height: 1.7;
    color: var(--ink-muted);
    white-space: pre-wrap;
    word-break: break-word;
    margin-top: 4px;
}

.vc-reasoning-collapsed {
    display: none !important;
}

/* 视频解析：全宽视频上传框 */
.vc-upload-box.vc-video-full {
    width: 100%;
    height: 240px;
}

/* 视频解析：四阶段流水线进度跟踪器 */
.vc-progress-row {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px 14px;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    margin-bottom: 10px;
    box-shadow: var(--shadow-sm);
}

.vc-stages {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}

.vc-stage {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    color: var(--ink-muted);
    padding: 3px 10px 3px 6px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: var(--cream-soft);
    transition: all .25s;
}

/* 阶段之间的箭头连接符 */
.vc-stage + .vc-stage {
    margin-left: 14px;
    position: relative;
}

.vc-stage + .vc-stage::before {
    content: '›';
    position: absolute;
    left: -13px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--line-strong, #C9BC97);
    font-size: 14px;
    font-weight: 700;
}

.vc-stage-dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid var(--line-strong, #C9BC97);
    background: var(--paper);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    color: #fff;
    transition: all .25s;
}

/* 进行中：琥珀渐变圆点 + 脉冲光环 + 整枚 chip 高亮 */
.vc-stage.active {
    color: var(--amber-dark);
    border-color: rgba(143, 95, 11, .45);
    background: rgba(183, 151, 51, .1);
}

.vc-stage.active .vc-stage-dot {
    background: var(--gradient-primary);
    border-color: transparent;
    animation: vc-pulse 1.4s ease-out infinite;
}

/* 已完成：琥珀对勾 */
.vc-stage.done {
    color: var(--ink-soft);
}

.vc-stage.done .vc-stage-dot {
    background: var(--amber-dark);
    border-color: var(--amber-dark);
}

.vc-stage.done .vc-stage-dot::after {
    content: '✓';
    line-height: 1;
}

/* 失败：红色叉号 + chip 红边 */
.vc-stage.error {
    color: #B3261E;
    border-color: rgba(179, 38, 30, .45);
    background: rgba(179, 38, 30, .06);
}

.vc-stage.error .vc-stage-dot {
    background: #B3261E;
    border-color: #B3261E;
    animation: none;
}

.vc-stage.error .vc-stage-dot::after {
    content: '✕';
    line-height: 1;
}

.vc-progress-text {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12.5px;
    line-height: 1.5;
    color: var(--amber-dark);
    word-break: break-all;
}

.vc-progress-text::before {
    content: '';
    width: 12px;
    height: 12px;
    flex-shrink: 0;
    border: 2px solid rgba(183, 151, 51, 0.25);
    border-top-color: var(--amber);
    border-radius: 50%;
    animation: vc-spin .8s linear infinite;
}

.vc-progress-text:empty {
    display: none;
}

.vc-progress-text.vc-progress-error {
    color: #B3261E;
}

.vc-progress-text.vc-progress-error::before {
    display: none;
}

@keyframes vc-spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes vc-pulse {
    0%   { box-shadow: 0 0 0 0 rgba(201, 94, 44, .45); }
    70%  { box-shadow: 0 0 0 6px rgba(201, 94, 44, 0); }
    100% { box-shadow: 0 0 0 0 rgba(201, 94, 44, 0); }
}

/* 视频解析：音频/视频解析结果分节卡片 */
.vc-section {
    margin: 6px 0;
    border: 1px solid var(--line);
    border-left: 3px solid var(--amber);
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--paper);
    box-shadow: var(--shadow-sm);
}

.vc-section-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    color: var(--ink);
    user-select: none;
    transition: background .2s;
}

.vc-section-header:hover {
    background: var(--cream-soft);
}

.vc-section-icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(183, 151, 51, .12);
    color: var(--amber-dark);
}

.vc-section-icon svg {
    width: 14px;
    height: 14px;
}

.vc-section-title {
    flex: 1;
    min-width: 0;
}

.vc-section-tag {
    flex-shrink: 0;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: .5px;
    color: var(--amber-dark);
    background: rgba(183, 151, 51, .1);
    border: 1px solid rgba(183, 151, 51, .25);
    border-radius: 999px;
    padding: 2px 8px;
}

.vc-section .vc-arrow {
    flex-shrink: 0;
    font-size: 11px;
    color: var(--ink-muted);
    transition: transform .2s;
}

.vc-section.vc-collapsed .vc-arrow {
    transform: rotate(-90deg);
}

.vc-section-body {
    padding: 12px 14px;
    font-size: 13px;
    line-height: 1.8;
    color: var(--ink-soft);
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 260px;
    overflow-y: auto;
    border-top: 1px dashed var(--line);
    background: var(--cream-soft);
}

.vc-section-collapsed {
    display: none !important;
}

/* ========== 图片裁剪工具 ========== */
#cropCanvasContainer {
    justify-content: center;
    align-items: center;
    width: 100%;
    flex: 1;
    min-height: 0;
    overflow: hidden;
    padding: 10px;
}

#cropCanvasContainer canvas {
    max-width: 100%;
    max-height: 55vh;
    display: block;
    border-radius: var(--radius-md);
    border: 1px solid var(--line);
    box-shadow: var(--shadow-sm);
    background: repeating-conic-gradient(#F0EBDC 0% 25%, transparent 0% 50%) 50% / 20px 20px;
}

#cropInfoBar {
    background: #F6ECDD;
    border: 1px solid var(--amber);
    border-radius: var(--radius-sm);
    padding: 8px 14px;
    font-size: 12px;
    color: var(--amber-dark);
    font-weight: 600;
    grid-column: 1 / -1;
    flex-shrink: 0;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

#cropHint {
    text-align: center;
    color: var(--ink-muted);
    font-size: 13px;
    margin-top: 10px;
}

#cropImageInfo .info-lines {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

/* ========== AI 教案生成工具 ========== */
.lesson-plan-tool-area {
    gap: 16px;
    /* 内容较长时保证可滚动，而不是撑破容器被 overflow:hidden 裁掉 */
    min-height: 0;
    padding-bottom: 4px;
}

.lp-section-title {
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 10.5px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--amber-dark);
    margin-bottom: 10px;
    flex-shrink: 0;
}

/* 注意：选择器必须与 index.html 中的 class="lesson-plan-form-section" 一致。
   此处必须保持 flex-shrink: 0 —— .tool-area 为 flex 列布局，
   若可收缩，内容超出容器时各区块会被压缩，底部的「游戏视频」上传框会被压到无法点击。 */
.lp-form-section,
.lesson-plan-form-section {
    background: var(--cream-soft);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    padding: 14px;
    flex-shrink: 0;
}

.lp-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px 16px;
}

.lp-form-grid .input-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 0;
}

.lp-form-grid .input-group label {
    margin-bottom: 0;
}

.lp-form-grid .input-group input,
.lp-form-grid .input-group textarea,
.lp-form-grid .input-group select {
    width: 100%;
    box-sizing: border-box;
    padding: 9px 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--paper);
    color: var(--ink);
    font-size: 13px;
    font-family: inherit;
}

.lp-form-grid .input-group select {
    cursor: pointer;
}

.lp-form-grid .input-group input:focus,
.lp-form-grid .input-group textarea:focus,
.lp-form-grid .input-group select:focus {
    outline: none;
    border-color: var(--amber-dark);
    box-shadow: 0 0 0 2px rgba(200, 150, 40, 0.15);
}

.lp-full-width {
    grid-column: 1 / -1;
}

.lp-section-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    cursor: pointer;
    user-select: none;
}

.lp-section-toggle:hover {
    opacity: 0.75;
}

.lp-section-toggle:focus-visible {
    outline: 2px solid var(--amber-dark);
    outline-offset: 3px;
    border-radius: var(--radius-sm);
}

.lp-toggle-icon {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.5px;
    color: var(--ink-muted);
    text-transform: none;
}

.lp-supplement-tip {
    background: var(--paper);
    border-left: 3px solid var(--amber-dark);
    border-radius: var(--radius-sm);
    padding: 9px 12px;
    margin-bottom: 12px;
    font-size: 12px;
    line-height: 1.7;
    color: var(--ink-muted);
}

.lp-supplement-tip strong {
    color: var(--ink);
    font-weight: 600;
}

.lp-video-upload {
    background: var(--paper);
    border: 1px dashed var(--line-strong, #C9BC97);
    border-radius: var(--radius-md);
    padding: 20px;
    text-align: center;
}

/* 注意：input[type=file] 由全局规则设为 display:none，此处不要改为可见。
   可见上传入口统一由 .lp-drop-zone（点击 + 拖拽）承担，已选文件在 .lp-file-list 中展示。 */
/* 仅收窄内边距以适配左侧窄栏；拖拽高亮(.dragover)与已选状态(.selected)复用 .upload-area 的既有样式 */
.lp-drop-zone {
    padding: 18px 14px;
}

.lp-file-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 10px;
}

.lp-file-list:empty {
    display: none;
}

.lp-file-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 7px 10px;
    font-size: 12px;
}

.lp-file-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--ink);
}

.lp-file-size {
    flex-shrink: 0;
    color: var(--ink-muted);
    font-variant-numeric: tabular-nums;
}

.lp-file-remove {
    flex-shrink: 0;
    border: none;
    background: transparent;
    color: var(--ink-muted);
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    padding: 2px 4px;
    border-radius: var(--radius-sm);
}

.lp-file-remove:hover {
    color: #c0392b;
    background: rgba(192, 57, 43, 0.08);
}

.lp-actions {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}

.lp-progress {
    background: var(--cream-soft);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-shrink: 0;
}

.lp-progress-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 4px;
    padding-top: 8px;
    border-top: 1px dashed var(--line);
}

.lp-poll-hint {
    flex: 1;
    min-width: 0;
    font-size: 11px;
    line-height: 1.6;
    color: var(--ink-muted);
}

.lp-keep-waiting {
    flex-shrink: 0;
    padding: 4px 10px;
    font-size: 11px;
}

/* 教案生成进度：竖向步骤条（编号徽标 + 连接线 + 标题/副标题） */
.lp-progress-title {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--ink-muted);
    padding-bottom: 4px;
}

.lp-progress-step {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    position: relative;
    padding-bottom: 14px;
}

#lpStepDocx {
    padding-bottom: 0;
}

/* 步骤之间的连接线（从当前徽标底部连到下一步徽标顶部） */
.lp-progress-step::after {
    content: '';
    position: absolute;
    left: 12px;
    top: 28px;
    bottom: 2px;
    width: 2px;
    border-radius: 2px;
    background: var(--line-strong, #C9BC97);
    opacity: .45;
}

#lpStepDocx::after {
    display: none;
}

.lp-progress-step.done::after {
    background: var(--amber-dark);
    opacity: .8;
}

.lp-step-badge {
    flex-shrink: 0;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    color: var(--ink-muted);
    background: var(--paper);
    border: 2px solid var(--line-strong, #C9BC97);
    position: relative;
    z-index: 1;
    transition: all .25s;
}

.lp-step-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    padding-top: 2px;
}

.lp-step-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--ink-muted);
    line-height: 1.5;
    transition: color .25s;
}

.lp-step-desc {
    font-size: 11px;
    line-height: 1.5;
    color: var(--ink-muted);
    opacity: .8;
}

/* 进行中：琥珀渐变徽标 + 脉冲光环 + 标题高亮 */
.lp-progress-step.active .lp-step-badge {
    background: var(--gradient-primary);
    border-color: transparent;
    color: #FDF8F0;
    animation: lp-pulse 1.4s ease-out infinite;
}

.lp-progress-step.active .lp-step-title {
    color: var(--amber-dark);
}

.lp-progress-step.active .lp-step-desc::after {
    content: ' · 进行中';
    color: var(--amber-dark);
    font-weight: 600;
}

/* 已完成：琥珀徽标 + 对勾，编号隐藏 */
.lp-progress-step.done .lp-step-badge {
    background: var(--amber-dark);
    border-color: var(--amber-dark);
    color: #fff;
}

.lp-progress-step.done .lp-step-num {
    display: none;
}

.lp-progress-step.done .lp-step-badge::after {
    content: '✓';
    font-size: 13px;
    line-height: 1;
}

.lp-progress-step.done .lp-step-title {
    color: var(--ink);
}

/* 失败：红色徽标 + 叉号 */
.lp-progress-step.error .lp-step-badge {
    background: #B3261E;
    border-color: #B3261E;
    color: #fff;
    animation: none;
}

.lp-progress-step.error .lp-step-num {
    display: none;
}

.lp-progress-step.error .lp-step-badge::after {
    content: '✕';
    font-size: 12px;
    line-height: 1;
}

.lp-progress-step.error .lp-step-title {
    color: #B3261E;
}

@keyframes lp-pulse {
    0%   { box-shadow: 0 0 0 0 rgba(201, 94, 44, .45); }
    70%  { box-shadow: 0 0 0 8px rgba(201, 94, 44, 0); }
    100% { box-shadow: 0 0 0 0 rgba(201, 94, 44, 0); }
}

.lp-result {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    padding: 14px;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.lp-result-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    flex-shrink: 0;
}

.lp-result-header > span {
    font-weight: 700;
    font-size: 15px;
    color: var(--ink);
}

.lp-result-actions {
    display: flex;
    gap: 10px;
}

#lpPreviewContainer {
    overflow: auto;
    max-height: 60vh;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: #fff;
    padding: 8px;
}

#lpPreviewContainer .docx-wrapper {
    margin: 0 auto;
}

/* ========== 响应式 ========== */
@media (max-width: 920px) {
    body {
        flex-direction: column;
        height: auto;
        overflow: auto;
    }

    .main-content {
        margin-left: 0;
        height: auto;
        overflow: visible;
    }

    .container {
        grid-template-columns: minmax(0, 1fr);
        height: auto;
        min-height: 60vh;
        overflow: visible;
    }

    .comparison-container.show {
        flex-direction: column;
        max-height: none;
    }
}

/* ========== 无障碍：减少动画偏好 ========== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ========== Excel 转 CSV 导出列勾选 ========== */
.etc-col-actions {
    display: flex;
    gap: 8px;
    margin: 8px 0;
}
.etc-col-actions .btn-sm {
    padding: 4px 12px;
    font-size: 12px;
}
.etc-col-picker {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 6px;
    max-height: 180px;
    overflow-y: auto;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 10px;
    background: var(--paper);
}
.etc-col-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 6px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    line-height: 1.4;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}
.etc-col-item:hover {
    background: var(--orange-tint);
}
.etc-col-item input[type="checkbox"] {
    flex-shrink: 0;
    accent-color: var(--orange);
}

/* ========== Excel 转 CSV 数据预览表格 ========== */
.etc-preview-wrap {
    margin-top: 10px;
    max-width: 100%;
}

.etc-preview-wrap-inner {
    max-height: 300px;
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--paper);
}

.etc-preview-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    line-height: 1.5;
    white-space: nowrap;
}

.etc-preview-table th,
.etc-preview-table td {
    padding: 6px 10px;
    border-bottom: 1px solid var(--line-soft);
    border-right: 1px solid var(--line-soft);
    text-align: left;
    color: var(--ink-soft);
    max-width: 240px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.etc-preview-table th:last-child,
.etc-preview-table td:last-child {
    border-right: none;
}

.etc-preview-table thead th {
    position: sticky;
    top: 0;
    background: var(--cream-soft);
    color: var(--ink);
    font-weight: 600;
    border-bottom: 1px solid var(--line-strong);
    z-index: 1;
}

.etc-preview-table tbody tr:nth-child(even) {
    background: var(--cream-soft);
}

.etc-preview-table tbody tr:hover {
    background: var(--orange-tint);
}

.etc-preview-table .etc-empty-cell {
    text-align: center;
    color: var(--ink-muted);
    padding: 16px 10px;
}
