/* ============================================================
   TotalPDF 工具页样式（/pdf_* 转换、处理类页面）
   由 App/Home/View/Index/base_convert.html 引用
   通用组件（面板/表格/按钮/表单）由 ui.css 提供
   ============================================================ */

body.cf-body {
    background: #f6f8fb;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body.cf-body .container.manual-body {
    max-width: 1020px;
    padding-top: 16px;
    padding-bottom: 10px;
}

body.cf-body .cate-list {
    margin-top: 0;
}

/* ---------- 顶部分类导航 ---------- */
.cf-nav {
    position: -webkit-sticky;
    position: sticky;
    top: 8px;
    z-index: 30;
    margin: 0 0 16px;
    padding: 0 10px;
    background: rgba(255, 255, 255, .93);
    border: 1px solid #e9edf3;
    border-radius: 16px;
    box-shadow: 0 12px 28px -24px rgba(15, 23, 42, .5);
    -webkit-backdrop-filter: saturate(180%) blur(14px);
    backdrop-filter: saturate(180%) blur(14px);
}

.cf-nav-list {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 9px 0;
    margin: 0;
}

.cf-nav-list > li {
    float: none;
}

.cf-nav-list > li > a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    font-size: 13px;
    font-weight: 500;
    color: #4a5a70;
    white-space: nowrap;
    background: transparent;
    border-radius: 999px;
    transition: color .16s ease, background .16s ease, box-shadow .16s ease;
}

.cf-nav-list > li > a:hover,
.cf-nav-list > li > a:focus {
    color: #0b1220;
    background: #eef2f8;
}

.cf-nav-list > li.active > a,
.cf-nav-list > li.active > a:hover {
    color: #ffffff;
    background: linear-gradient(135deg, #e11d74 0%, #c026d3 100%);
    box-shadow: 0 10px 20px -12px rgba(192, 38, 211, .95);
}

.cf-nav-list .caret {
    margin-left: 4px;
    border-top-color: currentColor;
}

.cf-nav .dropdown-menu {
    min-width: 260px;
    max-height: 68vh;
    margin-top: 6px;
    padding: 8px;
    overflow: auto;
    border: 1px solid #e9edf3;
    border-radius: 14px;
    box-shadow: 0 26px 50px -34px rgba(15, 23, 42, .55);
}

/* 下拉菜单与主菜单之间有 6px 视觉空隙，鼠标穿过时会触发 mouseleave 导致菜单关闭，
   这里用一条透明区域把 li 的悬停范围一直延伸到菜单顶部 */
.cf-nav-list > li.dropdown::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    height: 10px;
}

.cf-menu > li > a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    font-size: 13px;
    line-height: 1.5;
    color: #334155;
    white-space: normal;
    border-radius: 9px;
}

.cf-menu > li > a:hover,
.cf-menu > li > a:focus {
    color: #c2185b;
    background: #fff5f9;
}

.cf-menu img {
    flex: 0 0 22px;
    width: 22px;
    height: 22px;
    object-fit: contain;
}

/* ---------- 工具头部（说明卡） ---------- */
.cf-hero {
    position: relative;
    margin-bottom: 16px;
    overflow: hidden;
    background: #ffffff;
    border: 1px solid #e9edf3;
    border-radius: 18px;
    box-shadow: 0 18px 44px -40px rgba(15, 23, 42, .55);
}

.cf-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(520px 240px at 6% -30%, rgba(219, 39, 119, .12), rgba(255, 255, 255, 0) 70%),
        radial-gradient(480px 220px at 94% -20%, rgba(124, 58, 237, .10), rgba(255, 255, 255, 0) 70%);
    pointer-events: none;
}

.cf-hero-head {
    position: relative;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 22px 24px;
    cursor: pointer;
}

.cf-hero-ico {
    flex: 0 0 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    font-size: 20px;
    color: #ffffff;
    background: linear-gradient(135deg, #e11d74 0%, #c026d3 100%);
    border-radius: 14px;
    box-shadow: 0 14px 26px -18px rgba(192, 38, 211, .95);
}

.cf-hero-title {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    line-height: 1.35;
    letter-spacing: -.01em;
    color: #0b1220;
}

.cf-hero-title sup {
    display: inline-block;
    margin-left: 6px;
    padding: 2px 7px;
    font-size: 10px;
    font-weight: 700;
    line-height: 1.5;
    letter-spacing: .04em;
    text-transform: uppercase;
    vertical-align: 3px;
    color: #d6154f !important;
    background: #ffe8ef;
    border: 1px solid #ffd0e0;
    border-radius: 6px;
}

.cf-hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 9px;
}

.cf-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    font-size: 12px;
    color: #5b6b82;
    background: #f5f7fb;
    border: 1px solid #e9edf3;
    border-radius: 999px;
}

.cf-chip .fa {
    font-size: 11px;
    opacity: .8;
}

.cf-chip-warn {
    color: #b45309;
    background: #fffbeb;
    border-color: #fde3c2;
}

.cf-hero-toggle {
    margin-left: auto;
    padding-left: 12px;
    color: #a7b3c4;
    font-size: 14px;
}

.cf-hero-collapse {
    position: relative;
    padding: 0 24px 24px;
}

.cf-hero-text {
    max-width: 80ch;
    margin: 0;
    font-size: 13.5px;
    line-height: 1.95;
    color: #5b6b82;
}

/* ---------- 上传区 ---------- */
.cf-drop {
    margin-top: 20px;
    padding: 26px 18px 22px;
    text-align: center;
    background: linear-gradient(180deg, #fffafc 0%, #ffffff 70%);
    border: 1.5px dashed #eec9d9;
    border-radius: 16px;
}

.cf-drop-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-width: 240px;
    height: 48px;
    padding: 0 26px;
    font-size: 15px;
    font-weight: 600;
    color: #ffffff;
    text-decoration: none;
    background: linear-gradient(135deg, #e11d74 0%, #c026d3 100%);
    border-radius: 12px;
    box-shadow: 0 18px 30px -20px rgba(192, 38, 211, .95);
    cursor: pointer;
    transition: transform .16s ease, box-shadow .16s ease, color .16s ease;
}

.cf-drop-btn:hover,
.cf-drop-btn:focus {
    color: #ffffff;
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 22px 34px -20px rgba(192, 38, 211, 1);
}

.cf-drop-hint {
    margin: 12px 0 0;
    font-size: 12.5px;
    color: #93a3b8;
}

.cf-drop-status {
    margin: 14px 0 0;
    font-size: 12.5px;
    color: #8b98ab;
}

.cf-drop-status strong {
    color: #c2185b;
    font-weight: 600;
}

.cf-drop-list {
    max-height: 190px;
    margin-top: 10px;
    overflow: auto;
}

.cf-drop-list br {
    display: none;
}

.cf-drop-list small,
.cf-drop-list .u-item {
    display: block;
    margin: 0 auto 6px;
    padding: 7px 12px;
    max-width: 560px;
    font-size: 12.5px;
    text-align: left;
    color: #334155;
    background: #ffffff;
    border: 1px solid #eef1f6;
    border-radius: 9px;
}

/* ---------- 参数面板（37 个页面共用同一套标记） ---------- */
body.cf-body .panel {
    margin-bottom: 16px;
    border-color: #e9edf3;
    border-radius: 16px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .03);
}

body.cf-body .panel > .panel-heading {
    padding: 16px 20px;
    background: #ffffff;
    border-bottom: 1px solid #eef1f6;
    border-radius: 16px 16px 0 0;
}

body.cf-body .panel-title {
    margin: 0;
    font-size: 15.5px;
    font-weight: 700;
    color: #0b1220;
}

body.cf-body .panel-title > span {
    font-weight: 700 !important;
}

body.cf-body .panel-title .fa-angle-double-right::before {
    content: "\f1de"; /* fa-sliders */
}

body.cf-body .panel-title .fa-angle-double-right {
    color: #c2185b;
}

/* 表格里的 hot 标记 */
body.cf-body .table td sup,
body.cf-body .table th sup {
    display: inline-block;
    margin-left: 3px;
    padding: 1px 5px;
    font-size: 9.5px;
    font-weight: 700;
    line-height: 1.5;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: #d6154f !important;
    background: #ffe8ef;
    border: 1px solid #ffd0e0;
    border-radius: 5px;
}

body.cf-body .panel-body {
    padding: 18px 20px;
}

body.cf-body .panel-body .caret {
    border-top-color: currentColor;
}

/* 参数选项：只有单选/多选控件才做成胶囊 */
body.cf-body .panel-body .radio-inline,
body.cf-body .panel-body .checkbox-inline {
    margin: 0 8px 8px 0;
    padding: 0;
    font-size: 13.5px;
    color: #334155;
    border: 0;
    background: transparent;
}

body.cf-body .panel-body .radio-inline:has(input[type="radio"]),
body.cf-body .panel-body .checkbox-inline:has(input[type="checkbox"]) {
    display: inline-flex;
    align-items: center;
    padding: 8px 14px;
    background: #ffffff;
    border: 1px solid #e9edf3;
    border-radius: 10px;
    cursor: pointer;
    transition: border-color .16s ease, background .16s ease, box-shadow .16s ease;
}

body.cf-body .panel-body .radio-inline:has(input[type="radio"]):hover,
body.cf-body .panel-body .checkbox-inline:has(input[type="checkbox"]):hover {
    border-color: #f6c9dc;
    background: #fffafc;
}

body.cf-body .panel-body .radio-inline:has(input[type="radio"]:checked),
body.cf-body .panel-body .checkbox-inline:has(input[type="checkbox"]:checked) {
    color: #c2185b;
    border-color: #ec4899;
    background: #fff5f9;
    box-shadow: 0 0 0 3px rgba(225, 29, 116, .06);
}

body.cf-body .panel-body .radio-inline input,
body.cf-body .panel-body .checkbox-inline input {
    position: static;
    margin: 0 7px 0 0;
}

body.cf-body .panel-body .radio-inline .text-danger sup {
    margin-left: 2px;
}

/* 竖排单选项（部分页面用 div.radio 而非 radio-inline） */
body.cf-body .panel-body .radio,
body.cf-body .panel-body .checkbox {
    margin: 0 0 8px;
    padding: 0;
}

body.cf-body .panel-body .radio > label,
body.cf-body .panel-body .checkbox > label {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    width: -moz-fit-content;
    width: fit-content;
    max-width: 100%;
    margin: 0;
    padding: 8px 14px;
    font-size: 13.5px;
    font-weight: 400;
    color: #334155;
    background: #ffffff;
    border: 1px solid #e9edf3;
    border-radius: 10px;
    cursor: pointer;
    transition: border-color .16s ease, background .16s ease, box-shadow .16s ease;
}

body.cf-body .panel-body .radio > label:hover,
body.cf-body .panel-body .checkbox > label:hover {
    border-color: #f6c9dc;
    background: #fffafc;
}

body.cf-body .panel-body .radio > label:has(input[type="radio"]:checked),
body.cf-body .panel-body .checkbox > label:has(input[type="checkbox"]:checked) {
    color: #c2185b;
    border-color: #ec4899;
    background: #fff5f9;
    box-shadow: 0 0 0 3px rgba(225, 29, 116, .06);
}

body.cf-body .panel-body .radio > label > input[type="radio"],
body.cf-body .panel-body .checkbox > label > input[type="checkbox"] {
    position: static;
    margin: 0 8px 0 0;
}

body.cf-body .panel-body .radio > label input[type="text"],
body.cf-body .panel-body .radio > label input[type="number"] {
    height: 28px;
    margin: 0 6px;
    padding: 2px 8px;
    font-size: 13px;
    border: 1px solid #e3e8f0;
    border-radius: 7px;
}

/* 参数区里的普通输入框 */
body.cf-body .panel-body input[type="text"]:not(.form-control),
body.cf-body .panel-body input[type="password"]:not(.form-control),
body.cf-body .panel-body input[type="number"]:not(.form-control) {
    height: 34px;
    padding: 5px 10px;
    font-size: 13.5px;
    color: #0b1220;
    background: #ffffff;
    border: 1px solid #e3e8f0;
    border-radius: 8px;
    outline: none;
    transition: border-color .16s ease, box-shadow .16s ease;
}

body.cf-body .panel-body input[type="text"]:not(.form-control):focus,
body.cf-body .panel-body input[type="password"]:not(.form-control):focus,
body.cf-body .panel-body input[type="number"]:not(.form-control):focus {
    border-color: #f2a9c6;
    box-shadow: 0 0 0 3px rgba(219, 39, 119, .10);
}

/* ---------- 提交按钮 ---------- */
.cf-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    margin-top: 18px;
}

.cf-actions .btn {
    min-width: 150px;
}

/* ---------- 结果卡片 ---------- */
.cf-result {
    margin-bottom: 16px;
    overflow: hidden;
    background: #ffffff;
    border: 1px solid #e9edf3;
    border-radius: 16px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .03);
}

.cf-result-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 20px;
    border-bottom: 1px solid #eef1f6;
}

.cf-result-head h2 {
    display: flex;
    align-items: center;
    gap: 9px;
    margin: 0;
    font-size: 15.5px;
    font-weight: 700;
    color: #0b1220;
}

.cf-result-head .fa {
    color: #c2185b;
}

.cf-result-head .cf-head-sub {
    font-size: 12.5px;
    font-weight: 400;
    color: #93a3b8;
}

.cf-result-body {
    padding: 18px 20px;
}

.cf-empty {
    padding: 34px 12px 30px;
    text-align: center;
}

.cf-empty > .fa {
    display: block;
    margin-bottom: 12px;
    font-size: 30px;
    color: #d3dbe7;
}

.cf-empty h4 {
    margin: 0 0 6px;
    font-size: 15px;
    font-weight: 600;
    color: #334155;
}

.cf-empty p {
    margin: 0;
    font-size: 12.5px;
    color: #93a3b8;
}

/* ---------- 转换结果下载按钮（由 JS 动态生成 .btn-link） ---------- */
body.cf-body #download {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 2px 0 4px;
}

body.cf-body #download .btn-link {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    min-height: 42px;
    height: auto;
    max-width: 100%;
    padding: 9px 16px;
    font-size: 13.5px;
    font-weight: 500;
    line-height: 1.5;
    color: #0b1220;
    text-align: left;
    word-break: break-all;
    text-decoration: none;
    background: #ffffff;
    border: 1px solid #e6e9ef;
    border-radius: 10px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .03);
    transition: color .16s ease, border-color .16s ease, background .16s ease, transform .16s ease, box-shadow .16s ease;
}

body.cf-body #download .btn-link::before {
    content: "\f019"; /* fa-download */
    font-family: FontAwesome;
    font-size: 13px;
    line-height: 1;
    color: #10b981;
}

body.cf-body #download .btn-link:hover,
body.cf-body #download .btn-link:focus {
    color: #c2185b;
    text-decoration: none;
    background: #fff7fa;
    border-color: #f7c6da;
    transform: translateY(-1px);
    box-shadow: 0 12px 22px -18px rgba(190, 24, 93, .55);
}

/* ---------- 常用入口 ---------- */
.cf-others {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    padding: 16px 20px;
    background: #ffffff;
    border: 1px solid #e9edf3;
    border-radius: 16px;
}

.cf-others-label {
    font-size: 13px;
    font-weight: 600;
    color: #0b1220;
}

.cf-others a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    font-size: 13px;
    color: #41516a;
    text-decoration: none;
    background: #f7f9fc;
    border: 1px solid #eef1f6;
    border-radius: 999px;
    transition: color .15s ease, background .15s ease, border-color .15s ease;
}

.cf-others a:hover {
    color: #c2185b;
    background: #fff5f9;
    border-color: #f7c6da;
    text-decoration: none;
}

/* ---------- 响应式 ---------- */
@media (max-width: 991px) {
    body.cf-body .container.manual-body {
        max-width: none;
    }

    /* 窄屏时导航会换行，下拉改为工具栏下方的全宽面板，避免被裁切或超出屏幕 */
    .cf-nav-list {
        flex-wrap: wrap;
        gap: 4px;
        overflow: visible;
    }

    .cf-nav-list > li {
        position: static;
    }

    .cf-nav-list > li.dropdown::after {
        display: none;
    }

    .cf-nav .dropdown-menu {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        width: auto;
        min-width: 0;
        max-height: 62vh;
        margin: 0;
        border-right: 0;
        border-left: 0;
        border-radius: 0 0 16px 16px;
        box-shadow: 0 30px 44px -34px rgba(15, 23, 42, .7);
    }
}

@media (max-width: 767px) {
    .cf-nav {
        margin-bottom: 14px;
    }

    .cf-nav-list {
        padding: 8px 0;
    }

    .cf-hero-head {
        padding: 18px;
        gap: 12px;
    }

    .cf-hero-ico {
        flex-basis: 42px;
        width: 42px;
        height: 42px;
        font-size: 17px;
        border-radius: 12px;
    }

    .cf-hero-title {
        font-size: 17px;
    }

    .cf-hero-collapse {
        padding: 0 18px 18px;
    }

    .cf-drop {
        padding: 20px 12px 18px;
    }

    .cf-drop-btn {
        width: 100%;
        min-width: 0;
        padding: 0 16px;
        font-size: 14px;
    }

    body.cf-body .panel > .panel-heading,
    body.cf-body .panel-body,
    .cf-result-head,
    .cf-result-body {
        padding-left: 16px;
        padding-right: 16px;
    }

    .cf-actions .btn {
        flex: 1 1 100%;
    }
}
