/* ==========================================================================
   试用申请弹窗  trial-modal.css
   零依赖、零构建。配色沿用官网主蓝（#1677FF / 渐变 #00C0FA → #015EEA）。
   独立文件、独立类名前缀（.trial-*），不污染官网 2021 版式样式。
   ========================================================================== */

.trial-modal {
    position: fixed;
    inset: 0;
    z-index: 99990;              /* 高于官网浮层（right-bar / 导航下拉） */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    -webkit-overflow-scrolling: touch;
}

.trial-modal[hidden] { display: none; }

/* ---- 遮罩 ---- */
.trial-modal__mask {
    position: absolute;
    inset: 0;
    background: rgba(9, 20, 44, .55);
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
    animation: trial-mask-in .22s ease-out both;
}

@keyframes trial-mask-in { from { opacity: 0; } to { opacity: 1; } }

/* ---- 对话框 ---- */
.trial-modal__dialog {
    position: relative;
    width: 100%;
    max-width: 520px;
    max-height: calc(100vh - 48px);
    overflow-y: auto;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 24px 70px -12px rgba(8, 30, 74, .45), 0 2px 8px rgba(8, 30, 74, .10);
    padding: 30px 32px 26px;
    font-size: 14px;
    line-height: 1.6;
    color: #1f2937;
    box-sizing: border-box;
    animation: trial-dialog-in .28s cubic-bezier(.16, .84, .44, 1) both;
}

.trial-modal__dialog *,
.trial-modal__dialog *::before,
.trial-modal__dialog *::after { box-sizing: border-box; }

@keyframes trial-dialog-in {
    from { opacity: 0; transform: translateY(18px) scale(.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ---- 关闭按钮 ---- */
.trial-modal__close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 34px;
    height: 34px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 50%;
    background: #f3f5f9;
    color: #6b7280;
    cursor: pointer;
    transition: background .18s, color .18s, transform .18s;
}
.trial-modal__close:hover { background: #e6ebf5; color: #1677ff; transform: rotate(90deg); }
.trial-modal__close:focus-visible { outline: 2px solid #1677ff; outline-offset: 2px; }

/* ---- 头部 ---- */
.trial-modal__head { padding-right: 34px; margin-bottom: 20px; }

.trial-modal__title {
    margin: 0 0 6px;
    font-size: 22px;
    line-height: 1.35;
    font-weight: 700;
    color: #0f213e;
    letter-spacing: .3px;
}

.trial-modal__desc {
    margin: 0;
    font-size: 13px;
    color: #64748b;
}
.trial-modal__desc b { color: #1677ff; font-weight: 600; }

/* ---- 表单 ---- */
.trial-modal__form { margin: 0; }

.trial-field { margin-bottom: 14px; }

.trial-row {
    display: flex;
    gap: 14px;
}
.trial-row > .trial-field { flex: 1 1 0; min-width: 0; }

.trial-field label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 500;
    color: #334155;
}
.trial-req { color: #e5484d; font-style: normal; }

.trial-field input[type="text"],
.trial-field input[type="tel"],
.trial-field input[type="email"],
.trial-field select,
.trial-field textarea {
    display: block;
    width: 100%;
    padding: 10px 13px;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.5;
    color: #1f2937;
    background: #f8fafc;
    border: 1px solid #dde3ec;
    border-radius: 9px;
    outline: none;
    transition: border-color .18s, background .18s, box-shadow .18s;
    -webkit-appearance: none;
    appearance: none;
}

.trial-field textarea { resize: vertical; min-height: 74px; }

/* 产品分类下拉：原生箭头各浏览器长得都不一样，且和圆角输入框不搭，这里统一成自绘箭头。
   ⚠️ 箭头用 background-image 实现，所以下面 :focus 只能改 background-color，
      不能再用 background 简写 —— 否则箭头图会被一起清掉。 */
.trial-field select {
    cursor: pointer;
    padding-right: 38px;
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5l5-5' fill='none' stroke='%2364748b' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 12px 8px;
}
.trial-field select::-ms-expand { display: none; }

.trial-field input::placeholder,
.trial-field textarea::placeholder { color: #9aa6b8; }

.trial-field input:focus,
.trial-field textarea:focus {
    background: #fff;
    border-color: #1677ff;
    box-shadow: 0 0 0 3px rgba(22, 119, 255, .12);
}

.trial-field select:focus {
    background-color: #fff;
    border-color: #1677ff;
    box-shadow: 0 0 0 3px rgba(22, 119, 255, .12);
}

.trial-field.is-bad input,
.trial-field.is-bad select,
.trial-field.is-bad textarea {
    border-color: #e5484d;
    background-color: #fff7f7;
}

.trial-err {
    margin: 5px 0 0;
    font-size: 12px;
    line-height: 1.4;
    color: #e5484d;
    min-height: 0;
}
.trial-err:empty { display: none; }

/* 蜜罐 */
.trial-hp {
    position: absolute !important;
    left: -9999px !important;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* ---- 提交按钮 ---- */
.trial-submit {
    position: relative;
    display: block;
    width: 100%;
    margin-top: 6px;
    padding: 12px 18px;
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: .5px;
    color: #fff;
    background: linear-gradient(90deg, #00C0FA 0%, #015EEA 100%);
    border: 0;
    border-radius: 10px;
    cursor: pointer;
    transition: box-shadow .2s, transform .12s, filter .2s;
    box-shadow: 0 8px 20px -8px rgba(1, 94, 234, .65);
}
.trial-submit:hover { filter: brightness(1.06); box-shadow: 0 10px 24px -8px rgba(1, 94, 234, .78); }
.trial-submit:active { transform: translateY(1px); }
.trial-submit:focus-visible { outline: 2px solid #1677ff; outline-offset: 2px; }

.trial-submit[disabled] { cursor: not-allowed; opacity: .72; }
.trial-submit[disabled]:hover { filter: none; }

.trial-submit__spin {
    display: none;
    width: 15px;
    height: 15px;
    margin-left: 8px;
    vertical-align: -2px;
    border: 2px solid rgba(255, 255, 255, .45);
    border-top-color: #fff;
    border-radius: 50%;
    animation: trial-spin .7s linear infinite;
}
.trial-submit.is-loading .trial-submit__spin { display: inline-block; }

@keyframes trial-spin { to { transform: rotate(360deg); } }

.trial-submit--ghost {
    width: auto;
    min-width: 130px;
    margin: 18px auto 0;
    padding: 10px 26px;
    color: #1677ff;
    background: #eef5ff;
    box-shadow: none;
}
.trial-submit--ghost:hover { background: #e2eeff; filter: none; box-shadow: none; }

/* ---- 全局提示 ---- */
.trial-msg {
    margin: 4px 0 10px;
    font-size: 13px;
    line-height: 1.5;
    color: #e5484d;
}
.trial-msg:empty { display: none; }
.trial-msg.is-ok { color: #0f9d58; }

.trial-privacy {
    margin: 10px 0 0;
    font-size: 11.5px;
    line-height: 1.5;
    color: #94a3b8;
    text-align: center;
}

/* ---- 成功态 ---- */
.trial-done { text-align: center; padding: 12px 0 4px; }
.trial-done[hidden] { display: none; }

.trial-done__icon {
    display: flex;
    justify-content: center;
    color: #0f9d58;
    margin-bottom: 12px;
    animation: trial-pop .4s cubic-bezier(.2, 1.4, .5, 1) both;
}
@keyframes trial-pop { from { transform: scale(.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.trial-done__title {
    margin: 0 0 8px;
    font-size: 19px;
    font-weight: 700;
    color: #0f213e;
}
.trial-done__text {
    margin: 0;
    font-size: 13.5px;
    color: #64748b;
}

/* ---- 打开时锁滚动 ---- */
body.trial-lock { overflow: hidden !important; }

/* ---- 打开时禁用官网装饰层，避免闪烁干扰 ---- */
body.trial-lock .rb-aurora-canvas { opacity: .35; }

/* ---- 移动端 ---- */
@media (max-width: 640px) {
    .trial-modal { padding: 0; align-items: flex-end; }

    .trial-modal__dialog {
        max-width: 100%;
        max-height: 92vh;
        border-radius: 16px 16px 0 0;
        padding: 24px 20px 22px;
        animation: trial-sheet-in .3s cubic-bezier(.16, .84, .44, 1) both;
    }

    @keyframes trial-sheet-in {
        from { opacity: 0; transform: translateY(100%); }
        to   { opacity: 1; transform: translateY(0); }
    }

    .trial-modal__title { font-size: 19px; }

    /* 窄屏两列改单列，避免输入框被压得过窄 */
    .trial-row { display: block; }
    .trial-row > .trial-field { margin-bottom: 14px; }
}

/* ---- 尊重「减少动态效果」 ---- */
@media (prefers-reduced-motion: reduce) {
    .trial-modal__mask,
    .trial-modal__dialog,
    .trial-done__icon { animation: none !important; }
    .trial-modal__close:hover { transform: none; }
}
