/* ============================================================
 * #27 平台首页（直传签名首页）门户化覆写层
 * 加载在 vendored 原面板 css（common/index/viewGreen/main）之后，
 * 只做观感覆写：颜色/形状/卡片/按钮/进度条；JS 与全部 id 不动。
 * 门户语言口径 = 后台 #26 / 门户三页：门户蓝 #3b62c7 / 墨蓝 #1f336c /
 * CTA #2d68f6→#2058dc / 玻璃卡（白 .56 + blur 18）/ 胶囊 / 三段渐变底
 * ============================================================ */

:root {
    --sign-ink: #1f336c;
    --sign-ink-soft: #2b57ad;
    --sign-muted: rgba(39, 63, 117, .62);
    --sign-brand: #3b62c7;
    --sign-cta1: #2d68f6;
    --sign-cta2: #2058dc;
    --sign-line: rgba(93, 122, 201, .18);
    --sign-card: rgba(255, 255, 255, .58);
}

/* ---------- 1. 门户渐变底（后台同式：三段 radial+linear，fixed 附着） ---------- */
html,
body {
    background:
        radial-gradient(900px 480px at 12% -8%, rgba(122, 158, 238, .34), transparent 60%),
        radial-gradient(1000px 520px at 88% -10%, rgba(94, 140, 240, .28), transparent 62%),
        linear-gradient(180deg, #eef3fe 0%, #e6edfb 340px, #e8eef9 640px, #edf1f8 100%);
    background-attachment: fixed;
    background-repeat: no-repeat;
}

body {
    color: rgba(39, 63, 117, .85);
    min-height: 100vh;
}

/* vendor 蓝色 header 带整体退役（内容已由 .sign-topbar 承载） */
#header {
    background: none !important;
    height: auto !important;
}

/* ---------- 2. 顶栏：品牌文字 + 胶囊按钮组（替换原 absolute 右贴布局） ---------- */
.sign-topbar {
    position: static;
    max-width: 820px;
    margin: 0 auto;
    padding: 28px 20px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
}

.sign-topbar__brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sign-topbar__title {
    color: var(--sign-ink-soft);
    font-size: 19px;
    font-weight: 800;
    letter-spacing: .03em;
    line-height: 1.1;
}

.sign-topbar__sub {
    color: var(--sign-muted);
    font-size: 12px;
    margin-top: 3px;
}

.sign-topbar__nav {
    position: static;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    max-width: none;
}

/* 按钮=白玻璃胶囊；主钮=门户蓝实心胶囊（覆盖 index.php 旧内联口径） */
.sign-topbar__btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 40px;
    padding: 0 18px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .72);
    border: 1px solid rgba(93, 122, 201, .30);
    color: var(--sign-ink);
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    box-shadow: 0 10px 20px -14px rgba(31, 51, 108, .45);
    transition: transform .22s ease, box-shadow .22s ease, background .22s ease, border-color .22s ease;
}

.sign-topbar__btn svg {
    width: 15px;
    height: 15px;
    flex: 0 0 auto;
}

.sign-topbar__btn:hover {
    transform: translateY(-1px);
    background: rgba(255, 255, 255, .92);
    border-color: var(--sign-brand);
    color: var(--sign-ink-soft);
    box-shadow: 0 14px 26px -14px rgba(59, 98, 199, .5);
}

.sign-topbar__btn--primary {
    background: linear-gradient(135deg, var(--sign-cta1), var(--sign-cta2));
    border-color: transparent;
    color: #fff;
    box-shadow: 0 14px 26px -12px rgba(45, 104, 246, .6);
}

.sign-topbar__btn--primary:hover {
    background: linear-gradient(135deg, #3f76f8, #2d68f6);
    color: #fff;
    box-shadow: 0 18px 30px -12px rgba(45, 104, 246, .68);
}

/* ---------- 3. 壳 + 主玻璃卡 ---------- */
.sign-shell {
    max-width: 820px;
    margin: 0 auto;
    padding: 0 20px 70px;
}

.sign-card {
    position: relative;
    margin-top: 24px;
    background: var(--sign-card);
    -webkit-backdrop-filter: blur(18px);
    backdrop-filter: blur(18px);
    border: 1px solid rgba(255, 255, 255, .78);
    border-radius: 30px;
    box-shadow: 0 34px 64px -34px rgba(31, 51, 108, .32);
    padding: 56px 30px 34px;
    text-align: center;
}

/* 旧 .container（750px/30px padding/居中）退役，壳由 .sign-shell 承载 */
.sign-shell .container {
    width: auto;
    padding: 0;
}

/* ---------- 4. logo 卡（压在主卡顶沿，营销卡式） ---------- */
#appicon-bg {
    width: 104px !important;
    height: 104px !important;
    padding: 10px !important;
    margin: -78px auto 16px !important;
    border-radius: 28px !important;
    background: #fff !important;
    border: 1px solid rgba(255, 255, 255, .9);
    box-shadow: 0 20px 40px -16px rgba(31, 51, 108, .42), 0 0 0 7px rgba(255, 255, 255, .55) !important;
    transition: transform .25s ease;
}

#appicon-bg:hover {
    transform: translateY(-3px);
}

.appicon {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 20px;
}

/* ---------- 5. 标题 ---------- */
#appinfo {
    margin: 0 !important;
}

#appName {
    color: var(--sign-ink) !important;
    font-size: 25px;
    font-weight: 800;
    letter-spacing: .06em;
    margin: 0;
}

/* ---------- 6. 尺寸警示 pill ---------- */
.sign-warn {
    margin: 12px auto 0;
    display: flex;
    justify-content: center;
}

.sign-warn span {
    background: rgba(217, 119, 6, .10);
    border: 1px solid rgba(217, 119, 6, .30);
    color: #b45309;
    font-size: 12.5px;
    line-height: 1.4;
    padding: 8px 18px;
    border-radius: 999px;
}

/* ---------- 7. 上传盒 2×2 网格 ---------- */
.sign-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-top: 22px;
}

/* 三个文件盒：白面 + 门户蓝虚线，hover 提亮上浮 */
.upload-img-init {
    height: 118px;
    border: 1.5px dashed rgba(59, 98, 199, .42);
    border-radius: 18px;
    background: rgba(255, 255, 255, .80);
    margin: 0 !important;
    padding: 12px !important;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    color: #243b78;
    transition: border-color .2s ease, background .2s ease, transform .2s ease, box-shadow .2s ease;
}

.upload-img-init:hover {
    border-color: var(--sign-brand);
    background: rgba(238, 243, 254, .95);
    transform: translateY(-2px);
    box-shadow: 0 16px 30px -18px rgba(59, 98, 199, .55);
}

.upload-img-init img {
    width: 44px;
    height: auto;
}

.upload-img-init .up-label {
    font-size: 12.5px;
    font-weight: 600;
    color: #243b78;
    word-break: break-all;
    line-height: 1.45;
}

/* ---------- 6.1 #38.1 「去签名」预签 ---------- */
/* 预签横幅：材料已从证书管理页带出，只差 IPA */
.sign-presign {
    margin: 10px auto 0;
    padding: 10px 18px;
    border-radius: 14px;
    border: 1px solid rgba(5, 150, 105, .28);
    background: rgba(209, 250, 229, .72);
    color: #047857;
    font-size: 13px;
    line-height: 1.6;
    max-width: 720px;
    text-align: center;
}

.sign-presign b {
    color: #065f46;
    word-break: break-all;
}

/* 已应用的 P12 / 描述文件盒：绿实线 + 不可点（材料由服务端按 session 从库带出） */
.upload-img-init.su-applied {
    cursor: default;
    border-style: solid;
    border-color: rgba(5, 150, 105, .45);
    background: rgba(209, 250, 229, .45);
    color: #047857;
}

.upload-img-init.su-applied .up-label {
    color: #047857;
}

.upload-img-init.su-applied:hover {
    transform: none;
    box-shadow: none;
    background: rgba(209, 250, 229, .45);
    border-color: rgba(5, 150, 105, .45);
}

/* 第四格 = 状态/进度盒（实线，虚线留给文件盒） */
.sign-box {
    height: 118px;
    border: 1px solid var(--sign-line);
    border-radius: 18px;
    background: rgba(255, 255, 255, .66);
    margin: 0;
    padding: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: var(--sign-muted);
}

/* 状态文字 */
#outputs {
    color: var(--sign-muted) !important;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 0;
}

/* 门户进度条（覆写 bootstrap .progress）
   #38.3 加高+轨道加实+渐变加深+微光晕+百分比字加大：浅色玻璃底上原 10px 细条/浅轨道太弱（用户反馈「颜色浅不明显」） */
.progress {
    height: 14px;
    border-radius: 999px;
    background: rgba(43, 87, 173, .20);
    box-shadow: inset 0 0 0 1px rgba(59, 98, 199, .18);
    margin: 14px auto 0;
}

.progress-bar {
    background: linear-gradient(90deg, #1d4ed8, var(--sign-cta1) 45%, #5b8cff);
    background-color: var(--sign-cta1);
    box-shadow: 0 0 12px rgba(45, 104, 246, .45);
    border-radius: 999px;
    font-size: 0;
    line-height: 14px;
    min-height: 0;
    height: 100%;
    transition: width .18s linear;
}

.progress-bar-striped {
    background-image: linear-gradient(45deg, rgba(255, 255, 255, .30) 25%, transparent 25%,
        transparent 50%, rgba(255, 255, 255, .30) 50%, rgba(255, 255, 255, .30) 75%, transparent 75%, transparent);
    background-size: 1rem 1rem;
}

#progresss {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 10.5px;
    font-weight: 700;
    line-height: 14px;
    min-width: 40px;
    text-shadow: 0 1px 2px rgba(16, 42, 102, .55);
}

/* ---------- 8. 密码 / 更多设置输入（门户表单行：小标签 + 全宽输入） ---------- */
.sign-field {
    margin-top: 22px;
    width: 100%;
    text-align: left;
}

.sign-row__tag {
    display: block;
    margin-bottom: 7px;
    font-size: 12.5px;
    font-weight: 700;
    letter-spacing: .3px;
    color: var(--sign-ink-soft);
}

.sign-row__opt {
    font-weight: 400;
    color: rgba(39, 63, 117, .45);
    margin-left: 3px;
}

.sign-input {
    display: block;
    width: 100%;
    height: 46px;
    border-radius: 14px;
    border: 1px solid rgba(93, 122, 201, .30);
    background: rgba(255, 255, 255, .88);
    padding: 0 18px;
    font-size: 14px;
    color: var(--sign-ink);
    box-shadow: inset 0 1px 2px rgba(31, 51, 108, .05);
    transition: border-color .2s ease, box-shadow .2s ease;
}

.sign-input::placeholder {
    color: rgba(39, 63, 117, .42);
}

.sign-input:focus {
    outline: none;
    border-color: var(--sign-cta1);
    box-shadow: 0 0 0 4px rgba(45, 104, 246, .16);
}

/* 「点击展开更多设置」文字钮（覆盖 <font color=#f00> 红字） */
#set {
    display: inline-block;
    margin-top: 16px;
    color: var(--sign-brand) !important;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    user-select: none;
    transition: color .2s ease;
}

#set:hover {
    color: var(--sign-cta2) !important;
}

#gengduo {
    margin-top: 18px;
    width: 100%;
}

/* 更多设置 = 并排双玻璃面板（左图标面板 + 右双输入面板），标签左上对齐 */
.sign-rows {
    display: flex;
    align-items: stretch;
    gap: 16px;
}

.sign-panel {
    background: rgba(255, 255, 255, .52);
    border: 1px solid var(--sign-line);
    border-radius: 16px;
    padding: 16px 18px 18px;
    text-align: left;
}

.sign-panel--icon {
    flex: 0 0 30%;
    min-width: 190px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.sign-panel__head {
    margin-bottom: 12px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .3px;
    color: var(--sign-ink-soft);
}

.sign-panel--fields {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.sign-row__field {
    width: 100%;
}

.sign-row__cap {
    margin-top: 10px;
    font-size: 11.5px;
    color: rgba(39, 63, 117, .45);
}

#imgdata {
    width: 84px;
    height: 84px;
    object-fit: cover;
    border-radius: 18px;
    border: 2px dashed rgba(59, 98, 199, .42);
    background: #fff;
    cursor: pointer;
    transition: border-color .2s ease, box-shadow .2s ease;
}

#imgdata:hover {
    border-color: var(--sign-cta1);
    box-shadow: 0 0 0 4px rgba(45, 104, 246, .12);
}

/* ---------- 9. 提交 CTA + 结果按钮 ---------- */
#azbutton {
    margin-top: 24px;
}

#submit_btn,
#azbutton a.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 250px;
    min-height: 52px;
    padding: 0 36px;
    border-radius: 999px;
    font-size: 15px;
    font-weight: 800;
    letter-spacing: .08em;
    text-decoration: none;
    text-transform: none;
    text-shadow: none;
    margin: 0 auto;
}

#submit_btn {
    background: linear-gradient(135deg, var(--sign-cta1), var(--sign-cta2));
    border: none;
    color: #fff;
    box-shadow: 0 18px 34px -14px rgba(45, 104, 246, .65);
    cursor: pointer;
    transition: transform .2s ease, box-shadow .2s ease, opacity .2s ease;
}

#submit_btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 22px 40px -14px rgba(45, 104, 246, .72);
}

#submit_btn:disabled {
    opacity: .55;
    cursor: not-allowed;
    transform: none;
}

/* JS 签名成功后注入的四个结果钮：白玻璃次级胶囊（避免四连蓝 CTA） */
#azbutton a.btn {
    background: rgba(255, 255, 255, .88);
    border: 1px solid rgba(93, 122, 201, .32);
    color: var(--sign-ink);
    box-shadow: 0 12px 24px -16px rgba(31, 51, 108, .45);
    cursor: pointer;
    transition: border-color .2s ease, color .2s ease, transform .2s ease;
}

#azbutton a.btn:hover {
    border-color: var(--sign-brand);
    color: var(--sign-ink-soft);
    transform: translateY(-1px);
    background: #fff;
}

#azbutton p {
    font-size: 13px;
    color: var(--sign-muted);
    margin: 0 0 8px;
}

/* 二维码（签名成功注入） */
#qrcode {
    display: flex;
    justify-content: center;
    margin-top: 12px;
}

#qrcode img {
    display: block;
    border-radius: 12px;
    border: 1px solid var(--sign-line);
    background: #fff;
    padding: 8px;
}

/* ---------- 10. mobile ---------- */
@media (max-width: 640px) {
    .sign-topbar {
        padding-top: 18px;
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .sign-topbar__brand {
        justify-content: center;
    }

    .sign-topbar__nav {
        width: 100%;
        justify-content: center;
    }

    .sign-topbar__btn {
        flex: 1 1 auto;
        justify-content: center;
    }

    .sign-card {
        margin-top: 18px;
        border-radius: 24px;
        padding: 62px 16px 24px;
    }

    #appicon-bg {
        width: 92px !important;
        height: 92px !important;
        margin-top: -66px !important;
    }

    .sign-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .sign-rows {
        flex-direction: column;
        gap: 16px;
    }

    .sign-panel--icon {
        flex: none;
    }
}

@media (max-width: 414px) {
    /* 覆盖 viewGreen 对 #header/#appicon-bg 的 414 断点旧值 */
    #appicon-bg {
        width: 84px !important;
        height: 84px !important;
        padding: 8px !important;
        margin-top: -58px !important;
    }
}

/* ---------- #43.7 拖入落格：全局拖拽遮罩（JS 动态建 .sign-drop-overlay，门户玻璃卡语言） ---------- */
.sign-drop-overlay {
    position: fixed;
    inset: 0;
    z-index: 9000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(23, 42, 94, .42);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}
.sign-drop-overlay__card {
    min-width: min(430px, calc(100vw - 56px));
    padding: 34px 40px 30px;
    text-align: center;
    color: #fff;
    background: rgba(47, 78, 156, .38);
    border: 2px dashed rgba(151, 181, 255, .85);
    border-radius: 22px;
    box-shadow: 0 18px 60px rgba(23, 42, 94, .42), inset 0 0 42px rgba(151, 181, 255, .14);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}
.sign-drop-overlay__t {
    font-size: 21px;
    font-weight: 700;
    letter-spacing: .5px;
}
.sign-drop-overlay__s {
    margin-top: 10px;
    font-size: 13px;
    color: rgba(224, 235, 255, .9);
}
