/* 文件处理：对齐图片工具箱三栏布局 */
.file-tools-page {
    background: #000;
}

.ft-catalog-sub {
    margin: -8px 0 18px;
    font-size: 13px;
    line-height: 1.5;
    color: #8a8578;
    max-width: 640px;
}

/* 工作台三栏：复用 image-tools 同款尺寸 */
.file-tools-page .tb-workspace > .home-content {
    height: calc(100vh - 60px);
    padding: 16px 14px 0 24px;
    width: 100%;
    display: flex;
    align-items: stretch;
    justify-content: flex-start;
    gap: 12px;
    overflow: hidden;
    box-sizing: border-box;
    max-width: none;
    margin: 0;
}

.file-tools-page .tb-workspace .left-border {
    width: 346px;
    height: calc(100vh - 76px);
    max-height: calc(100vh - 76px);
    flex-shrink: 0;
    align-self: flex-start;
}

.file-tools-page .tb-workspace .left-border .left {
    height: 100%;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.file-tools-page .tb-workspace .left-content {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding-bottom: 20px;
}

.file-tools-page .tb-workspace .right {
    flex: 1 1 auto;
    min-width: 0;
    height: calc(100vh - 76px);
    max-height: calc(100vh - 76px);
    padding: 0 4px 0 0;
    box-sizing: border-box;
}

.file-tools-page .tb-workspace .it-right-panel {
    height: 100%;
    margin-top: 0;
    display: flex;
    flex-direction: column;
}

.file-tools-page .it-preview-stage {
    flex: 1;
    min-height: 0;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.file-tools-page .tb-seo-doc {
    flex: 0 0 300px;
    width: 300px;
    height: calc(100vh - 76px);
    max-height: calc(100vh - 76px);
    box-sizing: border-box;
    border: 1px solid #242424;
    border-radius: 16px 16px 0 0;
    background: #0c0c0c;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-self: flex-start;
}

.ft-settings {
    margin-top: 10px;
    padding: 0 21px;
    box-sizing: border-box;
}

.ft-field {
    margin-bottom: 12px;
}

.file-tools-page .ft-field .style-box,
.file-tools-page .ft-field .style-box.it-setting-block {
    margin-left: 0;
    margin-right: 0;
    justify-content: flex-start;
}

.ft-field .it-select,
.ft-field input.it-select,
.ft-field select.it-select {
    display: block;
    width: 100%;
    max-width: 100%;
    margin: 0;
    box-sizing: border-box;
}

.ft-hint {
    font-size: 12px;
    line-height: 1.55;
    color: #8a8578;
    padding: 8px 10px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    border: 1px solid #2a2a2a;
    text-align: left;
}

.ft-range-row {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    box-sizing: border-box;
}

.ft-range-row input[type="range"] {
    flex: 1 1 auto;
    min-width: 0;
    width: auto;
    margin: 0;
    display: block;
    accent-color: #d4af69;
    height: 22px;
}

.ft-range-val {
    flex: 0 0 auto;
    min-width: 42px;
    text-align: right;
    color: #c4b896;
    font-size: 12px;
}

.ft-file-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 180px;
    overflow: auto;
}

.ft-file-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: #141414;
    border: 1px solid #2c2c2c;
    border-radius: 8px;
    color: #ddd;
    font-size: 13px;
    cursor: grab;
}

.ft-file-ord {
    width: 22px;
    height: 22px;
    border-radius: 6px;
    background: rgba(212, 175, 105, 0.15);
    color: #d4af69;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    flex-shrink: 0;
}

.ft-file-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ft-file-size {
    color: #888;
    font-size: 12px;
    flex-shrink: 0;
}

.ft-file-del {
    border: 0;
    background: transparent;
    color: #999;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    padding: 0 4px;
}

.ft-file-del:hover {
    color: #e07070;
}

.ft-extra-btn {
    width: 100%;
    height: 40px;
    border-radius: 8px;
    border: 1px dashed #3a3a3a;
    background: #121212;
    color: #c4b896;
    cursor: pointer;
}

.ft-extra-name {
    margin-top: 6px;
    font-size: 12px;
    color: #888;
}

.ft-progress {
    margin: 10px 0 4px;
}

.ft-progress-bar {
    height: 6px;
    border-radius: 99px;
    background: #222;
    overflow: hidden;
}

.ft-progress-bar i {
    display: block;
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, #b8860b, #f0d78c);
    transition: width 0.2s ease;
}

.ft-progress-text {
    margin-top: 6px;
    font-size: 12px;
    color: #9a9486;
}

.file-tools-page .advice-relative {
    margin-top: 12px;
    justify-content: flex-start;
    width: 100%;
}
.file-tools-page .advice {
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 6px;
    width: 100%;
    box-sizing: border-box;
    color: #848484;
    font-size: 12px;
    line-height: 1.5;
    cursor: default;
}
.file-tools-page .advice img {
    width: 13px;
    height: 13px;
    margin-top: 2px;
    margin-right: 0;
    flex-shrink: 0;
}
.file-tools-page .advice .tips {
    flex: 1;
    text-align: left;
    text-decoration: none;
    color: #848484;
}

.file-tools-page .it-quota-tip {
    margin: 10px 0 0;
    padding: 8px 10px;
    border-radius: 8px;
    background: rgba(212, 175, 105, .08);
    border: 1px solid rgba(212, 175, 105, .28);
    color: #c9b07a;
    font-size: 12px;
    line-height: 1.45;
    cursor: pointer;
}
.file-tools-page .it-quota-tip.warn {
    background: rgba(180, 60, 60, .12);
    border-color: rgba(200, 90, 90, .35);
    color: #d98888;
}

.file-tools-page .generation-btn,
.file-tools-page .generation-btn.download-btn {
    display: block;
    width: 275px;
    max-width: calc(100% - 42px);
    height: 54px;
    min-height: 54px;
    max-height: 54px;
    margin: 16px auto 12px;
    padding: 0 16px;
    box-sizing: border-box;
    border: 0;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 500;
    line-height: 54px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
}

.file-tools-page .generation-btn:disabled {
    opacity: 0.55;
    cursor: wait;
}

.file-tools-page .download-btn {
    margin-top: 0;
    margin-bottom: 28px;
    background: linear-gradient(135deg, #f0d78c 0%, #d4af69 100%);
}

.file-tools-page .ft-progress,
.file-tools-page .ft-progress[hidden] {
    display: none !important;
}

.file-tools-page .generation-btn[hidden],
.file-tools-page .download-btn[hidden],
.file-tools-page .result-stats[hidden],
.file-tools-page .ft-progress[hidden] {
    display: none !important;
}

.ft-preview-body {
    position: absolute;
    inset: 0;
    width: auto;
    height: auto;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 16px;
    box-sizing: border-box;
    overflow: auto;
}

.ft-preview-body[hidden] {
    display: none !important;
}

.ft-preview-media {
    max-width: 100%;
    text-align: center;
}

.ft-preview-media img {
    max-width: 100%;
    max-height: calc(100vh - 220px);
    border-radius: 8px;
    border: 1px solid #2a2a2a;
}

.ft-preview-file {
    color: #aaa;
    font-size: 13px;
    line-height: 1.7;
}

.ft-preview-file code {
    color: #d4af69;
}

.ft-preview-text {
    margin: 0;
    padding: 12px;
    width: 100%;
    max-height: calc(100vh - 220px);
    overflow: auto;
    background: #111;
    border: 1px solid #2a2a2a;
    border-radius: 8px;
    color: #ccc;
    font-size: 12px;
    white-space: pre-wrap;
    word-break: break-word;
    box-sizing: border-box;
    text-align: left;
}

/* 空态：绝对铺满预览区，内容垂直水平居中 */
.file-tools-page .ft-preview-idle {
    position: absolute;
    inset: 0;
    width: auto;
    height: auto;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background:
        radial-gradient(ellipse 55% 40% at 50% 42%, rgba(212, 175, 105, 0.08), transparent 70%);
}

.file-tools-page .ft-preview-idle[hidden] {
    display: none !important;
}

.ft-idle-doc {
    position: absolute;
    inset: 42px;
    border-radius: 14px 18px 14px 14px;
    background:
        linear-gradient(160deg, rgba(245, 232, 184, 0.16), rgba(212, 175, 105, 0.06) 45%, rgba(255, 255, 255, 0.03));
    border: 1px solid rgba(212, 175, 105, 0.32);
    box-shadow:
        inset 0 0 24px rgba(212, 175, 105, 0.08),
        0 12px 28px rgba(0, 0, 0, 0.28);
    animation: idleFloat 3.6s ease-in-out infinite;
}

.ft-idle-doc-fold {
    position: absolute;
    top: 0;
    right: 0;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 0 22px 22px 0;
    border-color: transparent rgba(212, 175, 105, 0.45) transparent transparent;
    filter: drop-shadow(-1px 1px 0 rgba(0, 0, 0, 0.2));
}

.ft-idle-doc-line {
    position: absolute;
    left: 18%;
    right: 18%;
    height: 2px;
    border-radius: 2px;
    background: rgba(212, 175, 105, 0.35);
}

.ft-idle-doc-line:nth-of-type(2) { top: 38%; }
.ft-idle-doc-line:nth-of-type(3) { top: 52%; }
.ft-idle-doc-line:nth-of-type(4) { top: 66%; }
.ft-idle-doc-line.short { right: 32%; }

.file-tools-page .ft-preview-loading {
    position: absolute;
    inset: 0;
    z-index: 3;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.82);
    backdrop-filter: blur(2px);
}

.file-tools-page .ft-preview-loading[hidden] {
    display: none !important;
}

.file-tools-page .ft-preview-loading .gen-progress-bar {
    width: 0;
    transition: width 0.25s ease;
    animation: none;
}

.file-tools-page .upload-simple.dragover {
    border-color: rgba(212, 175, 105, 0.7);
    background: rgba(212, 175, 105, 0.06);
}

@media (max-width: 1100px) {
    .file-tools-page .tb-seo-doc {
        display: none;
    }
}

@media (max-width: 900px) {
    .file-tools-page .tb-workspace > .home-content {
        height: auto;
        min-height: calc(100vh - 60px);
        flex-direction: column;
        overflow: auto;
        padding: 12px;
    }
    .file-tools-page .tb-workspace .left-border,
    .file-tools-page .tb-workspace .right {
        width: 100%;
        height: auto;
        max-height: none;
    }
    .file-tools-page .tb-workspace .right {
        min-height: 360px;
    }
}
