/* 文档工具集公共样式 */

.tool-header {
    padding: 24px 28px 16px;
    border-bottom: 1px solid #f0f0f0;
}

.tool-header h1 {
    font-size: 22px;
    font-weight: 700;
    color: #1a202c;
    margin-bottom: 4px;
}

.tool-header p {
    font-size: 13px;
    color: #6b7280;
}

/* 主体卡片（工具页 — 占满内容区） */
.tool-card {
    box-sizing: border-box;
    width: auto;
    max-width: 100%;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
    padding: 24px;
    margin: 20px 28px;
}

@media (max-width: 768px) {
    /* Phone: title lives in .tool-mobile-bar (base.js); hide duplicate tool-header */
    .content > .tool-mobile-bar ~ .tool-header {
        display: none;
    }

    .tool-card {
        width: 100%;
        max-width: 100%;
        margin: 0 0 16px;
        padding: 16px;
    }
}

/* 拖放区域 */
.drop-zone {
    border: 2px dashed #d1d5db;
    border-radius: 10px;
    background: #f9fafb;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
    text-align: center;
    min-height: 160px;
}

.drop-zone:hover,
.drop-zone.drag-over {
    border-color: #3b82f6;
    background: #eff6ff;
}

.drop-zone .drop-icon {
    font-size: 40px;
    margin-bottom: 12px;
    color: #9ca3af;
}

.drop-zone .drop-title {
    font-size: 15px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 4px;
}

.drop-zone .drop-hint {
    font-size: 12px;
    color: #9ca3af;
}

.drop-zone.has-file {
    border-color: #10b981;
    background: #f0fdf4;
}

.drop-zone.has-file .drop-icon {
    color: #10b981;
}

/* 文件信息行 */
.file-info-row {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f3f4f6;
    border-radius: 8px;
    padding: 10px 14px;
    margin-top: 14px;
    font-size: 13px;
    color: #374151;
}

.file-info-row .file-icon {
    font-size: 22px;
}

.file-info-row .file-name {
    font-weight: 600;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-info-row .file-size {
    color: #9ca3af;
    font-size: 12px;
    white-space: nowrap;
}

.file-info-row .remove-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: #ef4444;
    font-size: 16px;
    padding: 2px 6px;
    border-radius: 4px;
    transition: background 0.15s;
    line-height: 1;
}

.file-info-row .remove-btn:hover {
    background: #fee2e2;
}

/* 操作按钮区 — 间距以 base.css .action-row 为准（gap: 12px） */
.action-row {
    display: flex;
    gap: 12px;
    margin-top: 20px;
    flex-wrap: wrap;
}

/* 按钮样式见 base.css .tb-btn */

/* 进度条 */
.progress-wrap {
    margin-top: 20px;
    display: none;
}

.progress-label {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 6px;
}

.progress-bar-bg {
    background: #e5e7eb;
    border-radius: 99px;
    height: 8px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    border-radius: 99px;
    background: linear-gradient(90deg, #3b82f6, #2563eb);
    width: 0%;
    transition: width 0.3s ease;
}

/* 结果区 */
.result-wrap {
    margin-top: 24px;
    display: none;
    max-width: 100%;
    min-width: 0;
}

.result-box {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 10px;
    padding: 16px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    min-width: 0;
}

.result-box .result-icon {
    font-size: 36px;
    flex-shrink: 0;
}

.result-box .result-info {
    flex: 1 1 12rem;
    min-width: 0;
    max-width: 100%;
}

.result-box .result-name {
    display: block;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    font-size: 15px;
    font-weight: 600;
    color: #065f46;
    margin-bottom: 2px;
    overflow-wrap: anywhere;
    word-break: break-all;
    white-space: normal;
}

.result-box .result-size {
    font-size: 12px;
    color: #6b7280;
}

.result-box .tb-btn {
    margin-left: auto;
    flex-shrink: 0;
}

@media (max-width: 640px) {
    .result-box {
        flex-direction: column;
        align-items: stretch;
    }

    .result-box .result-icon {
        align-self: flex-start;
    }

    .result-box .result-info {
        flex: 0 0 auto;
        width: 100%;
    }

    .result-box .tb-btn {
        margin-left: 0;
        width: 100%;
    }
}

/* 错误提示 */
.error-box {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 10px;
    padding: 14px 18px;
    color: #dc2626;
    font-size: 13px;
    margin-top: 16px;
    display: none;
    align-items: center;
    gap: 8px;
}

.error-box.show {
    display: flex;
}

/* 图片列表（图片转PDF用）*/
.img-list {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 16px;
}

.img-item {
    position: relative;
    width: 110px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
    background: #f9fafb;
}

.img-item img {
    width: 100%;
    height: 80px;
    object-fit: cover;
    display: block;
}

.img-item .img-caption {
    font-size: 11px;
    color: #6b7280;
    padding: 4px 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center;
}

.img-item .img-remove {
    position: absolute;
    top: 3px;
    right: 3px;
    background: rgba(0,0,0,0.55);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 12px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}

.img-item .img-remove:hover {
    background: #ef4444;
}

.img-add-btn {
    width: 110px;
    height: 108px;
    border: 2px dashed #d1d5db;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #9ca3af;
    font-size: 28px;
    transition: border-color 0.2s, color 0.2s;
    background: #f9fafb;
    flex-shrink: 0;
}

.img-add-btn:hover {
    border-color: #3b82f6;
    color: #3b82f6;
}

.img-add-btn span {
    font-size: 11px;
    margin-top: 4px;
}

/* PDF选项 */
.options-row {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-top: 16px;
    align-items: center;
}

.options-row label {
    font-size: 13px;
    color: #374151;
    display: flex;
    align-items: center;
    gap: 6px;
}

.options-row select {
    border: 1px solid #d1d5db;
    border-radius: 6px;
    padding: 5px 10px;
    font-size: 13px;
    color: #374151;
    background: #fff;
    cursor: pointer;
}

/* 提示信息 */
.tip-box {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 12px;
    color: #1e40af;
    margin-top: 16px;
    line-height: 1.6;
}

.tip-box b {
    font-weight: 700;
}
