/* 各风格模板共用的子页面与组件样式，颜色取自模板的 CSS 变量 */

/* 子页面容器 */
.sub { position: absolute; inset: 0; z-index: 10; display: flex; flex-direction: column; background: var(--bg); }
[hidden] { display: none !important; }
.sub-hd { flex: none; display: flex; align-items: center; height: 48px; padding: 0 4px; background: var(--card); border-bottom: 1px solid var(--line); }
.sub-hd button { width: 44px; height: 44px; display: grid; place-items: center; }
.sub-hd [data-icon] { width: 22px; height: 22px; transform: rotate(180deg); }
.sub-hd h1 { flex: 1; text-align: center; font-size: 16px; font-weight: 600; }
.sub-r { min-width: 44px; padding-right: 10px; text-align: right; font-size: 13px; color: var(--brand); cursor: pointer; }
.sub-bd { flex: 1; overflow-y: auto; padding: 12px; scrollbar-width: none; }
.sub-bd::-webkit-scrollbar { display: none; }

.box { margin-bottom: 12px; padding: 4px 14px; background: var(--card); border-radius: var(--r); }
.box.pad { padding: 14px; }
.box h3 { padding: 10px 0 6px; font-size: 14px; }
.field { display: flex; align-items: center; gap: 10px; min-height: 50px; border-bottom: 1px solid var(--line); }
.field:last-child { border-bottom: 0; }
.field label { flex: none; width: 76px; font-size: 14px; color: var(--dim); }
.field input, .field select { flex: 1; min-width: 0; height: 48px; font-size: 15px; }
.field select { appearance: none; -webkit-appearance: none; border: 0; background: none; color: inherit; font: inherit; outline: none; }
.field select option { color: #222; }
.field input::placeholder { color: var(--dim); opacity: .7; }
.field .cap { flex: none; width: 110px; height: 40px; border-radius: 6px; overflow: hidden; background: #fff; cursor: pointer; }
.field .cap svg { display: block; }
.field .act { flex: none; font-size: 13px; color: var(--brand); cursor: pointer; }
.btn-main { display: block; width: 100%; height: 48px; margin-top: 16px; border-radius: 24px; background: var(--brand); color: var(--on-brand); font-size: 16px; font-weight: 600; }
.btn-main:disabled { opacity: .5; }
.btn-main.ghost { background: none; color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); }
.btn-sm { padding: 5px 14px; border-radius: 14px; border: 1px solid var(--brand); color: var(--brand); font-size: 12px; }
.tip { margin-top: 12px; font-size: 12px; line-height: 1.7; color: var(--dim); white-space: pre-wrap; }
.center { text-align: center; }
.link { color: var(--brand); cursor: pointer; }
.article { font-size: 14px; line-height: 1.8; white-space: pre-wrap; word-break: break-word; }

/* 登录注册 */
.auth-hd { padding: 26px 8px 22px; }
.auth-hd h2 { font-size: 24px; }
.auth-hd p { margin-top: 4px; font-size: 13px; color: var(--dim); }
.agree { display: flex; align-items: center; gap: 6px; margin-top: 12px; font-size: 12px; color: var(--dim); }
.agree input { width: 16px; height: 16px; accent-color: var(--brand); -webkit-appearance: auto; appearance: auto; }

/* 列表 */
.cell { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.cell:last-child { border-bottom: 0; }
.cell b { font-weight: 500; }
.cell small { display: block; margin-top: 2px; font-size: 11px; color: var(--dim); }
.cell .r { flex: none; text-align: right; }
.cell .amt { font-size: 16px; font-weight: 600; font-variant-numeric: tabular-nums; }
.st0 { color: #f0a020; } .st1 { color: var(--down); } .st2 { color: var(--up); }
.more { display: block; width: 100%; padding: 12px; font-size: 13px; color: var(--dim); }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; font-size: 14px; }
.kv span:first-child { flex: none; color: var(--dim); }
.kv span:last-child { text-align: right; word-break: break-all; }

.stat { display: flex; text-align: center; }
.stat div { flex: 1; padding: 6px 0; font-size: 11px; color: var(--dim); }
.stat b { display: block; margin-bottom: 2px; font-size: 18px; color: var(--text); }
.hero { margin-bottom: 12px; padding: 20px 16px; border-radius: var(--r); background: var(--brand); color: var(--on-brand); }
.hero small { font-size: 12px; opacity: .8; }
.hero b { display: block; margin: 4px 0 12px; font-size: 30px; font-variant-numeric: tabular-nums; }
.hero .stat div { color: inherit; opacity: .9; }
.hero .stat b { color: inherit; font-size: 15px; }
.row2 { display: flex; gap: 10px; }
.row2 .btn-main { margin-top: 0; }

/* 图片上传 */
.upls { display: flex; gap: 10px; padding: 10px 0; }
.upl { flex: 1; height: 110px; display: grid; place-items: center; border: 1px dashed var(--dim); border-radius: 10px; font-size: 12px; color: var(--dim); background: center / cover no-repeat; cursor: pointer; }
.upl.has { color: transparent; border-style: solid; }

/* 帮助与公告的折叠条目 */
details { border-bottom: 1px solid var(--line); }
details:last-child { border-bottom: 0; }
summary { padding: 13px 0; font-size: 14px; cursor: pointer; list-style: none; }
summary::-webkit-details-marker { display: none; }
summary small { display: block; margin-top: 2px; font-size: 11px; color: var(--dim); }
details p { padding: 0 0 13px; font-size: 13px; line-height: 1.7; color: var(--dim); white-space: pre-wrap; }

/* 企业新闻：列表 */
.news-item { display: flex; align-items: flex-start; gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.news-item:last-child { border-bottom: 0; }
.news-item > div { flex: 1; min-width: 0; }
.news-item b, .news-item p { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; word-break: break-word; }
.news-item b { font-size: 15px; font-weight: 500; line-height: 1.45; }
.news-item p { margin-top: 4px; font-size: 12px; line-height: 1.6; color: var(--dim); }
.news-item small { display: block; margin-top: 6px; font-size: 11px; color: var(--dim); }
.news-item img { flex: none; width: 104px; height: 74px; border-radius: 8px; object-fit: cover; }
/* 企业新闻：正文（后台富文本编辑器的内容） */
.news-art h2 { font-size: 19px; line-height: 1.45; word-break: break-word; }
.news-art > small { display: block; margin: 8px 0 14px; padding-bottom: 12px; border-bottom: 1px solid var(--line); font-size: 12px; color: var(--dim); }
.rich { font-size: 15px; line-height: 1.85; word-break: break-word; overflow-wrap: anywhere; }
.rich > :last-child { margin-bottom: 0; }
.rich p, .rich ul, .rich ol, .rich blockquote, .rich table, .rich h1, .rich h2, .rich h3, .rich h4 { margin: 0 0 .8em; }
.rich h1, .rich h2 { font-size: 18px; line-height: 1.5; }
.rich h3, .rich h4 { font-size: 16px; line-height: 1.5; }
.rich b, .rich strong { font-weight: 700; font-variant-numeric: normal; }
.rich a { color: var(--brand); text-decoration: underline; }
.rich img { max-width: 100%; height: auto; border-radius: 6px; vertical-align: middle; }
.rich ul, .rich ol { padding-left: 1.5em; }
.rich ul { list-style: disc; }
.rich ol { list-style: decimal; }
.rich blockquote { padding: 8px 12px; border-left: 3px solid var(--brand); border-radius: 0 6px 6px 0; background: var(--line); color: var(--dim); }
.rich blockquote > :last-child { margin-bottom: 0; }
.rich hr { margin: 1em 0; border: 0; border-top: 1px solid var(--line); }
.rich table { display: block; max-width: 100%; overflow-x: auto; border-collapse: collapse; }
.rich td, .rich th { padding: 6px 8px; border: 1px solid var(--line); font-size: 13px; }

/* “我的”页头（六套主题共用）：用户名最长 20 位，一行放不下就折行，头像和实名标记不被挤扁、不被挤出屏幕 */
[data-page="mine"] .avatar, [data-page="mine"] .badge { flex: none; }
[data-page="mine"] .avatar + div { min-width: 0; }
[data-b="phone"] { display: block; line-height: 1.25; word-break: break-all; }

.code-big { padding: 8px 0 4px; text-align: center; font-size: 32px; font-weight: 800; letter-spacing: 6px; color: var(--brand); }

/* 弹窗 */
.modal-mask { position: absolute; inset: 0; z-index: 25; display: grid; place-items: center; padding: 28px; background: rgba(0, 0, 0, .55); }
.modal { width: 100%; max-width: 340px; max-height: 80%; display: flex; flex-direction: column; background: var(--card); border-radius: 14px; overflow: hidden; }
.modal h4 { padding: 16px 16px 6px; text-align: center; font-size: 16px; }
.modal-bd { padding: 8px 16px 14px; overflow-y: auto; font-size: 14px; line-height: 1.7; }
.modal-bd .field { min-height: 46px; }
.modal-ft { display: flex; border-top: 1px solid var(--line); }
.modal-ft button { flex: 1; height: 46px; font-size: 15px; color: var(--dim); }
.modal-ft button + button { color: var(--brand); font-weight: 600; border-left: 1px solid var(--line); }

/* 首页与交易页的补充 */
.sl { cursor: pointer; }
.sl.img { padding: 0 !important; }
.sl.img img { width: 100%; height: 100%; display: block; object-fit: cover; }
/* 站点副标题（后台可改）：只占一行，太长时末尾省略，不把顶部撑宽。
   最大宽度可由各风格用 --slogan-w 调整；左边是 Logo 图片（可能比文字 Logo 宽得多）时再收窄一些 */
[data-b="siteSlogan"] { max-width: min(var(--slogan-w, 230px), var(--slogan-w-img, 230px)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
[data-logo].has-img + * { --slogan-w-img: 150px; }
/* 上传了 Logo 图片：高度沿用各风格的 Logo 高度，宽度按图片比例，去掉文字 Logo 的底色和圆角；过宽时整体缩小，不裁切 */
[data-logo].has-img { display: block; width: auto; max-width: 160px; min-width: 0; flex: 0 1 auto; background: none; box-shadow: none; border-radius: 0; }
[data-logo].has-img img { width: auto; height: 100%; max-width: 100%; display: block; object-fit: contain; object-position: left center; }
.has-dot { position: relative; }
.has-dot::after { content: ""; position: absolute; top: 5px; right: 5px; width: 8px; height: 8px; border-radius: 50%; background: #f0484e; }
.closed-tag { margin-left: 8px; padding: 1px 6px; border-radius: 4px; font-size: 11px; color: var(--dim); background: var(--line); }
.demo-tag { flex: none; text-align: center; font-size: 11px; line-height: 20px; color: #fff; background: #e08a24; }
.chart canvas { touch-action: pan-y; }
.rec-foot .ops { display: flex; gap: 8px; }
.rec-more { display: block; width: 100%; padding: 6px 0 14px; font-size: 12px; color: var(--dim); }

/* 客服页：聊天窗口由 /kf/js/embed.js 渲染在这个容器里，占满标签栏以上的整页。窗口自己的样式在 /kf/css/embed.css */
[data-service] { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.tabbar button.has-dot::after { top: 6px; right: calc(50% - 18px); }
