/* ============================================================
   portal-theme.css — 门户视觉精修层(叠加于 main.css 之上)
   仅做增量覆盖:不改 DOM 结构、不碰 JS 选择器
   ============================================================ */

:root {
    --grad-primary: linear-gradient(135deg, #2563eb 0%, #3b82f6 55%, #60a5fa 100%);
    --grad-deep: linear-gradient(150deg, #1e3a8a 0%, #2563eb 58%, #3b82f6 100%);
    --ring: 0 0 0 4px rgba(59, 130, 246, .18);
}

/* ---------- 基础质感 ---------- */
body {
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}
::selection { background: rgba(37, 99, 235, .85); color: #fff; }

/* ---------- 顶栏 ---------- */
.navbar {
    box-shadow: 0 1px 0 rgba(15, 23, 42, .04), 0 6px 20px rgba(15, 23, 42, .06);
    backdrop-filter: blur(8px);
    background: rgba(255, 255, 255, .92);
}
.nav-logo b { letter-spacing: .5px; }
.nav-links a { position: relative; }
.nav-links a.active::after,
.nav-links a:hover::after {
    content: "";
    position: absolute;
    left: 50%; bottom: -6px;
    transform: translateX(-50%);
    width: 18px; height: 3px;
    border-radius: 2px;
    background: var(--grad-primary);
}

/* ---------- Hero ---------- */
.hero {
    position: relative;
    background: var(--grad-deep);
    overflow: hidden;
    padding: 64px 0 72px;
}
.hero::before {
    content: "";
    position: absolute; inset: 0;
    background:
        radial-gradient(600px 300px at 85% 15%, rgba(255, 255, 255, .14), transparent 60%),
        radial-gradient(500px 260px at 10% 90%, rgba(96, 165, 250, .25), transparent 60%);
    pointer-events: none;
}
.hero::after {
    content: "";
    position: absolute; inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, .05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, .05) 1px, transparent 1px);
    background-size: 44px 44px;
    mask-image: linear-gradient(180deg, rgba(0,0,0,.5), transparent 70%);
    -webkit-mask-image: linear-gradient(180deg, rgba(0,0,0,.5), transparent 70%);
    pointer-events: none;
}
.hero-inner { position: relative; z-index: 1; }
.hero h1 {
    font-size: 44px;
    line-height: 1.22;
    letter-spacing: 1px;
    text-shadow: 0 2px 12px rgba(0, 0, 0, .18);
}
.hero p { opacity: .92; letter-spacing: .5px; }

/* 搜索胶囊 */
.hero-search {
    border: none;
    box-shadow: 0 10px 32px rgba(2, 6, 23, .28);
    transition: box-shadow .25s ease, transform .25s ease;
}
.hero-search:focus-within {
    box-shadow: 0 12px 36px rgba(2, 6, 23, .34), var(--ring);
    transform: translateY(-1px);
}
.hero-search button {
    background: var(--grad-primary);
    border: none;
    font-weight: 600;
    letter-spacing: 6px;
    text-indent: 6px;
}
.hero-search button:hover { filter: brightness(1.08); }

/* 统计条 */
.hero-stats { gap: 40px; }
.hero-stat { position: relative; }
.hero-stat .num { font-size: 30px; font-weight: 800; letter-spacing: .5px; color: #fff; }
.hero-stat .label { opacity: .78; }
.hero-stat + .hero-stat::before {
    content: "";
    position: absolute;
    left: -20px; top: 12%;
    height: 76%; width: 1px;
    background: rgba(255, 255, 255, .22);
}

/* ---------- 区块标题 ---------- */
.section-title { letter-spacing: .5px; font-weight: 700; }
.section-head .more {
    color: var(--primary);
    font-weight: 500;
    transition: gap .2s ease;
}
.section-head .more:hover { text-decoration: none; filter: brightness(1.1); }

/* ---------- 核心服务卡 ---------- */
.service-card {
    border: 1px solid var(--border);
    transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.service-card:hover {
    transform: translateY(-4px);
    border-color: rgba(37, 99, 235, .35);
    box-shadow: var(--shadow-lg);
}
.service-icon {
    width: 56px; height: 56px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 16px;
    background: var(--primary-light);
    font-size: 26px;
}
.service-card h3 { letter-spacing: .5px; }
.service-meta span {
    background: var(--primary-light);
    color: var(--primary);
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 12px;
}
.service-meta span + span { margin-left: 8px; }

/* ---------- 造价师卡 ---------- */
.engineer-card {
    border: 1px solid var(--border);
    overflow: hidden;
    transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.engineer-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(37, 99, 235, .35);
}
.engineer-card .engineer-avatar {
    width: 72px; height: 72px;
    font-size: 26px; font-weight: 700;
    box-shadow: 0 6px 18px rgba(37, 99, 235, .35), 0 0 0 4px #fff;
}
.engineer-card .stars, .engineer-rating { color: #f59e0b; letter-spacing: 2px; }
.engineer-card .tag.online {
    background: rgba(16, 185, 129, .1);
    color: #059669;
    border: 1px solid rgba(16, 185, 129, .35);
}
.engineer-card .btn, .consult-btn {
    background: var(--grad-primary);
    border: none;
    transition: filter .2s ease, transform .2s ease;
}
.engineer-card .btn:hover, .consult-btn:hover { filter: brightness(1.08); transform: translateY(-1px); }

/* ---------- 案例卡 ---------- */
.case-card {
    border: 1px solid var(--border);
    transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.case-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(37, 99, 235, .35);
}
.case-cover { background: linear-gradient(135deg, #dbeafe, #eff6ff); }
.case-cover img {
    width: 100%; height: 100%;
    object-fit: cover;
    transition: transform .4s ease;
}
.case-card:hover .case-cover img { transform: scale(1.05); }
.case-cover .badge, .case-card .price-badge, .case-price {
    background: rgba(2, 6, 23, .62);
    color: #fff;
    backdrop-filter: blur(4px);
    border-radius: 999px;
    padding: 3px 10px;
    font-weight: 600;
}
.case-grid > * { min-width: 0; }

/* ---------- 问答行 ---------- */
.qa-card, .qa-item {
    border: 1px solid var(--border);
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.qa-card:hover, .qa-item:hover {
    transform: translateY(-2px);
    border-color: rgba(37, 99, 235, .3);
    box-shadow: 0 6px 18px rgba(15, 23, 42, .07);
}
.qa-reward, .badge.reward {
    background: linear-gradient(135deg, #f59e0b, #f97316);
    color: #fff;
    border-radius: 999px;
    padding: 2px 10px;
    font-weight: 700;
}
.status-solved, .qa-status.resolved {
    background: rgba(16, 185, 129, .1);
    color: #059669;
    border: 1px solid rgba(16, 185, 129, .35);
    border-radius: 999px;
}
.qa-status.pending {
    background: rgba(245, 158, 11, .1);
    color: #b45309;
    border: 1px solid rgba(245, 158, 11, .35);
    border-radius: 999px;
}

/* ---------- AI 侧栏 ---------- */
.ai-panel {
    background: var(--grad-deep);
    border-radius: 18px;
    box-shadow: 0 16px 40px rgba(37, 99, 235, .35);
}
.ai-panel input { border-radius: 999px; border: none; }
.ai-panel .ai-suggest {
    background: rgba(255, 255, 255, .14);
    border: 1px solid rgba(255, 255, 255, .22);
    border-radius: 12px;
    transition: background .2s ease;
}
.ai-panel .ai-suggest:hover { background: rgba(255, 255, 255, .24); }

/* ---------- 按钮通用 ---------- */
.btn-primary, .btn.primary {
    background: var(--grad-primary);
    border: none;
    box-shadow: 0 6px 16px rgba(37, 99, 235, .28);
    transition: filter .2s ease, transform .2s ease, box-shadow .2s ease;
}
.btn-primary:hover, .btn.primary:hover {
    filter: brightness(1.06);
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(37, 99, 235, .34);
}

/* ---------- 页脚 ---------- */
.footer { letter-spacing: .5px; }
.footer a { transition: color .2s ease; }
.footer a:hover { color: #93c5fd; }

/* ---------- 响应式 ---------- */
@media (max-width: 900px) {
    .hero { padding: 44px 0 52px; }
    .hero h1 { font-size: 32px; }
    .hero-stats { gap: 24px; }
    .hero-stat .num { font-size: 24px; }
    .hero-stat + .hero-stat::before { left: -12px; }
}
@media (max-width: 560px) {
    .hero h1 { font-size: 26px; }
    .service-icon { width: 48px; height: 48px; font-size: 22px; }
}


/* ---------- 静态微调(原 portal.js 运行时注入,前移消除闪动) ---------- */
.engineer-card .engineer-meta{display:-webkit-box;-webkit-line-clamp:1;-webkit-box-orient:vertical;overflow:hidden;white-space:normal}
.engineer-card h4{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.case-card .title,.case-card h4{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;min-height:2.8em}
.qa-card .qa-title{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.engineer-card,.case-card{height:100%}

/* ---------- 防闪动:登录区与数据区占位 ---------- */
#headerAuthGuest{display:none}
#headerAuthUser{display:none;align-items:center;gap:var(--sp-3)}
#engGrid,#idxEngGrid,.case-grid,#idxCaseGrid,.qa-list,#idxQaList,#caseGrid,.ce-cases-grid{min-height:240px}


/* ============================================================
   间距体系 — 4px 基准标尺
   页面内的 padding/margin/gap 一律引用这里的刻度,
   不再在 HTML 行内写死数值。
   ============================================================ */
:root {
    --sp-1: 4px;   --sp-2: 8px;   --sp-3: 12px;  --sp-4: 16px;
    --sp-5: 20px;  --sp-6: 24px;  --sp-7: 32px;  --sp-8: 40px;
    --sp-9: 48px;  --sp-10: 56px; --sp-11: 64px; --sp-12: 80px;
}

/* ---------- 吸附:把 main.css 里的离格值拉回 4px 网格 ---------- */
.fl { margin-bottom: var(--sp-2); }                       /* 6  -> 8  */
.reg-role-card { padding: var(--sp-4); gap: var(--sp-3); }/* 14 -> 16, 10 -> 12 */
.reg-role-card .rrc-icon { margin-top: 0; }               /* 2  -> 0  */
.filter-tabs { gap: var(--sp-2); }                        /* 4  -> 8  */
.empty, .empty-state { padding: var(--sp-11) var(--sp-5); }/* 60 -> 64 */
.empty .icon { margin-bottom: var(--sp-3); }
.empty-state .empty-icon { margin-bottom: var(--sp-4); }
.section-head { margin-bottom: var(--sp-7); }             /* 28 -> 32 */
.section-title { padding-left: var(--sp-3); }             /* 14 -> 12 */
.header-search { padding: var(--sp-2) var(--sp-4); }      /* 6/14 -> 8/16 */
.main-nav a { padding: var(--sp-2) var(--sp-1); }         /* 6/2  -> 8/4  */
.hero-search button { padding: var(--sp-4) var(--sp-7); } /* 14/28 -> 16/32 */
.service-meta { gap: var(--sp-5); }
.engineer-stats { gap: var(--sp-6); margin-bottom: var(--sp-3); }

/* ---------- 布局工具类 ---------- */
.row   { display: flex; align-items: center; }
.row-t { display: flex; align-items: flex-start; }
.row-b { display: flex; align-items: baseline; }
.col   { display: flex; flex-direction: column; }
.wrap  { flex-wrap: wrap; }
.push  { margin-left: auto; }
.grow  { flex: 1; }
.nogrow{ flex-shrink: 0; white-space: nowrap; }

.g-1 { gap: var(--sp-1); }  .g-2 { gap: var(--sp-2); }
.g-3 { gap: var(--sp-3); }  .g-4 { gap: var(--sp-4); }
.g-5 { gap: var(--sp-5); }  .g-6 { gap: var(--sp-6); }

.mt-0 { margin-top: 0; }        .mb-0 { margin-bottom: 0; }
.mt-1 { margin-top: var(--sp-1); }  .mb-1 { margin-bottom: var(--sp-1); }
.mt-2 { margin-top: var(--sp-2); }  .mb-2 { margin-bottom: var(--sp-2); }
.mt-3 { margin-top: var(--sp-3); }  .mb-3 { margin-bottom: var(--sp-3); }
.mt-4 { margin-top: var(--sp-4); }  .mb-4 { margin-bottom: var(--sp-4); }
.mt-5 { margin-top: var(--sp-5); }  .mb-5 { margin-bottom: var(--sp-5); }
.mt-6 { margin-top: var(--sp-6); }  .mb-6 { margin-bottom: var(--sp-6); }
.ml-2 { margin-left: var(--sp-2); }

/* ---------- 文本级别 ---------- */
.t-sub   { font-size: 13px; color: var(--text-sub); }
.t-meta  { font-size: 12px; color: var(--text-sub); }
.t-hint  { font-size: 12px; color: var(--text-light); line-height: 1.6; }
.t-center{ text-align: center; }
.t-right { text-align: right; }
.req     { color: var(--danger); }

/* ---------- 组件 ---------- */
.btn-sm { padding: var(--sp-2) var(--sp-4); font-size: 13px; }
.btn-full { width: 100%; padding: var(--sp-3); font-size: 15px; }

.modal.modal-md { max-width: 520px; }

.toast {
    position: fixed; left: 50%; top: 20%;
    transform: translateX(-50%);
    background: rgba(17, 24, 39, .85); color: #fff;
    padding: var(--sp-3) var(--sp-6);
    border-radius: 8px; font-size: 14px;
    z-index: 400; display: none;
}

.captcha-img {
    width: 132px; height: 42px;
    border-radius: 8px; border: 1px solid var(--border);
    cursor: pointer; object-fit: cover;
    background: #f5f5f5; flex-shrink: 0;
}

.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-3); }
.form-tip { font-size: 12px; color: var(--text-light); line-height: 1.6; }
.modal-alt { margin-top: var(--sp-4); text-align: center; font-size: 13px; color: var(--text-sub); }
.link-inline { color: var(--primary); cursor: pointer; }
.link-inline.strong { font-weight: 600; }

/* ---------- 移动端页头:原先 logo 与导航在窄屏被挤成竖排单字 ---------- */
@media (max-width: 640px) {
    .header-inner {
        height: auto;
        flex-wrap: wrap;
        column-gap: var(--sp-3);
        row-gap: 0;
        padding: var(--sp-2) var(--sp-4);
    }
    .logo { font-size: 16px; white-space: nowrap; flex-shrink: 0; }
    .logo-badge { width: 28px; height: 28px; font-size: 14px; }
    .header-actions { margin-left: auto; gap: var(--sp-2); flex-shrink: 0; }

    /* 导航独占第二行,超宽时横向滚动而不是折行 */
    .main-nav {
        order: 3;
        flex: 0 0 100%;
        gap: var(--sp-5);
        overflow-x: auto;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
        padding-bottom: var(--sp-1);
    }
    .main-nav::-webkit-scrollbar { display: none; }
    .main-nav a { white-space: nowrap; }
}

/* ---------- 响应式栅格(替代写死在 HTML 里的 inline grid) ---------- */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--sp-5); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-4); }
@media (max-width: 992px) { .grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px)  { .grid-2, .grid-3 { grid-template-columns: 1fr; } }
@media (max-width: 480px)  { .form-grid-2 { grid-template-columns: 1fr; } }

/* ---------- 造价师后台:窄屏侧栏与页头 ---------- */
.ce-content { padding: var(--sp-6); }
.ce-header { margin-bottom: var(--sp-6); gap: var(--sp-3); flex-wrap: wrap; }
.ce-nav-item { padding: var(--sp-3) var(--sp-4); gap: var(--sp-3); white-space: nowrap; }
.ce-nav { padding: var(--sp-2) var(--sp-3); }
.nav-group-title { padding: var(--sp-4) var(--sp-5) var(--sp-2); }

@media (max-width: 992px) { .ce-content { padding: var(--sp-5); } }

@media (max-width: 640px) {
    /* 侧栏横置后要横向滚动,不能折行成二维网格 */
    .ce-nav {
        flex-wrap: nowrap;
        overflow-x: auto;
        scrollbar-width: none;
        gap: var(--sp-1);
        padding: var(--sp-2);
    }
    .ce-nav::-webkit-scrollbar { display: none; }
    .ce-nav-item { flex-shrink: 0; margin-bottom: 0; }
    .nav-group-title { display: none; }
    /* 嵌套分组容器会把后半截导航竖排,拆掉它自身的盒子 */
    #ceNavManageGroup { display: contents; }
    .ce-content { padding: var(--sp-4); }
    .ce-header h2 { font-size: 19px; }
}

/* ---------- 弹窗内重复出现的表单块 ---------- */
.dropzone {
    border: 2px dashed var(--border); border-radius: 12px;
    padding: var(--sp-6); text-align: center; cursor: pointer;
}
.dropzone-icon { font-size: 32px; margin-bottom: var(--sp-2); opacity: .4; }
.cover-pick {
    width: 120px; height: 80px;
    border: 2px dashed var(--border); border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; font-size: 24px; color: var(--text-light); overflow: hidden;
}
.radio-inline {
    display: flex; align-items: center; gap: var(--sp-2);
    font-size: 13px; cursor: pointer;
}
.check-line {
    display: flex; align-items: center; gap: var(--sp-2);
    font-size: 13px; color: var(--text-sub);
}
.loading-block { text-align: center; padding: var(--sp-5) 0; }
.loading-icon { font-size: 28px; margin-bottom: var(--sp-2); }
.tip-box {
    background: var(--primary-light); border-radius: 10px;
    padding: var(--sp-3); font-size: 13px;
    color: var(--text-sub); line-height: 1.6;
}
/* 紧贴上方输入框的提示,抵消 .fg 的下边距 */
.form-tip.tight { margin: -4px 0 var(--sp-2); }
.stat-cell {
    padding: var(--sp-4); text-align: center;
    border-bottom: 1px solid var(--border);
}
.avatar-lg {
    width: 48px; height: 48px; border-radius: 50%;
    background: linear-gradient(135deg, #f59e0b, #f97316);
    display: flex; align-items: center; justify-content: center;
    font-size: 18px; color: #fff; font-weight: 600;
    margin: 0 auto var(--sp-2); overflow: hidden;
}

/* ---------- 筛选栏:原 margin-top:-24px 正好抵消容器的 padding-top:24px,
     导致卡片紧贴页头蓝块底边。去掉负边距,让两者之间留出间距。 ---------- */
.filter-bar { margin: 0 auto var(--sp-7); padding: var(--sp-4) var(--sp-5); }
.filter-bar select, .filter-bar input { padding: var(--sp-2) var(--sp-3); }
.filter-search { padding: var(--sp-2) var(--sp-5); }
.filter-tab { padding: var(--sp-2) var(--sp-3); }
.container.list-top { padding-top: var(--sp-6); }

/* ---------- 页头铃铛未读红点 ---------- */
.header-bell { position: relative; }
.header-bell .badge-dot {
    position: absolute;
    top: -6px; right: -8px;
    min-width: 16px; height: 16px;
    padding: 0 var(--sp-1);
    border-radius: 999px;
    background: var(--danger); color: #fff;
    font-size: 11px; line-height: 16px; font-weight: 600;
    text-align: center;
    display: none;
}
.header-bell .badge-dot.show { display: block; }
.msg-empty { padding: var(--sp-6) var(--sp-4); text-align: center; color: var(--text-light); font-size: 13px; }

/* 吸附:main.css 的 .msg-item 用了离格值 */
.msg-item { gap: var(--sp-3); }        /* 10 -> 12 */
.msg-item .md { margin: var(--sp-1) 0; } /* 2  -> 4  */

/* ============================================================
   独立登录/注册页(login.html)
   卡片壳沿用 hero 的 --grad-deep 底 + --shadow-lg,
   表单内部全部复用既有 .tabs/.fg/.fi/.btn/.captcha-img/.reg-role-card
   ============================================================ */
.auth-page {
    min-height: calc(100vh - 64px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--sp-9) var(--sp-5);
    background: var(--grad-deep);
}
.auth-card {
    width: 100%;
    max-width: 520px;
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: var(--sp-8) var(--sp-8) var(--sp-7);
}
.auth-head { margin-bottom: var(--sp-6); }
.auth-title {
    font-size: 24px; font-weight: 700;
    line-height: 1.3; letter-spacing: .5px;
    text-wrap: pretty;
}
.auth-sub {
    margin-top: var(--sp-2);
    font-size: 13px; color: var(--text-sub);
    text-wrap: pretty;
}
.auth-return {
    margin-top: var(--sp-3);
    padding: var(--sp-2) var(--sp-3);
    border-radius: 8px;
    background: var(--primary-light);
    font-size: 12px; color: var(--text-sub);
    line-height: 1.6;
    overflow-wrap: anywhere;
}
.auth-return b { color: var(--primary); font-weight: 600; }
/* 顶层「登录 / 注册」切换:等分两栏,与内层的左对齐 tab 区分开 */
.auth-card > .tabs > .tab { flex: 1; text-align: center; font-size: 15px; }

.auth-page .fi:focus { box-shadow: var(--ring); }
.auth-page .btn-full { transition: transform .25s ease, box-shadow .25s ease; }
.auth-page .btn-full:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.auth-page .btn-full:active { transform: translateY(0); }

@media (max-width: 768px) {
    .auth-page { padding: var(--sp-6) var(--sp-4); align-items: flex-start; }
    .auth-card { padding: var(--sp-6) var(--sp-5); }
}
@media (max-width: 375px) {
    .auth-card { padding: var(--sp-5) var(--sp-4); }
    .auth-title { font-size: 20px; }
    .auth-page .fr { flex-direction: column; gap: 0; }
}
@media (prefers-reduced-motion: reduce) {
    .auth-page .btn-full { transition: none; }
    .auth-page .btn-full:hover { transform: none; }
}

/* ---------- AI 造价助手:页面正右边竖排常驻卡片 + 居中对话大窗(2026-09 重设计) ---------- */
.ai-launcher {
    position: fixed; right: 14px; top: 50%; z-index: 150;
    transform: translateY(-50%);
    display: flex; flex-direction: column; align-items: center; gap: 8px;
    padding: 20px 20px 18px; border-radius: var(--radius);
    border: 1px solid var(--border); background: #fff; cursor: pointer;
    box-shadow: var(--shadow), 0 8px 24px rgba(37, 99, 235, .22);
    transition: transform .25s ease, box-shadow .25s ease, opacity .2s ease;
    font-family: inherit;
}
.ai-launcher-av {
    width: 72px; height: 72px; border-radius: 50%; flex-shrink: 0;
    background: linear-gradient(150deg, #dbeafe, #eff6ff);
    display: flex; align-items: center; justify-content: center;
}
.ai-launcher-av svg { width: 50px; height: 50px; display: block; }
.ai-launcher-txt { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 3px; white-space: nowrap; }
.ai-launcher-txt strong { font-size: 17px; line-height: 1.2; color: var(--text-main); font-weight: 600; }
.ai-launcher-txt small { font-size: 12px; line-height: 1.2; color: var(--text-light); }
.ai-launcher:hover { transform: translateY(-50%) translateX(-4px); box-shadow: var(--shadow-lg), 0 12px 30px rgba(37, 99, 235, .3); }
.ai-launcher:focus-visible { outline: none; box-shadow: var(--ring); }
.ai-launcher::before {
    content: ''; position: absolute; inset: -7px; border-radius: 19px;
    border: 2px solid rgba(59, 130, 246, .4); pointer-events: none;
    animation: ai-ping 2.6s ease-out infinite;
}
@keyframes ai-ping {
    0% { transform: scale(.82); opacity: .9; }
    65%, 100% { transform: scale(1.18); opacity: 0; }
}

.ai-panel {
    position: fixed; left: 50%; top: 50%; z-index: 160;
    width: min(620px, calc(100vw - 32px));
    height: min(860px, calc(100dvh - 48px));
    display: flex; flex-direction: column; overflow: hidden;
    background: #fff; border: 1px solid var(--border); border-radius: 20px;
    box-shadow: 0 24px 80px rgba(2, 6, 23, .28);
    opacity: 0; visibility: hidden;
    transform: translate(-50%, -48%) scale(.97);
    transition: opacity .22s ease, transform .22s ease, visibility .22s;
}
.ai-dock.open .ai-panel { opacity: 1; visibility: visible; transform: translate(-50%, -50%) scale(1); }
.ai-dock.open .ai-launcher { opacity: 0; pointer-events: none; transform: translateY(-50%) scale(.6); }

.ai-hd { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--border); background: #fff; align-self: stretch; }
.ai-hd-av { width: 38px; height: 38px; border-radius: 50%; background: var(--primary-light); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.ai-hd-av svg { width: 26px; height: 26px; display: block; }
.ai-hd-txt { display: flex; flex-direction: column; gap: 2px; margin-right: auto; min-width: 0; }
.ai-hd-txt strong { font-size: 15px; color: var(--text-main); }
.ai-hd-sub { font-size: 12px; color: var(--text-light); display: flex; align-items: center; gap: 5px; }
.ai-live-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--success); flex-shrink: 0; }
.ai-hd-acts { display: flex; gap: 4px; }
.ai-ico-btn {
    width: 30px; height: 30px; border-radius: 8px; border: none; background: transparent;
    color: var(--text-sub); cursor: pointer; display: flex; align-items: center; justify-content: center;
    transition: background .2s ease, color .2s ease;
}
.ai-ico-btn:hover { background: var(--bg); color: var(--text-main); }
.ai-ico-btn:focus-visible { outline: none; box-shadow: var(--ring); }
.ai-ico-btn svg { width: 16px; height: 16px; display: block; }

.ai-chat {
    flex: 1; align-self: stretch; min-height: 0; overflow-y: auto; padding: 20px 18px;
    display: flex; flex-direction: column; gap: 12px; background: #fff;
    scrollbar-width: thin; scrollbar-color: rgba(107, 114, 128, .35) transparent;
}
.ai-chat::-webkit-scrollbar { width: 6px; }
.ai-chat::-webkit-scrollbar-thumb { background: rgba(107, 114, 128, .3); border-radius: 999px; }

.ai-msg {
    max-width: 78%; padding: 10px 14px; border-radius: 14px;
    font-size: 14px; line-height: 1.75; white-space: pre-wrap;
    overflow-wrap: anywhere; text-wrap: pretty;
}
.ai-msg.bot { align-self: flex-start; background: var(--bg); color: var(--text-main); border-top-left-radius: 4px; }
.ai-msg.user { align-self: flex-end; background: var(--grad-primary); color: #fff; border-top-right-radius: 4px; }
.ai-msg.bot.error { color: var(--danger); }
.ai-retry {
    margin-left: 8px; padding: 1px 10px; border: 1px solid var(--primary);
    border-radius: 999px; background: #fff; color: var(--primary);
    font-size: 12px; font-family: inherit; line-height: 1.6; cursor: pointer; vertical-align: 1px;
    transition: background .25s ease, color .25s ease, border-color .25s ease;
}
.ai-retry:hover { background: var(--primary-light); color: var(--primary-dark); border-color: var(--primary-dark); }
.ai-retry:focus-visible { outline: none; box-shadow: var(--ring); }
.ai-retry:active { transform: scale(.95); }
.ai-msg.loading { display: inline-flex; align-items: center; gap: 5px; padding: 13px 16px; }
.ai-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--text-light); animation: ai-blink 1.1s infinite; }
.ai-dot:nth-child(2) { animation-delay: .18s; }
.ai-dot:nth-child(3) { animation-delay: .36s; }
@keyframes ai-blink { 0%, 60%, 100% { opacity: .25; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }

.ai-welcome { margin: auto; text-align: center; padding: 28px 12px; display: flex; flex-direction: column; align-items: center; }
.ai-welcome-av { width: 72px; height: 72px; border-radius: 50%; background: linear-gradient(150deg, #dbeafe, #eff6ff); display: flex; align-items: center; justify-content: center; box-shadow: inset 0 0 0 1px rgba(37, 99, 235, .14); }
.ai-welcome-av svg { width: 48px; height: 48px; display: block; }
.ai-welcome-hi { margin-top: 12px; font-size: 15px; color: var(--text-main); line-height: 1.75; text-wrap: pretty; }
.ai-suggests { margin-top: 16px; display: flex; flex-direction: column; gap: 8px; width: 100%; max-width: 340px; }
.ai-suggest {
    position: relative; text-align: left; background: #fff;
    border: 1px solid var(--border); border-radius: 999px;
    padding: 9px 16px 9px 30px; font-size: 13px; color: var(--text-sub);
    cursor: pointer; font-family: inherit; transition: border-color .2s ease, color .2s ease, transform .2s ease, box-shadow .2s ease;
}
.ai-suggest::before { content: ''; position: absolute; left: 13px; top: 50%; margin-top: -3px; width: 6px; height: 6px; border-radius: 50%; background: var(--grad-primary); }
.ai-suggest:hover { border-color: var(--primary); color: var(--primary); transform: translateY(-1px); box-shadow: var(--shadow); }
.ai-suggest:focus-visible { outline: none; box-shadow: var(--ring); }

.ai-foot { align-self: stretch; padding: 14px 16px 10px; background: #fff; border-top: 1px solid var(--border); box-shadow: 0 -6px 18px rgba(2, 6, 23, .04); }
.ai-input {
    display: flex; align-items: center; gap: 8px;
    background: var(--bg); border: 1px solid var(--border); border-radius: 999px;
    padding: 6px 6px 6px 16px; transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}
.ai-input:focus-within { border-color: var(--primary); box-shadow: var(--ring); background: #fff; }
.ai-input input { flex: 1; min-width: 0; border: none; background: transparent; font-size: 14px; color: var(--text-main); outline: none; }
.ai-input input::placeholder { color: var(--text-light); }
.ai-input button {
    width: 36px; height: 36px; border-radius: 50%; border: none; flex-shrink: 0;
    background: var(--grad-primary); color: #fff; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: filter .2s ease, transform .15s ease, opacity .2s ease;
}
.ai-input button:hover { filter: brightness(1.08); }
.ai-input button:active { transform: scale(.92); }
.ai-input button:disabled { opacity: .5; cursor: not-allowed; }
.ai-input button svg { width: 16px; height: 16px; display: block; }
.ai-tip { margin-top: 8px; text-align: center; font-size: 11px; color: var(--text-light); }

@media (max-width: 767px) {
    .ai-launcher { right: 0; border-radius: 999px 0 0 999px; padding: 8px; width: 56px; height: 56px; justify-content: center; }
    .ai-launcher-av { width: 40px; height: 40px; }
    .ai-launcher-av svg { width: 30px; height: 30px; }
    .ai-launcher-txt { display: none; }
    .ai-panel { border-radius: 0; width: 100vw; height: 100dvh; transform: translate(-50%, -48%); }
    .ai-dock.open .ai-panel { transform: translate(-50%, -50%); }
}
@media (prefers-reduced-motion: reduce) {
    .ai-launcher, .ai-panel, .ai-suggest, .ai-input button, .ai-retry { transition: none; }
    .ai-launcher::before, .ai-dot { animation: none; }
    .ai-retry:active { transform: none; }
}

/* ============ 按钮忙碌态 ============
   ZJ.lock() 加上的 .is-loading:视觉上锁死按钮 + 内联 spinner。
   spinner 用 currentColor 描边,不引新色相,主色/描边/危险三种按钮都自适应。 */
.is-loading {
    pointer-events: none;
    opacity: .72;
    cursor: default;
}
.btn.is-loading::after,
.link-inline.is-loading::after {
    content: '';
    display: inline-block;
    width: 12px;
    height: 12px;
    margin-left: 8px;
    vertical-align: -1px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: zj-spin .6s linear infinite;
}
@keyframes zj-spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
    .btn.is-loading::after,
    .link-inline.is-loading::after { animation-duration: 1.8s; }
}

/* ============ 非会员锁标 ============
   body.zj-nomember 由 portal.js 的 initMemberFlag 打上。
   纯 CSS 驱动,不改任何卡片模板;点击拦截在 openQa / openCase 里。 */
.zj-nomember .case-card,
.zj-nomember .qa-card { position: relative; }
.zj-nomember .case-card::after,
.zj-nomember .qa-card::after {
    content: '会员可见';
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 2;
    padding: 2px 9px;
    border-radius: 999px;
    background: rgba(37, 99, 235, .92);
    color: #fff;
    font-size: 12px;
    line-height: 18px;
    letter-spacing: .5px;
    pointer-events: none;
}

/* 本人内容(自己提的问题、已购案例)非会员也看得到,不挂锁标 */
.zj-nomember [data-own="1"]::after,
.zj-nomember [data-own="1"] .case-card::after,
.zj-nomember [data-own="1"] .qa-card::after { content: none; }


/* ---------- ZJ.areaPicker 地区面板选择(省市区多级面板) ---------- */
.zj-area { position: relative; display: inline-block; max-width: 100%; }
.zj-area-trigger {
    display: inline-flex; align-items: center; gap: 6px; cursor: pointer; user-select: none;
    border: 1px solid var(--border); background: var(--card); border-radius: 8px;
    padding: 8px 14px; font-size: 14px; color: var(--text-main);
    transition: border-color .25s ease, box-shadow .25s ease;
}
.zj-area-trigger:hover { border-color: var(--primary); }
.zj-area.open .zj-area-trigger { border-color: var(--primary); box-shadow: var(--ring); }
.zj-area-caret { font-size: 10px; line-height: 1; color: var(--text-light); transition: transform .25s ease; }
.zj-area.open .zj-area-caret { transform: rotate(180deg); }
.zj-area-panel {
    display: none; position: absolute; top: calc(100% + 8px); left: 0; z-index: 200;
    width: min(640px, 92vw); background: var(--card);
    border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg);
    padding: 14px 16px 16px;
}
.zj-area.open .zj-area-panel { display: block; }
.zj-area-crumb {
    display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
    font-size: 13px; color: var(--text-sub); margin-bottom: 10px;
}
.zj-area-crumb b { color: var(--text-light); font-weight: 400; }
.zj-area-crumb span { cursor: pointer; padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.zj-area-crumb span:hover { background: var(--primary-light); color: var(--primary); }
.zj-area-crumb span.on { background: var(--primary); color: #fff; }
.zj-area-crumb span.on:hover { background: var(--primary-dark); color: #fff; }
.zj-area-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 6px;
    max-height: 264px; overflow-y: auto;
}
.zj-area-grid a {
    padding: 8px 6px; font-size: 14px; color: var(--text-main); text-align: center;
    border-radius: 8px; cursor: pointer; text-decoration: none; white-space: nowrap;
    overflow: hidden; text-overflow: ellipsis;
}
.zj-area-grid a:hover { background: var(--primary-light); color: var(--primary); }
.zj-area-grid a.cur { color: var(--primary); font-weight: 600; }
.zj-area-empty { font-size: 13px; color: var(--text-light); padding: 12px 2px; }
@media (prefers-reduced-motion: reduce) {
    .zj-area-trigger, .zj-area-caret { transition: none; }
}

/* ---------- 认证/提现照片上传位(反馈#2/#5) ---------- */
.ec-drop {
    border: 2px dashed var(--border); border-radius: 12px; padding: 16px;
    text-align: center; cursor: pointer; min-height: 96px;
    display: flex; align-items: center; justify-content: center; overflow: hidden;
    background: #fafbfc; transition: border-color .2s;
}
.ec-drop:hover { border-color: var(--primary); }
@media (prefers-reduced-motion: reduce) { .ec-drop { transition: none; } }

/* ---------- 造价师主页:左咨询(大区域)右档案(恢复原版,反馈#7 撤销) ---------- */
.ed-layout { grid-template-columns: minmax(0, 1fr) 360px; }
@media (max-width: 992px) {
    .ed-layout { grid-template-columns: 1fr; }
    .ed-layout .ed-aside { position: static !important; }
    .ed-layout .ed-aside .side-card { height: 60vh !important; min-height: 380px; }
}

/* ---------- 平台认证案例徽标(反馈#8) ---------- */
.case-cert {
    position: absolute; left: 10px; bottom: 10px; z-index: 2;
    background: linear-gradient(135deg, var(--grad-deep, #1d4ed8), #3b82f6); color: #fff;
    font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px;
    box-shadow: 0 2px 8px rgba(29, 78, 216, .35);
}
.case-detail-cert {
    display: inline-flex; align-items: center; gap: 4px;
    background: linear-gradient(135deg, #1d4ed8, #3b82f6); color: #fff;
    font-size: 13px; font-weight: 600; padding: 4px 12px; border-radius: 999px;
}

/* ---------- 造价师认证两步向导 ---------- */
.cert-steps { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; font-size: 13px; }
.cert-step { color: var(--text-light); font-weight: 600; }
.cert-step.on { color: var(--primary); }
.cert-step.done { color: #16a34a; }
.cert-steps i { color: var(--border); font-style: normal; }

/* ---------- 长文本不截断(地址/分类选择器,2026-09-15) ---------- */
.zj-area-trigger { max-width: 100%; }
.zj-area-trigger > span:first-child {
    white-space: normal; overflow-wrap: anywhere; text-align: left; line-height: 1.45;
}
.zj-area-caret { flex: none; }
.zj-area-grid a {
    white-space: normal; overflow: visible; text-overflow: clip;
    line-height: 1.4; padding: 7px 6px;
}

/* ---------- AI 窗口现代化润色(2026-09-16) ---------- */
.ai-scrim {
    position: fixed; inset: 0; z-index: 159; background: rgba(2, 6, 23, .32);
    -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px);
    opacity: 0; pointer-events: none; transition: opacity .25s ease;
}
.ai-dock.open .ai-scrim { opacity: 1; pointer-events: auto; }

.ai-hd { background: linear-gradient(180deg, #fff, #fbfdff); border-bottom-color: #eef1f6; }
.ai-hd-av { box-shadow: 0 0 0 2px #fff, 0 0 0 4px rgba(37, 99, 235, .16); }
.ai-live-dot { position: relative; }
.ai-live-dot::after {
    content: ''; position: absolute; inset: -3px; border-radius: 50%;
    background: var(--success); opacity: .35; animation: ai-pulse 1.8s ease-out infinite;
}
@keyframes ai-pulse { 0% { transform: scale(.6); opacity: .5; } 80%, 100% { transform: scale(1.5); opacity: 0; } }

.ai-chat { padding: 22px 20px; -webkit-mask-image: linear-gradient(#000 calc(100% - 28px), transparent); mask-image: linear-gradient(#000 calc(100% - 28px), transparent); }
.ai-row { display: flex; align-items: flex-start; gap: 8px; animation: ai-rise .26s ease both; }
.ai-row.out { justify-content: flex-end; }
.ai-row.in::before {
    content: 'AI'; flex: none; width: 26px; height: 26px; margin-top: 2px;
    border-radius: 50%; background: var(--grad-primary); color: #fff;
    font-size: 10px; font-weight: 700; letter-spacing: .3px;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 2px 8px rgba(37, 99, 235, .3);
}
.ai-msg { max-width: 76%; border-radius: 16px; padding: 11px 15px; }
.ai-msg.bot { background: #fff; border: 1px solid #eef1f6; border-top-left-radius: 6px; box-shadow: 0 1px 3px rgba(2, 6, 23, .05); }
.ai-msg.user { border-top-right-radius: 6px; box-shadow: 0 4px 14px rgba(37, 99, 235, .28); }
.ai-msg code {
    background: rgba(37, 99, 235, .08); color: var(--primary-dark); border-radius: 6px;
    padding: 1px 6px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px;
}
@keyframes ai-rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.ai-welcome { animation: ai-rise .32s ease both; }
.ai-welcome-av { animation: ai-float 3.4s ease-in-out infinite alternate; }
@keyframes ai-float { from { transform: translateY(0); } to { transform: translateY(-5px); } }

.ai-suggest { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ai-suggest::after { content: '\2192'; color: var(--text-light); transition: transform .2s ease, color .2s ease; }
.ai-suggest:hover::after { color: var(--primary); transform: translateX(3px); }

.ai-input { background: linear-gradient(#fff, #fff) padding-box, var(--grad-primary) border-box; border: 1.5px solid transparent; }
.ai-input:focus-within { box-shadow: 0 0 0 4px rgba(59, 130, 246, .14), 0 6px 18px rgba(37, 99, 235, .1); }
.ai-input button { box-shadow: 0 4px 12px rgba(37, 99, 235, .35); }
.ai-input button:hover { transform: scale(1.06); }
.ai-tip::before { content: '\2726'; color: var(--primary); margin-right: 5px; }
.ai-launcher:hover svg { transform: rotate(-7deg); transition: transform .2s ease; }

@media (prefers-reduced-motion: reduce) {
    .ai-scrim, .ai-row, .ai-welcome { animation: none; transition: none; }
    .ai-live-dot::after, .ai-welcome-av { animation: none; }
}
