/* ===== 上傳書籍页面（HX 主题，纯前端） ===== */

/* 短内容时让页脚沉到页面底部（仅作用于上传页，body 类由 upload.js 添加）。
   body 直接子元素中参与文档流的只有 .main 与 footer，其余均为 fixed/隐藏，flex 不影响。 */
body.hx-upload-body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

    body.hx-upload-body .main {
        flex: 1 0 auto;
    }

    body.hx-upload-body footer {
        flex-shrink: 0;
    }

.hx-upload-page {
    max-width: 720px;
    margin: 0 auto;
    /* 顶部留出固定头部(Logo 行 + 分类导航)的空间；
       固定头部高度随宽度变化，精确值由 upload.js 按实际头部高度动态设置，这里只是兜底。 */
    padding: 150px 16px 40px;
}

@media (max-width: 768px) {
    .hx-upload-page {
        padding-top: 110px;
    }
}

/* 头部 */
.hx-upload-header {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 48px;
}

.hx-upload-back {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    margin-left: -6px;
    border-radius: 50%;
    color: var(--color-333);
    text-decoration: none;
}

    .hx-upload-back:active {
        background: var(--color-efefef);
    }

.hx-upload-title {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: var(--color-333);
}

/* 卡片容器 */
.hx-upload-card {
    margin-top: 8px;
    background: var(--white-color);
    border: 1px solid var(--color-ddd);
    border-radius: 12px;
    padding: 16px;
}

/* 拖拽 / 点击 区 */
.hx-upload-drop {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 36px 16px;
    border: 2px dashed var(--color-ddd);
    border-radius: 10px;
    background: var(--primary-bg-color);
    color: var(--color-666);
    cursor: pointer;
    text-align: center;
    transition: border-color .18s ease, background .18s ease, color .18s ease;
}

    .hx-upload-drop:hover,
    .hx-upload-drop:focus-visible {
        border-color: var(--primary-color);
        color: var(--primary-color);
        outline: none;
    }

    .hx-upload-drop.is-dragover {
        border-color: var(--primary-color);
        background: var(--primary-light-color);
        color: var(--primary-color);
    }

.hx-upload-drop-icon {
    color: var(--primary-color);
    line-height: 0;
}

.hx-upload-drop-main {
    margin: 4px 0 0;
    font-size: 15px;
    font-weight: 600;
    color: var(--color-333);
}

.hx-upload-drop-sub {
    margin: 0;
    font-size: 12px;
    color: var(--color-999);
}

/* 已选文件列表 */
.hx-upload-list {
    list-style: none;
    margin: 14px 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

    .hx-upload-list:empty {
        display: none;
    }

.hx-upload-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid var(--color-ddd);
    border-radius: 8px;
    background: var(--white-color);
}

.hx-upload-item-ext {
    flex: 0 0 auto;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: .3px;
}

    .hx-upload-item-ext.ext-txt { background: #6B7280; }
    .hx-upload-item-ext.ext-pdf { background: #E5534B; }
    .hx-upload-item-ext.ext-doc { background: #2B7CD3; }

.hx-upload-item-info {
    flex: 1 1 auto;
    min-width: 0;
}

.hx-upload-item-name {
    font-size: 14px;
    color: var(--color-333);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hx-upload-item-size {
    margin-top: 2px;
    font-size: 12px;
    color: var(--color-999);
}

.hx-upload-item-remove {
    flex: 0 0 auto;
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    color: var(--color-999);
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    border-radius: 50%;
}

    .hx-upload-item-remove:hover {
        background: var(--color-efefef);
        color: var(--color-333);
    }

/* 操作区 */
.hx-upload-actions {
    margin-top: 16px;
}

.hx-upload-submit {
    width: 100%;
    height: 46px;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--primary-color-2) 0%, var(--primary-color) 100%);
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: opacity .18s ease;
}

    .hx-upload-submit:hover:not(:disabled) {
        opacity: .92;
    }

    .hx-upload-submit:disabled {
        opacity: .5;
        cursor: not-allowed;
    }

.hx-upload-tip {
    margin: 10px 0 0;
    text-align: center;
    font-size: 12px;
    color: var(--color-999);
}
