/* ============================================================
   StR智云 - 界面样式
   品牌蓝源自站点 logo(#0078f8)，纯色为主，克制定制感
   ============================================================ */

:root {
    --bg: #f6f7f9;
    --bg-soft: #f0f2f5;
    --card: #ffffff;
    --border: #e4e7ec;
    --border-soft: #eef0f3;
    --text: #1f2430;
    --text-2: #4a5261;
    --muted: #8790a0;
    --primary: #0078f8;
    --primary-dark: #0064d2;
    --primary-light: #eaf3ff;
    --grad: #0078f8;
    --grad-soft: #eef5ff;
    --danger: #d5483f;
    --danger-light: #fdeceb;
    --success: #16845c;
    --success-light: #e7f5ee;
    --warn: #a8740f;
    --warn-light: #fdf4e2;
    --gold: #c6870a;
    --gold-light: #fff6e1;
    --radius: 10px;
    --radius-sm: 7px;
    --radius-lg: 12px;
    --shadow: 0 1px 3px rgba(24, 32, 48, .05);
    --shadow-md: 0 6px 20px rgba(24, 32, 48, .08);
    --shadow-lg: 0 16px 40px rgba(24, 32, 48, .14);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    line-height: 1.6;
}
a { color: var(--primary); text-decoration: none; transition: color .15s; }
a:hover { color: var(--primary-dark); }
.mono { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 13px; }
.muted { color: var(--muted); }
.text-break { word-break: break-all; }
.container { max-width: 1160px; margin: 0 auto; padding: 0 22px; }

/* ---------- 侧栏 / 导航 ---------- */
.site-header { background: #fff; border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 50; }
.header-flex { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 62px; }
.brand { display: inline-flex; align-items: center; gap: 9px; font-weight: 700; font-size: 17px; color: var(--text); white-space: nowrap; letter-spacing: 0; }
.brand:hover { color: var(--text); }
.brand-logo { width: 30px; height: 30px; flex: none; display: block; }
.brand-mark { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 7px; background: var(--primary); color: #fff; font-size: 16px; font-weight: 700; }
.brand-text { color: var(--text); }
.coin-pill { display: none; align-items: center; gap: 6px; padding: 6px 13px; border-radius: 7px; background: var(--gold-light); color: #8a6109; font-weight: 700; }
.coin-pill .nav-ico { width: 16px; height: 16px; }
.coin-pill small { font-weight: 500; opacity: .8; }
.main-nav a { color: var(--text-2); }
.main-nav a:hover { background: var(--bg-soft); color: var(--text); }
.main-nav a.active { background: var(--primary-light); color: var(--primary); font-weight: 700; }
.main-nav a.nav-logout { color: var(--danger); }
.nav-toggle { display: none; background: #fff; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 6px 12px; font-size: 18px; cursor: pointer; }
.drawer-mask { display: none; }
.nav-ico { display: inline-flex; width: 20px; height: 20px; flex: none; }
.nav-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-ico svg { width: 100%; height: 100%; }
.nav-group-title { font-size: 11px; color: var(--muted); font-weight: 700; padding: 14px 12px 6px; }

@keyframes navLabelShow { from { opacity: 0; } to { opacity: 1; } }

@media (min-width: 761px) {
    .site-header { display: contents; }
    .site-header .brand { display: none; }
    .site-header .coin-pill { display: none; }
    .site-header .header-flex { min-height: 0; }
    .site-footer { display: none; }
    .site-wrap { padding-left: 232px; min-height: 100vh; transition: padding-left .22s ease; }
    .main-nav {
        display: flex; flex-direction: column; align-items: stretch; gap: 3px;
        position: fixed; top: 0; left: 0; bottom: 0; width: 232px;
        background: #fff; border-right: 1px solid var(--border);
        padding: 18px 12px 24px; overflow-y: auto;
        -webkit-overflow-scrolling: touch; overscroll-behavior: contain;
        z-index: 99; transition: width .22s ease, padding .22s ease;
    }
    .main-nav::before { content: ""; display: block; height: 3px; width: 28px; border-radius: 2px; background: var(--primary); margin: 4px 8px 14px; }
    .main-nav a { display: flex; align-items: center; gap: 12px; padding: 10px 13px; border-radius: var(--radius-sm); font-weight: 500; }
    .nav-collapse {
        margin-top: auto; display: flex; align-items: center; gap: 10px;
        padding: 10px 13px; border: 1px solid var(--border); background: #fff;
        color: var(--text-2); font: inherit; cursor: pointer; border-radius: var(--radius-sm);
    }
    .nav-collapse:hover { background: var(--bg-soft); }
    .nav-collapse-ico { display: inline-flex; width: 20px; height: 20px; flex: none; }
    .nav-collapse-ico svg { width: 100%; height: 100%; }
    body.sidebar-collapsed .site-wrap { padding-left: 66px; }
    body.sidebar-collapsed .main-nav { width: 66px; padding: 18px 8px 24px; }
    body.sidebar-collapsed .main-nav a { gap: 0; position: relative; }
    body.sidebar-collapsed .badge-dot { position: absolute; top: 9px; right: 13px; margin: 0; }
    body.sidebar-collapsed .main-nav .nav-label, body.sidebar-collapsed .nav-group-title { display: none; }
    body.sidebar-collapsed .nav-collapse { gap: 0; }
    body.sidebar-collapsed .nav-collapse-ico svg { transform: rotate(180deg); }
    body:not(.sidebar-collapsed) .main-nav .nav-label { opacity: 1; }
}

/* ---------- 访客（未登录）模式：不显示侧栏 ---------- */
body.guest-body .site-wrap { padding-left: 0; }
body.guest-body .main-nav {
    position: static; width: auto; height: auto; flex-direction: row; align-items: center;
    box-shadow: none; border: none; padding: 0; background: transparent; overflow: visible;
}
body.guest-body .main-nav::before { display: none; }
body.guest-body .main-nav a { padding: 8px 14px; }
body.guest-body .nav-collapse { display: none; }
body.guest-body .site-header { display: block; position: sticky; top: 0; }
body.guest-body .header-flex { min-height: 62px; }
body.guest-body .brand { display: inline-flex; }
body.guest-body .main-nav { display: none; }

/* ---------- 通知条 ---------- */
.notice-bar { background: var(--grad-soft); border-bottom: 1px solid var(--border); padding: 9px 0; font-size: 13px; }
.notice-bar .notice-close { border: none; background: none; color: var(--muted); cursor: pointer; font-size: 16px; padding: 0 6px; }
.checkin-toast { display: flex; align-items: center; gap: 10px; margin: 16px 22px 0; padding: 12px 16px; background: var(--gold-light); border: 1px solid #f0dfb4; border-radius: var(--radius); color: #8a6109; box-shadow: var(--shadow); }
.checkin-toast-ico { display: inline-flex; width: 22px; height: 22px; color: var(--gold); }
.checkin-toast-ico .nav-ico { width: 100%; height: 100%; }
.checkin-toast-close { margin-left: auto; border: none; background: none; color: #b98d2d; font-size: 18px; cursor: pointer; }

.main { padding: 28px 0 56px; min-height: 60vh; }

/* ---------- 卡片 ---------- */
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 18px; overflow: hidden; }
.card-body { padding: 22px 24px; }
.page-title { font-size: 17px; margin: 0 0 16px; font-weight: 700; letter-spacing: 0; }
.page-title-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.gap { gap: 18px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; }
@media (max-width: 860px) { .grid-2 { grid-template-columns: 1fr; } }

/* ---------- 按钮 ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 9px 18px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: #fff; color: var(--text-2); font-size: 14px; font-weight: 600; cursor: pointer; transition: background .16s, border-color .16s, color .16s; vertical-align: middle; text-align: center; }
.btn .nav-ico { width: 17px; height: 17px; }
.btn:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); color: #fff; }
.btn-primary small { font-weight: 500; opacity: .85; }
.btn-outline { background: #fff; }
.btn-outline-danger { color: var(--danger); border-color: #f0c9c5; }
.btn-outline-danger:hover { background: var(--danger-light); border-color: var(--danger); color: var(--danger); }
.btn-sm { padding: 5px 12px; font-size: 13px; border-radius: 6px; }
.btn-lg { padding: 12px 24px; font-size: 15px; border-radius: var(--radius-sm); }
.btn-block { width: 100%; }
.btn:disabled, .btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn-row { display: flex; gap: 9px; flex-wrap: wrap; }

/* ---------- 表单 ---------- */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; margin-bottom: 7px; font-weight: 600; color: var(--text-2); }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], select, textarea {
    width: 100%; padding: 10px 13px; border: 1px solid var(--border); border-radius: var(--radius-sm);
    font-size: 14px; font-family: inherit; background: #fff; color: var(--text); transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(0,120,248,.12); }
textarea { resize: vertical; min-height: 90px; }
.input-group { display: flex; gap: 8px; }
.input-group input { flex: 1; min-width: 0; }
.input-group .btn { white-space: nowrap; }
.form-help { margin-top: 9px; font-size: 13px; color: var(--muted); }
.filter-bar { display: flex; gap: 9px; align-items: center; flex-wrap: wrap; }
.filter-bar input, .filter-bar select { max-width: 260px; }
label[for] { cursor: pointer; }
.input-suffix { display: inline-flex; align-items: center; padding: 0 13px; background: var(--bg-soft); border: 1px solid var(--border); border-left: none; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; color: var(--muted); white-space: nowrap; font-size: 13px; }

/* ---------- 表格 ---------- */
.table-scroll { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th, .table td { border-bottom: 1px solid var(--border-soft); padding: 11px 13px; text-align: left; vertical-align: middle; }
.table th { background: var(--bg-soft); font-weight: 700; color: var(--text-2); white-space: nowrap; }
.table th:first-child { border-radius: var(--radius-sm) 0 0 0; }
.table th:last-child { border-radius: 0 var(--radius-sm) 0 0; }
.table tr:hover td { background: #fafbfc; }
.table.kv td:first-child { width: 160px; color: var(--muted); font-weight: 600; }

/* ---------- 徽章 ---------- */
.badge { display: inline-block; padding: 3px 11px; border-radius: 6px; font-size: 12px; font-weight: 600; line-height: 1.6; }
.badge-success { background: var(--success-light); color: var(--success); }
.badge-danger { background: var(--danger-light); color: var(--danger); }
.badge-info { background: var(--primary-light); color: var(--primary); }
.badge-warn { background: var(--warn-light); color: var(--warn); }
.badge-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--danger); margin-left: 6px; vertical-align: 2px; }

/* ---------- 统计卡 ---------- */
.stat-grid { display: grid; gap: 16px; margin-bottom: 18px; grid-template-columns: repeat(3, 1fr); }
.stat-grid-3 { grid-template-columns: repeat(3, 1fr); }
.stat-grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 860px) { .stat-grid, .stat-grid-3, .stat-grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .stat-grid, .stat-grid-3, .stat-grid-4 { grid-template-columns: 1fr 1fr; } }
.stat-box { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); }
.stat-box.good .stat-num { color: var(--success); }
.stat-box.bad .stat-num { color: var(--danger); }
.stat-num { font-size: 27px; font-weight: 700; line-height: 1.2; }
.stat-label { color: var(--muted); font-size: 13px; margin-top: 4px; }

/* ---------- 提示 ---------- */
.alert { padding: 11px 15px; border-radius: var(--radius-sm); margin-bottom: 13px; font-size: 13.5px; border: 1px solid transparent; }
.alert-warning { background: var(--warn-light); color: var(--warn); border-color: #eeddb4; }
.alert-danger { background: var(--danger-light); color: var(--danger); border-color: #f0cfcb; }
.alert-success { background: var(--success-light); color: var(--success); border-color: #c9e6d7; }
.alert-info { background: var(--primary-light); color: var(--primary); border-color: #cfe4fb; }

/* ---------- 弹窗 ---------- */
.modal-mask { position: fixed; inset: 0; background: rgba(20, 26, 40, .5); display: flex; align-items: center; justify-content: center; z-index: 100; padding: 16px; }
.modal { background: #fff; border-radius: var(--radius-lg); width: 100%; max-width: 460px; box-shadow: var(--shadow-lg); max-height: 88vh; overflow: auto; animation: modalIn .18s ease; }
@keyframes modalIn { from { opacity: 0; } to { opacity: 1; } }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 18px 22px; border-bottom: 1px solid var(--border); }
.modal-head h3 { margin: 0; font-size: 16px; }
.modal-close { border: none; background: none; font-size: 22px; cursor: pointer; color: var(--muted); line-height: 1; }
.modal-body { padding: 20px 22px; }
.modal-foot { padding: 14px 22px; border-top: 1px solid var(--border); display: flex; gap: 10px; justify-content: flex-end; }

/* ---------- 消息气泡 ---------- */
.msg { max-width: 86%; padding: 11px 15px; border-radius: var(--radius); font-size: 14px; }
.msg-user { align-self: flex-end; background: var(--primary); color: #fff; border-bottom-right-radius: 4px; }
.msg-ai { align-self: flex-start; background: #fff; border: 1px solid var(--border); border-bottom-left-radius: 4px; }
.msg-body { white-space: pre-wrap; word-break: break-word; }
.typing { color: var(--muted); font-style: italic; }
.typing-dots { display: inline-flex; align-items: center; gap: 5px; padding: 4px 2px; }
.typing-dots span { width: 7px; height: 7px; border-radius: 50%; background: #a7adbd; display: inline-block; animation: typing-bounce 1.2s ease-in-out infinite; }
.typing-dots span:nth-child(2) { animation-delay: .15s; }
.typing-dots span:nth-child(3) { animation-delay: .3s; }
@keyframes typing-bounce { 0%,60%,100% { transform: translateY(0); opacity: .4; } 30% { transform: translateY(-4px); opacity: 1; } }
.typing-cursor { display: inline-block; width: 2px; height: 1em; margin-left: 2px; vertical-align: -1px; background: var(--primary); animation: cursor-blink .8s steps(1) infinite; }
@keyframes cursor-blink { 50% { opacity: 0; } }

/* ---------- 登录 ---------- */
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.auth-card { max-width: 430px; width: 100%; box-shadow: var(--shadow-md); }
.auth-title { text-align: center; font-size: 23px; margin: 0 0 6px; letter-spacing: 0; font-weight: 700; }
.auth-logo { display: block; width: 52px; height: 52px; margin: 0 auto 12px; }

.site-footer { border-top: 1px solid var(--border); background: #fff; padding: 14px 0; color: var(--muted); font-size: 13px; }
.footer-flex { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.faq-item { margin-bottom: 13px; }
.faq-item strong { display: block; }
.faq-item p { margin: 4px 0 0; color: var(--text-2); }

.pagination { display: flex; gap: 6px; justify-content: center; margin-top: 18px; flex-wrap: wrap; }
.pagination a, .pagination span { display: inline-block; min-width: 34px; padding: 6px 10px; text-align: center; border-radius: 7px; border: 1px solid var(--border); background: #fff; }
.pagination .page-cur { background: var(--primary); color: #fff; border-color: var(--primary); }
.pagination .page-dis, .pagination .page-gap { color: var(--muted); border-color: transparent; background: transparent; }

/* ============================================================
   新增组件
   ============================================================ */

/* 页头 Hero */
.page-hero { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 22px 24px; margin-bottom: 20px; border-radius: var(--radius); background: var(--grad-soft); border: 1px solid #dceafb; }
.hero-title { font-size: 23px; margin: 0 0 5px; font-weight: 700; letter-spacing: 0; }
.hero-sub { margin: 0; color: var(--text-2); font-size: 13.5px; }
.hero-balance { display: inline-flex; align-items: center; gap: 8px; padding: 11px 16px; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); color: #8a6109; white-space: nowrap; }
.hero-balance:hover { color: #8a6109; }
.hero-balance .nav-ico { width: 22px; height: 22px; color: var(--gold); }
.hero-balance-num { font-size: 21px; font-weight: 700; }
.hero-balance-label { font-size: 12px; opacity: .8; }

/* 产品分区 */
.product-section { margin-bottom: 26px; }
.section-head { display: flex; align-items: center; gap: 13px; margin-bottom: 14px; }
.section-ico { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: var(--radius-sm); background: var(--primary); color: #fff; flex: none; }
.section-ico .nav-ico { width: 21px; height: 21px; }
.section-ico.small { width: 34px; height: 34px; border-radius: 6px; }
.section-title { margin: 0; font-size: 17px; font-weight: 700; }
.section-desc { margin: 2px 0 0; font-size: 12.5px; color: var(--muted); }
.section-count { margin-left: auto; font-size: 12px; color: var(--muted); background: var(--bg-soft); padding: 4px 12px; border-radius: 6px; }
.product-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 1000px) { .product-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .product-grid { grid-template-columns: 1fr; } }
.product-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.product-card:hover { border-color: var(--primary); }
.product-card-top { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.product-badge { font-size: 11px; font-weight: 700; color: var(--primary); background: var(--primary-light); padding: 3px 10px; border-radius: 6px; }
.product-spec { font-size: 11px; color: var(--muted); }
.product-name { margin: 0 0 8px; font-size: 16px; font-weight: 700; }
.product-desc { margin: 0 0 16px; font-size: 13px; color: var(--muted); flex: 1; }
.product-price { display: flex; align-items: baseline; gap: 4px; margin-bottom: 4px; }
.price-num { font-size: 27px; font-weight: 700; color: var(--primary); }
.price-unit { font-size: 13px; color: var(--muted); }
.product-note { font-size: 11.5px; color: var(--muted); margin: 0 0 14px; }

/* 空状态 */
.empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 40px 20px; text-align: center; background: #fff; border: 1px dashed var(--border); border-radius: var(--radius); }
.empty-ico { display: inline-flex; width: 48px; height: 48px; color: #c3c9d8; margin-bottom: 12px; }
.empty-ico .nav-ico { width: 100%; height: 100%; }
.empty-state p { margin: 0; font-size: 15px; font-weight: 700; color: var(--text-2); }
.empty-hint { margin-top: 6px; font-size: 12.5px; color: var(--muted); }

/* 订单卡 */
.order-list { display: flex; flex-direction: column; }
.order-card { margin-bottom: 16px; }
.order-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.order-title-wrap { display: flex; align-items: center; gap: 12px; }
.order-name { margin: 0; font-size: 16px; font-weight: 700; }
.order-cat { font-size: 12px; color: var(--muted); }
.order-meta { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; padding: 14px 16px; background: var(--bg-soft); border-radius: var(--radius-sm); }
@media (max-width: 720px) { .order-meta { grid-template-columns: repeat(2, 1fr); } }
.meta-item { display: flex; flex-direction: column; }
.meta-label { font-size: 12px; color: var(--muted); }
.meta-value { font-size: 13.5px; font-weight: 600; margin-top: 2px; }
.renew-box { margin-top: 14px; }
.renew-tip { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); padding: 10px 14px; background: var(--bg-soft); border-radius: var(--radius-sm); }
.renew-tip .nav-ico { width: 17px; height: 17px; }
.renew-tip.ok { color: var(--warn); background: var(--warn-light); }
.renew-actions { display: flex; gap: 10px; margin-top: 12px; flex-wrap: wrap; }

/* 硬币中心 */
.coin-hero { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 24px 26px; margin-bottom: 20px; border-radius: var(--radius); background: var(--gold-light); border: 1px solid #f0dfb4; }
.coin-hero-left { display: flex; align-items: center; gap: 18px; }
.coin-hero-ico { display: inline-flex; width: 56px; height: 56px; color: var(--gold); background: #fff; border-radius: var(--radius); padding: 10px; box-shadow: var(--shadow); }
.coin-hero-ico .nav-ico { width: 100%; height: 100%; }
.coin-hero-label { margin: 0; font-size: 13px; color: #9a7418; }
.coin-hero-num { margin: 0; font-size: 36px; font-weight: 700; color: #a8740b; line-height: 1.2; }
.coin-hero-right { text-align: right; }
.coin-hero-hint { margin: 10px 0 0; font-size: 12px; color: #9a7418; }
.usage-list { list-style: none; margin: 0; padding: 0; }
.usage-list li { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px dashed var(--border); font-size: 13.5px; }
.usage-list li:last-child { border-bottom: none; }
.usage-list .nav-ico { width: 18px; height: 18px; color: var(--primary); }
.quick-links { display: flex; flex-direction: column; gap: 10px; }
.quick-link { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); font-weight: 600; background: #fff; }
.quick-link:hover { background: var(--primary-light); border-color: var(--primary); }
.quick-link .nav-ico { width: 19px; height: 19px; color: var(--primary); }
.coin-delta { font-weight: 700; }
.coin-delta.plus { color: var(--success); }
.coin-delta.minus { color: var(--danger); }
.cost-tip { display: flex; align-items: center; gap: 8px; padding: 10px 14px; margin-bottom: 16px; background: var(--gold-light); border: 1px solid #f0e2bd; border-radius: var(--radius-sm); font-size: 13px; color: #8a6109; }
.cost-tip .nav-ico { width: 17px; height: 17px; color: var(--gold); }
.cost-tip a { font-weight: 700; }

/* 入口卡 */
.entry-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.entry-grid-5 { grid-template-columns: repeat(5, 1fr); }
@media (max-width: 1000px) { .entry-grid-5 { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 680px) { .entry-grid, .entry-grid-5 { grid-template-columns: repeat(2, 1fr); } }
.entry-card { display: flex; flex-direction: column; gap: 10px; padding: 20px; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); color: var(--text); transition: border-color .16s; }
.entry-card:hover { border-color: var(--primary); color: var(--text); }
.entry-card h3 { margin: 0; font-size: 15px; font-weight: 700; }
.entry-card p { margin: 0; font-size: 12.5px; color: var(--muted); }
.entry-card.compact { align-items: center; text-align: center; padding: 18px 12px; }
.entry-card.compact h3 { font-size: 13.5px; }
.entry-ico { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: var(--radius-sm); }
.entry-ico .nav-ico { width: 22px; height: 22px; }
.accent-blue { background: var(--primary-light); color: var(--primary); }
.accent-cyan { background: #e6f4f7; color: #12839c; }
.accent-gold { background: var(--gold-light); color: var(--gold); }
.accent-green { background: var(--success-light); color: var(--success); }
.accent-slate { background: #eceff3; color: #5b6675; }
/* 兼容旧类名，改用非紫配色 */
.accent-purple { background: #e6f4f7; color: #12839c; }
.accent-pink { background: #eceff3; color: #5b6675; }
.entry-go { font-size: 12px; color: var(--primary); font-weight: 700; }

/* 模型广场 */
.model-workspace { display: grid; grid-template-columns: 320px 1fr; gap: 18px; }
@media (max-width: 860px) { .model-workspace { grid-template-columns: 1fr; } }
.model-list { display: flex; flex-direction: column; gap: 10px; }
.model-item { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 13px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: #fff; cursor: pointer; transition: border-color .16s, background .16s; }
.model-item:hover { border-color: var(--primary); }
.model-item.selected { border-color: var(--primary); background: var(--primary-light); }
.model-item-ico { display: inline-flex; width: 32px; height: 32px; color: var(--primary); flex: none; }
.model-item-info { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.model-item-info b { font-size: 13.5px; }
.model-item-info small { font-size: 11.5px; color: var(--muted); }
.model-item-check { color: var(--primary); font-weight: 800; opacity: 0; }
.model-item.selected .model-item-check { opacity: 1; }
.model-cost-note { display: flex; align-items: center; gap: 8px; margin-top: 16px; padding: 10px 12px; background: var(--gold-light); border-radius: var(--radius-sm); font-size: 12.5px; color: #8a6109; }
.model-cost-note .nav-ico { width: 16px; height: 16px; color: var(--gold); }
.model-current { font-size: 12px; font-weight: 600; color: var(--primary); background: var(--primary-light); padding: 2px 10px; border-radius: 6px; margin-left: 8px; }
.model-chat { height: 420px; overflow-y: auto; padding: 16px; background: var(--bg-soft); border: 1px solid var(--border); border-radius: var(--radius); display: flex; flex-direction: column; gap: 12px; }
.model-chat-card .ai-input { margin-top: 14px; }
.ai-input { display: flex; gap: 10px; }
.ai-input textarea { flex: 1; }
.ai-input .btn { white-space: nowrap; }
.model-mini-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
@media (max-width: 680px) { .model-mini-grid { grid-template-columns: 1fr; } }
.model-mini { display: flex; gap: 10px; padding: 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.model-mini-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--primary); margin-top: 5px; flex: none; }
.model-mini b { font-size: 13.5px; }
.model-mini p { margin: 3px 0 0; font-size: 12px; color: var(--muted); }

/* ---------- AI 客服原有样式兼容 ---------- */
.ai-card { max-width: 900px; }
.ai-chat { height: 460px; overflow-y: auto; padding: 16px; background: var(--bg-soft); border: 1px solid var(--border); border-radius: var(--radius); display: flex; flex-direction: column; gap: 12px; }
.ai-card-box { margin-top: 12px; background: var(--grad-soft); border: 1px solid #dceafb; border-radius: var(--radius-sm); padding: 13px 15px; font-size: 13px; }
.ai-card-head { font-weight: 700; color: var(--primary); margin-bottom: 6px; }
.ai-card-row { margin-top: 4px; }
.ai-status { display: inline-block; padding: 2px 9px; border-radius: 6px; font-size: 12px; font-weight: 600; }
.ai-status-success { background: var(--success-light); color: var(--success); }
.ai-status-blocked { background: var(--danger-light); color: var(--danger); }
.ai-status-pending { background: var(--warn-light); color: var(--warn); }

/* ---------- 安全验证 AI ---------- */
.secai { border: 1px solid var(--border); background: #fff; border-radius: var(--radius); padding: 14px; margin: 0 0 16px; transition: border-color .25s; }
.secai[data-state="run"] { border-color: #bcdaf9; }
.secai[data-state="ok"] { border-color: #bfe6d0; }
.secai[data-state="warn"] { border-color: #eeddb4; }
.secai[data-state="block"] { border-color: #efc9c5; }
.secai-head { display: flex; align-items: center; gap: 10px; }
.secai-shield { width: 32px; height: 32px; flex: 0 0 32px; display: flex; align-items: center; justify-content: center; color: var(--primary); background: #fff; border: 1px solid var(--border); border-radius: 50%; }
.secai[data-state="ok"] .secai-shield { color: var(--success); border-color: #cbe6d6; }
.secai[data-state="block"] .secai-shield { color: var(--danger); border-color: #eed3cf; }
.secai[data-state="warn"] .secai-shield { color: var(--warn); border-color: #eedfbd; }
.secai-tick { opacity: 0; stroke-dasharray: 14; stroke-dashoffset: 14; transition: opacity .3s, stroke-dashoffset .4s; }
.secai[data-state="ok"] .secai-tick { opacity: 1; stroke-dashoffset: 0; }
.secai-title { flex: 1 1 auto; min-width: 0; }
.secai-name { font-size: 13px; font-weight: 700; color: var(--text); }
.secai-desc { font-size: 12px; color: var(--muted); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.secai-spin { width: 16px; height: 16px; border: 2px solid #d7e2ee; border-top-color: var(--primary); border-radius: 50%; animation: secai-spin .8s linear infinite; flex: 0 0 16px; }
.secai[data-state="ok"] .secai-spin, .secai[data-state="block"] .secai-spin, .secai[data-state="warn"] .secai-spin { display: none; }
@keyframes secai-spin { to { transform: rotate(360deg); } }
.secai-badge { font-size: 11px; padding: 2px 8px; border-radius: 6px; background: var(--success-light); color: var(--success); flex: 0 0 auto; }
.secai[data-state="block"] .secai-badge { background: var(--danger-light); color: var(--danger); }
.secai[data-state="warn"] .secai-badge { background: var(--warn-light); color: var(--warn); }
.secai-bar { height: 4px; background: #e8edf3; border-radius: 4px; overflow: hidden; margin: 11px 0 10px; }
.secai-bar i { display: block; height: 100%; width: 0; background: var(--primary); transition: width .45s ease; }
.secai[data-state="ok"] .secai-bar i { background: var(--success); }
.secai[data-state="block"] .secai-bar i { background: var(--danger); }
.secai[data-state="warn"] .secai-bar i { background: var(--warn); }
.secai-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 5px 10px; }
.secai-steps li { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; min-width: 0; }
.secai-steps li b { width: 12px; height: 12px; flex: 0 0 12px; border: 1px solid #ccd7e3; border-radius: 50%; background: #fff; position: relative; }
.secai-steps li.active { color: var(--primary); }
.secai-steps li.active b { border-color: var(--primary); border-top-color: transparent; animation: secai-spin .8s linear infinite; }
.secai-steps li.done { color: var(--text-2); }
.secai-steps li.done b { background: var(--success); border-color: var(--success); }
.secai-steps li.done b::after { content: ""; position: absolute; left: 3px; top: 1px; width: 4px; height: 7px; border: solid #fff; border-width: 0 1.5px 1.5px 0; transform: rotate(42deg); }
.secai-steps li.fail { color: var(--danger); }
.secai-steps li.fail b { background: var(--danger); border-color: var(--danger); }
.secai-steps li.fail b::after { content: ""; position: absolute; left: 3px; top: 5px; width: 5px; height: 1.5px; background: #fff; transform: rotate(45deg); }
.secai-foot { margin-top: 10px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.secai-note { font-size: 11px; color: var(--muted); line-height: 1.5; }
.secai-retry { font-size: 11px; color: var(--primary); background: none; border: none; padding: 0; cursor: pointer; text-decoration: underline; }
.secai-retry:hover { color: var(--primary-dark); }

/* ---------- 其它 ---------- */
.notice-item { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; }
.notice-tag { font-weight: 700; margin-right: 4px; }
.notice-bar .notice-close { float: none; margin-left: auto; }
.announce-item { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 11px 0; border-bottom: 1px dashed var(--border); }
.announce-item:last-child { border-bottom: none; }
.announce-link { font-weight: 600; }
.announce-item.unread { background: var(--primary-light); padding: 11px 10px; border-radius: 7px; }
.content-body { line-height: 1.8; }
.form-inline { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.form-inline input { flex: 1; min-width: 220px; }
.copy-btn { padding: 3px 10px; font-size: 12px; }
.dns-row { padding: 8px 0; border-bottom: 1px dashed var(--border); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.dns-row:last-child { border-bottom: none; }

@media (max-width: 760px) {
    .header-flex { flex-wrap: wrap; }
    .coin-pill { display: inline-flex; }
    .nav-toggle { display: inline-block; }
    body.drawer-open { overflow: hidden; }
    .drawer-mask { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 98; }
    .drawer-mask.show { display: block; }
    .main-nav { display: flex; flex-direction: column; align-items: stretch; gap: 3px; position: fixed; top: 0; right: 0; bottom: 0; width: 250px; background: #fff; box-shadow: -8px 0 30px rgba(0,0,0,.14); padding: 18px 12px 32px; overflow-y: auto; z-index: 99; transform: translateX(105%); transition: transform .25s ease; }
    .main-nav.open { transform: translateX(0); }
    .main-nav a { display: flex; align-items: center; gap: 12px; padding: 11px 13px; border-radius: var(--radius-sm); }
    .nav-collapse { display: none; }
    .btn { padding: 10px 16px; }
    .btn-sm { padding: 6px 10px; }
    .card-body { padding: 16px; }
    .msg { max-width: 95%; }
    .modal { max-width: 94vw; }
    .ai-chat, .model-chat { height: 58vh; }
    .page-hero, .coin-hero { padding: 18px; flex-direction: column; align-items: flex-start; }
    .coin-hero-right { text-align: left; }
    .entry-grid-5 { grid-template-columns: repeat(2, 1fr); }
    .site-footer { display: none; }
}

@media (max-width: 420px) {
    .secai-steps { grid-template-columns: 1fr; }
    .secai-note { font-size: 10.5px; }
}
