:root {
    --chrome: #F4F5F7;
    --surface: #FFFFFF;
    --chrome-border: #E2E6EC;
    --accent: #2563EB;
    --accent-soft: #EEF4FF;
    --accent-hover: #1D4ED8;
    --text: #1A1D21;
    --muted: #5C6370;
    --canvas-bg: #000000;
    --panel: #FFFFFF;
    --danger: #B91C1C;
    --ok: #2E7D32;
    --busy: #EF6C00;
    --hover: #EEF1F6;
    --checked-hover: #DCE8FF;
}

html, body, #app {
    height: 100%;
    margin: 0;
    font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    font-size: 14px;
    background: var(--chrome);
    color: var(--text);
}

a { color: var(--accent); }

.btn, button.btn {
    border: none;
    background: transparent;
    color: var(--text);
    border-radius: 8px;
    padding: 8px 12px;
    min-height: 40px;
    cursor: pointer;
}
.btn:hover { background: var(--hover); }
.btn-accent, .btn-primary {
    background: var(--accent) !important;
    color: #fff !important;
    font-weight: 600;
}
.btn-accent:hover, .btn-primary:hover { background: var(--accent-hover) !important; }
.btn-ghost { background: transparent; }
.btn-block { width: 100%; margin: 0.35rem 0; }
.btn-mini {
    border: 1px solid var(--chrome-border);
    background: #fff;
    border-radius: 6px;
    padding: 0.2rem 0.45rem;
    cursor: pointer;
    font-size: 12px;
    min-height: auto;
}

.form-control {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid var(--chrome-border);
    border-radius: 6px;
    padding: 0.4rem 0.5rem;
    margin-bottom: 0.5rem;
    background: #fff;
    color: var(--text);
}
.form-control-sm { padding: 0.25rem 0.4rem; font-size: 12px; margin-bottom: 0; }

/* ÃÂ¢ÃÂÃÂÃÂ¢ÃÂÃÂ ÃÂ§ÃÂÃÂ»ÃÂ¥ÃÂ½ÃÂÃÂ¯ÃÂ¼ÃÂÃÂ¦ÃÂµÃ
ÃÂ¨ÃÂÃÂ²ÃÂ¯ÃÂ¼ÃÂÃÂ¨ÃÂ´ÃÂ´ÃÂ¨ÃÂ¿ÃÂ PC chromeÃÂ¯ÃÂ¼ÃÂ ÃÂ¢ÃÂÃÂÃÂ¢ÃÂÃÂ */
.login-page {
    position: relative;
    height: 100vh;
    display: grid;
    place-items: center;
    overflow: hidden;
    background: linear-gradient(160deg, #E8ECF2 0%, #F4F5F7 50%, #DDE5F5 100%);
}
.login-bg, .login-grid { display: none; }
.login-card {
    width: min(400px, 92vw);
    background: #fff;
    border: 1px solid var(--chrome-border);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 8px 24px rgba(26, 29, 33, 0.08);
}
.login-brand { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.35rem; }
.login-mark {
    width: 40px; height: 40px; border-radius: 10px;
    background: var(--accent);
    flex-shrink: 0;
}
.login-eyebrow { margin: 0; font-size: 0.75rem; color: var(--accent); letter-spacing: 0.08em; font-weight: 600; }
.login-card h1, .login-shell h1 { font-size: 1.35rem; margin: 0; color: var(--text); font-weight: 650; }
.login-sub, .login-hint, .muted { color: var(--muted); font-size: 0.85rem; }
.login-actions { display: flex; gap: 0.5rem; margin-top: 0.75rem; flex-wrap: wrap; }
.login-error { color: var(--danger); font-size: 0.85rem; margin: 0.4rem 0; }
.ok-msg { color: var(--ok); font-size: 0.85rem; margin: 0.4rem 0; }
.login-modal-backdrop { z-index: 450; }
.login-modal-card { width: min(400px, 94vw); max-height: min(90vh, 820px); overflow-y: auto; }
.register-modal-card { width: min(460px, 94vw); }
.login-shell {
    width: min(400px, 94vw);
    max-height: min(92vh, 860px);
    overflow: auto;
    padding: 0;
    border-radius: 12px;
}
.login-shell-register { width: min(440px, 94vw); }
.login-shell-head {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1.1rem 1.2rem 0.85rem;
    border-bottom: 1px solid var(--chrome-border);
    background: #fff;
}
.login-shell-titles { flex: 1; min-width: 0; }
.login-shell-titles .login-sub { margin: 0.2rem 0 0; line-height: 1.4; }
.login-close {
    border: none;
    background: transparent;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    font-size: 1.4rem;
    line-height: 1;
    color: var(--muted);
    cursor: pointer;
}
.login-close:hover { background: var(--hover); color: var(--text); }
.login-body { padding: 0.9rem 1.2rem 1.2rem; }
.login-body .form-control { margin-bottom: 0.55rem; }
.login-submit { width: 100%; margin-top: 0.45rem; min-height: 42px; }
.login-or {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin: 0.85rem 0 0.65rem;
    color: var(--muted);
    font-size: 12px;
}
.login-or::before, .login-or::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--chrome-border);
}
.login-wx-entry {
    width: 100%;
    min-height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: #07C160 !important;
    color: #fff !important;
    font-weight: 600;
}
.login-wx-entry:hover { background: #06AD56 !important; }
.login-wx-icon {
    width: 18px;
    height: 18px;
    border-radius: 4px;
    background:
        radial-gradient(circle at 6px 7px, #fff 2px, transparent 2.2px),
        radial-gradient(circle at 12px 7px, #fff 2px, transparent 2.2px),
        #07C160;
    box-shadow: inset 0 0 0 1.5px #fff;
}
.login-switch { margin: 0.75rem 0 0; font-size: 13px; color: var(--muted); }
.login-link {
    border: none;
    background: none;
    color: var(--accent);
    cursor: pointer;
    padding: 0;
    font: inherit;
    font-weight: 600;
}
.login-link:hover { text-decoration: underline; }
.login-wx-backdrop { z-index: 460; }
.login-wx-sheet {
    width: min(360px, 92vw);
    padding: 1rem 1.15rem 1.15rem;
    text-align: center;
}
.login-wx-sheet-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    text-align: left;
}
.login-wx-sheet-head h2 { margin: 0; font-size: 1.05rem; }
.login-wx-title { margin: 0; font-weight: 650; font-size: 14px; }
.login-wx-hint, .login-wx-wait, .login-wx-account, .login-wx-code-label {
    margin: 0.45rem 0 0;
    font-size: 12px;
    color: var(--muted);
    line-height: 1.45;
}
.login-wx-qr-wrap {
    margin: 0.75rem auto 0;
    width: 196px;
    height: 196px;
    border: 1px solid var(--chrome-border);
    border-radius: 10px;
    background: #fff;
    display: grid;
    place-items: center;
    overflow: hidden;
}
.login-wx-qr { width: 188px; height: 188px; object-fit: contain; display: block; }
.login-wx-qr-empty { padding: 0.75rem; font-size: 12px; color: var(--muted); }
.login-wx-code {
    margin: 0.5rem 0 0;
    font-size: 1.85rem;
    font-weight: 700;
    letter-spacing: 0.38em;
    padding-left: 0.38em;
    color: var(--text);
    font-variant-numeric: tabular-nums;
    font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
}
.login-wx-refresh { margin-top: 0.7rem; min-height: 36px; }
.login-reg-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 0.75rem;
}
.login-code-btn { flex-shrink: 0; white-space: nowrap; }
.wx-admin-qr { display: block; width: 160px; height: 160px; object-fit: contain; margin: 0.5rem 0; border: 1px solid var(--chrome-border); border-radius: 8px; }
@media (max-width: 520px) {
    .login-reg-grid { grid-template-columns: 1fr; }
}
.login-captcha-row {
    display: flex;
    gap: 8px;
    align-items: stretch;
    margin-bottom: 0.25rem;
}
.login-captcha-row .form-control { flex: 1; min-width: 0; margin-bottom: 0; }
.login-captcha-img-btn {
    flex-shrink: 0;
    width: 120px;
    height: 40px;
    padding: 0;
    border: 1px solid var(--chrome-border);
    border-radius: 8px;
    background: #F8FAFC;
    cursor: pointer;
    overflow: hidden;
    display: grid;
    place-items: center;
}
.login-captcha-img-btn:hover { border-color: #93C5FD; }
.login-captcha-img { width: 120px; height: 40px; display: block; }
.guest-login-btn { margin-left: 0.35rem; }
.announce-btn {
    position: relative;
    margin-left: 0.35rem;
    height: 22px;
    padding: 0 10px;
    border-radius: 999px;
    border: 1px solid #C7D2FE;
    background: #EEF2FF;
    color: #3730A3;
    font-size: 12px;
    cursor: pointer;
}
.announce-btn:hover { background: #E0E7FF; }
.announce-dot {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #DC2626;
    box-shadow: 0 0 0 2px #fff;
}
.announce-list { list-style: none; margin: 0.5rem 0 0; padding: 0; max-height: 320px; overflow: auto; }
.announce-item {
    width: 100%;
    text-align: left;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    padding: 0.55rem 0.65rem;
    border: 1px solid var(--chrome-border);
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    margin-bottom: 6px;
}
.announce-list li.unread .announce-item { border-color: #93C5FD; background: #EFF6FF; }
.announce-tag {
    font-size: 10px;
    padding: 1px 6px;
    border-radius: 999px;
    background: #FEE2E2;
    color: #B91C1C;
}
.announce-force-backdrop { z-index: 460; }
.announce-force-title { margin: 0.35rem 0; font-size: 1rem; }
.announce-force-body {
    white-space: pre-wrap;
    font-size: 13px;
    line-height: 1.5;
    max-height: 40vh;
    overflow: auto;
    margin: 0.5rem 0 0;
}
.register-card { width: min(460px, 94vw); }
.ai-guest-lock {
    height: 100%;
    min-height: 180px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1.25rem;
    text-align: center;
    background: linear-gradient(180deg, #F8FAFC 0%, #EEF2FF 100%);
}
.ai-guest-lock h3 { margin: 0.25rem 0 0; font-size: 1rem; }
.ai-guest-lock .muted { margin: 0 0 0.5rem; font-size: 12.5px; }

/* ÃÂ¢ÃÂÃÂÃÂ¢ÃÂÃÂ ÃÂ¤ÃÂ¸ÃÂ»ÃÂ¥ÃÂ£ÃÂ³ÃÂ¯ÃÂ¼ÃÂÃÂ¥ÃÂ¯ÃÂ¹ÃÂ©ÃÂ½ÃÂ MainWindow ÃÂ¢ÃÂÃÂÃÂ¢ÃÂÃÂ */
.draw-app {
    display: grid;
    grid-template-rows: auto auto 1fr auto;
    height: 100vh;
    height: 100dvh;
    min-width: 1100px; /* 缩放缩窄视口时保持结构，横向滚动而非挤乱 */
    background: var(--chrome);
    padding: 0;
    overflow: auto;
}

.menubar {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 0.15rem;
    padding: 0 8px;
    height: 30px;
    min-height: 30px;
    border-bottom: 1px solid var(--chrome-border);
    background: var(--chrome);
    font-size: 13px;
    user-select: none;
    overflow: visible; /* 不可 hidden，否则下拉菜单被裁切 */
    position: relative;
    z-index: 40;
}
.menu { position: relative; flex-shrink: 0; }
.menu-btn {
    background: transparent;
    border: none;
    padding: 0.2rem 0.55rem;
    cursor: pointer;
    border-radius: 4px;
    color: var(--text);
}
.menu:hover .menu-btn, .menu:focus-within .menu-btn { background: #E5E7EB; }
.menu-drop {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 168px;
    background: #fff;
    border: 1px solid var(--chrome-border);
    border-radius: 8px;
    box-shadow: 0 6px 16px rgba(0,0,0,0.12);
    z-index: 200;
    padding: 0.25rem 0;
}
.menu:hover .menu-drop, .menu:focus-within .menu-drop { display: block; }
.menu-drop button, .menu-drop .file-label {
    display: block;
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    padding: 0.4rem 0.75rem;
    cursor: pointer;
    font-size: 13px;
    color: var(--text);
}
.menu-drop button:hover, .menu-drop .file-label:hover { background: var(--accent-soft); }
.menu-drop hr { margin: 0.25rem 0; border: none; border-top: 1px solid var(--chrome-border); }
.file-label { position: relative; overflow: hidden; }
.file-label input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.menubar-title {
    margin-left: auto;
    color: var(--muted);
    font-size: 12px;
    min-width: 0;
    max-width: 28vw;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex-shrink: 1;
}
.menubar-user { margin-left: 0.75rem; font-size: 12px; color: var(--accent); }
.announce-btn,
.online-badge,
.user-center,
.guest-login-btn {
    flex-shrink: 0;
}

/* 右上角用户中心 */
.user-center {
    position: relative;
    margin-left: 0.75rem;
    flex-shrink: 0;
}
.user-center-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 999px;
    padding: 1px 8px 1px 2px;
    cursor: pointer;
    color: var(--text);
    font-size: 12px;
    height: 24px;
}
.user-center-btn:hover,
.user-center:focus-within .user-center-btn {
    background: #E8EEF5;
    border-color: var(--chrome-border);
}
.user-avatar {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3B82F6, #0EA5E9);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.user-avatar.lg {
    width: 48px;
    height: 48px;
    font-size: 20px;
}
.user-avatar.img {
    object-fit: cover;
    padding: 0;
    background: #E5E7EB;
}
.user-avatar-edit {
    position: relative;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    cursor: pointer;
}
.user-avatar-edit-tip {
    font-size: 11px;
    color: var(--accent);
}
.user-profile-fields { flex: 1; min-width: 0; }
.user-modal-wide { width: min(520px, 96vw); }
.user-balance-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 0.75rem 0;
    padding: 0.65rem 0.75rem;
    background: #F8FAFC;
    border: 1px solid var(--chrome-border);
    border-radius: 8px;
}
.user-balance { font-size: 1.15rem; margin-left: 8px; color: #0F172A; }
.recharge-panel { margin-bottom: 0.75rem; }
.recharge-packs {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    margin: 0.4rem 0 0.6rem;
}
.plan-item-with-icon {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    text-align: left;
}
.plan-item-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
.plan-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    flex-shrink: 0;
    color: #fff;
    background: #92400E;
}
.plan-icon-bronze { background: linear-gradient(145deg, #B45309, #92400E); }
.plan-icon-silver { background: linear-gradient(145deg, #94A3B8, #64748B); }
.plan-icon-gold { background: linear-gradient(145deg, #FBBF24, #D97706); color: #422006; }
.plan-icon-platinum { background: linear-gradient(145deg, #E2E8F0, #64748B); color: #0F172A; }
.plan-icon-diamond { background: linear-gradient(145deg, #67E8F9, #0284C7); }
.plan-icon-star { background: linear-gradient(145deg, #F472B6, #DB2777); }
.plan-icon-rocket { background: linear-gradient(145deg, #FB923C, #EA580C); }
.plan-icon-free { background: linear-gradient(145deg, #86EFAC, #16A34A); }

/* 升级会员：紧凑横向行 */
.user-modal-upgrade { width: min(460px, 94vw); }
.plan-upgrade-hint { margin: 0.15rem 0 0.55rem; font-size: 12.5px; }
.plan-upgrade-hint strong { color: var(--text); font-weight: 600; }
.plan-list-upgrade {
    max-height: min(320px, 48vh);
    gap: 4px;
}
.plan-row {
    width: 100%;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    padding: 0.45rem 0.65rem;
    border: 1px solid var(--chrome-border);
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    text-align: left;
}
.plan-row:hover { border-color: #93C5FD; background: #F8FAFC; }
.plan-row.active {
    border-color: var(--accent);
    background: #EFF6FF;
}
.plan-row .plan-icon {
    width: 26px;
    height: 26px;
    font-size: 12px;
}
.plan-row-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
}
.plan-row-title {
    font-size: 13.5px;
    font-weight: 650;
    color: var(--text);
    line-height: 1.25;
}
.plan-row-meta {
    font-size: 11.5px;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.plan-row-price {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;
    min-width: 64px;
    font-size: 14px;
    font-weight: 700;
    color: #0F172A;
    line-height: 1.15;
}
.plan-row-price small {
    font-size: 10px;
    font-weight: 500;
    color: var(--muted);
}
.plan-row-price.free {
    font-size: 12.5px;
    font-weight: 600;
    color: #15803D;
}
.online-badge {
    margin-left: 0.5rem;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    color: var(--muted);
    padding: 0 8px;
    height: 22px;
    border-radius: 999px;
    background: #EEF2FF;
    border: 1px solid #C7D2FE;
    white-space: nowrap;
}
.online-badge strong { color: #3730A3; font-weight: 600; }
.online-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #22C55E;
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.25);
}
.user-center-label { font-weight: 600; color: var(--accent); }
.user-center-name {
    max-width: 96px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--muted);
}
.user-center-menu {
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    min-width: 168px;
    background: #fff;
    border: 1px solid var(--chrome-border);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
    padding: 4px;
    z-index: 50;
    display: flex;
    flex-direction: column;
}
.user-center-menu button {
    text-align: left;
    background: transparent;
    border: none;
    padding: 0.45rem 0.65rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    color: var(--text);
}
.user-center-menu button:hover { background: #F1F5F9; }
.user-center-menu button.danger { color: #B91C1C; }
.user-center-menu hr {
    border: none;
    border-top: 1px solid var(--chrome-border);
    margin: 4px 0;
}
.user-modal { width: min(440px, 94vw); }
.user-profile-head {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0.5rem 0 0.75rem;
}
.user-wx-bind-btn { width: auto; min-height: 36px; padding: 0 12px; }
.user-wx-row { margin-top: 0.35rem; }
.plan-list {
    list-style: none;
    margin: 0.5rem 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 240px;
    overflow: auto;
}
.plan-item {
    width: 100%;
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 0.55rem 0.7rem;
    border: 1px solid var(--chrome-border);
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
}
.plan-item:hover { border-color: #93C5FD; }
.plan-item.active {
    border-color: var(--accent);
    background: #EFF6FF;
}

/* ÃÂ¥ÃÂ·ÃÂ¥ÃÂ¥Ã
ÃÂ·ÃÂ¦ÃÂ ÃÂÃÂ¥ÃÂÃÂ¡ÃÂ§ÃÂÃÂ = PanelCardStyle */
.toolbar-card {
    margin: 8px 8px 0;
    padding: 6px 8px;
    background: var(--surface);
    border: 1px solid var(--chrome-border);
    border-radius: 12px;
    overflow: visible;
    flex-shrink: 0;
}
.toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0;
}
.tb-group {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    margin-right: 4px;
}
.tb-sep {
    width: 1px;
    height: 28px;
    background: var(--chrome-border);
    margin: 0 12px 0 8px;
    align-self: center;
}
.tb-btn {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-height: 44px;
    min-width: 52px;
    max-width: 72px;
    padding: 4px 6px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--text);
    cursor: pointer;
    font-size: 11px;
    white-space: nowrap;
}
.tb-btn:hover { background: var(--hover); }
.tb-btn.active {
    background: var(--accent-soft);
    color: var(--accent);
}
.tb-btn.active:hover { background: var(--checked-hover); }
.tb-btn.primary {
    background: var(--accent);
    color: #fff;
    font-weight: 600;
}
.tb-btn.primary:hover { background: var(--accent-hover); color: #fff; }
.tb-btn .tb-icon {
    width: 16px;
    height: 16px;
    display: grid;
    place-items: center;
    flex-shrink: 0;
}
.tb-btn .tb-icon svg { width: 16px; height: 16px; display: block; }
.tb-label {
    line-height: 1.1;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}
.tb-btn-text {
    flex-direction: row;
    min-width: 48px;
    max-width: none;
    min-height: 32px;
    padding: 4px 10px;
    font-size: 12px;
}
.tb-field {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0 4px;
    font-size: 12px;
    color: var(--muted);
    white-space: nowrap;
}
.tb-field strong { color: var(--text); min-width: 28px; }
.tb-field input[type="text"],
.tb-field input[type="number"] {
    width: 48px;
    height: 28px;
    border: 1px solid var(--chrome-border);
    border-radius: 6px;
    padding: 2px 6px;
    background: #fff;
}
.tb-field input[type="range"] {
    width: 100px;
    height: 22px;
    accent-color: var(--accent);
}
.tb-swatch {
    width: 16px;
    height: 16px;
    border-radius: 3px;
    border: 1px solid var(--chrome-border);
    background: #000;
}

.workspace {
    display: grid;
    /* 右侧加宽：属性 + 小七并排时给足宽度，避免挤在一起 */
    grid-template-columns: 220px 8px minmax(280px, 1fr) 8px 340px;
    min-height: 0;
    min-width: 1180px;
    overflow: hidden;
    margin: 8px;
    gap: 0;
}
.workspace.right-wide {
    grid-template-columns: 220px 8px minmax(260px, 1fr) 8px 560px;
}
.workspace.no-left { grid-template-columns: minmax(280px, 1fr) 8px 340px; }
.workspace.no-left.right-wide { grid-template-columns: minmax(260px, 1fr) 8px 560px; }
.workspace.no-right { grid-template-columns: 220px 8px minmax(280px, 1fr); }
.workspace.no-left.no-right { grid-template-columns: 1fr; }

.panel-card {
    background: var(--surface);
    border: 1px solid var(--chrome-border);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}
.panel-left { width: 100%; min-width: 180px; }
.panel-right {
    width: 100%;
    min-width: 0;
    min-height: 0;
    display: grid;
    gap: 0;
    background: transparent;
    border: none;
    align-content: stretch;
}
/* 图元属性 | 小七：两列都加宽，比例接近 1:1.15 */
.panel-right.two-cols {
    grid-template-columns: minmax(200px, 1fr) 8px minmax(260px, 1.2fr);
    grid-template-rows: 1fr;
}
.panel-right.one-col {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr;
}
.panel-right > .panel-card { min-height: 0; min-width: 0; }
.panel-right-split {
    width: 8px;
    cursor: col-resize;
    background: transparent;
}
.ws-split { width: 8px; cursor: col-resize; background: transparent; }
.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.55rem 0.75rem;
    font-weight: 600;
    font-size: 13px;
    border-bottom: 1px solid var(--chrome-border);
    background: #FAFBFC;
}
.panel-header-actions { display: flex; align-items: center; gap: 4px; }
.btn-mini-reward {
    border-color: #BFDBFE;
    background: var(--accent-soft);
    color: var(--accent);
    font-weight: 600;
}
.btn-mini-reward:hover { background: var(--checked-hover); }
.panel-error { color: var(--danger); font-size: 12px; padding: 0 0.55rem; }
.panel-ok { color: var(--ok); font-size: 12px; padding: 0 0.55rem; }
.panel-hint { color: var(--muted); font-size: 11px; padding: 0.35rem 0.55rem 0.55rem; }

.module-list {
    list-style: none;
    margin: 0;
    padding: 0.25rem;
    overflow: auto;
    flex: 1;
}
.module-list li {
    padding: 0.45rem 0.5rem;
    border-radius: 8px;
    cursor: grab;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.module-list li:hover,
.module-list li.selected { background: var(--accent-soft); }
.module-list li strong { font-size: 13px; display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.module-badge {
    font-size: 10px;
    font-weight: 600;
    border-radius: 4px;
    padding: 0 5px;
    line-height: 16px;
    white-space: nowrap;
}
.module-badge-local { background: #E8F0FE; color: #1A56DB; }
.module-badge-cloud { background: #E7F6EC; color: #0F7B3A; }
.module-badge-pending { background: #FFF4D6; color: #9A6700; }
.module-badge-rejected { background: #FDE8E8; color: #C81E1E; }
.module-preview {
    position: relative;
    margin: 0.4rem 0.55rem;
    flex: 0 0 140px;
    height: 140px;
    min-height: 140px;
    border-radius: 8px;
    border: 1px solid var(--chrome-border);
    background: #000;
    color: #9CA3AF;
    font-size: 12px;
    overflow: hidden;
}
.module-preview > span {
    position: absolute;
    inset: 0;
    z-index: 1;
    display: grid;
    place-items: center;
    pointer-events: none;
    padding: 0.5rem;
    text-align: center;
}
.module-preview-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
}

.canvas-main {
    min-width: 0;
    min-height: 0;
    background: var(--surface);
    border: 1px solid var(--chrome-border);
    border-radius: 12px;
    overflow: hidden;
}
.canvas-host {
    position: relative;
    width: 100%;
    height: 100%;
    outline: none;
    /* 与画板默认底色一致，避免任何闪帧露出页面白底 */
    background: #000000;
}
.draw-canvas {
    width: 100%;
    height: 100%;
    display: block;
    cursor: crosshair;
    touch-action: none;
    background: var(--canvas-bg);
}
/* 拖动虚影层：几何只烘焙一次，位移用 CSS transform（对标 PC BitmapCache） */
.draw-canvas-ghost {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    display: none;
    pointer-events: none;
    z-index: 2;
    will-change: transform;
}

.prop-body, .ai-input { padding: 0.55rem; font-size: 12px; }
.prop-pre {
    white-space: pre-wrap;
    background: #F8FAFC;
    border: 1px solid var(--chrome-border);
    border-radius: 6px;
    padding: 0.4rem;
    font-size: 11px;
}
.prop-row { display: flex; gap: 4px; align-items: center; }

/* ÃÂ¥ÃÂ°ÃÂÃÂ¤ÃÂ¸ÃÂ ÃÂ¢ÃÂÃÂ ÃÂ¥ÃÂ¯ÃÂ¹ÃÂ©ÃÂ½ÃÂ AiAssistPanel */
.ai-panel { display: flex; flex-direction: column; min-height: 0; height: 100%; }
.ai-header {
    display: flex;
    gap: 10px;
    padding: 12px 14px 10px;
    background: linear-gradient(135deg, #EEF4FF 0%, #F8FAFC 55%, #FFFFFF 100%);
    border-bottom: 1px solid var(--chrome-border);
}
.ai-avatar {
    width: 40px; height: 40px; border-radius: 20px;
    background: var(--accent); color: #fff;
    display: grid; place-items: center;
    font-weight: 600; font-size: 18px; flex-shrink: 0;
}
.ai-head-main { flex: 1; min-width: 0; }
.ai-head-row {
    display: flex; align-items: center; justify-content: space-between; gap: 6px;
}
.ai-title { font-weight: 600; font-size: 16px; }
.ai-status {
    padding: 3px 8px; border-radius: 10px; font-size: 11px;
    background: #E8F5E9; color: var(--ok);
}
.ai-status.busy { background: #FFF3E0; color: var(--busy); }
.ai-clear {
    border: none; background: transparent; color: var(--muted);
    cursor: pointer; font-size: 12px; padding: 2px 6px; border-radius: 6px;
}
.ai-clear:hover { background: var(--hover); color: var(--text); }
.ai-sub { margin: 4px 0 0; font-size: 12px; color: var(--muted); display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.ai-memory-link {
    border: none;
    background: transparent;
    color: var(--accent);
    cursor: pointer;
    font-size: 11.5px;
    padding: 0;
    text-decoration: underline;
    text-underline-offset: 2px;
}
.ai-memory-link:hover { color: #1D4ED8; }

.ai-log {
    flex: 1;
    overflow: auto;
    padding: 0.55rem;
    font-size: 12px;
    min-height: 80px;
    background: #F3F6FB;
}
.ai-msg {
    margin-bottom: 0.55rem;
    padding: 0.5rem 0.6rem;
    border-radius: 10px;
    max-width: 95%;
}
.ai-msg.user {
    background: var(--accent);
    color: #fff;
    margin-left: auto;
}
.ai-msg.assistant {
    background: #fff;
    border: 1px solid var(--chrome-border);
    color: var(--text);
}
.ai-msg strong { display: block; margin-bottom: 0.2rem; font-size: 11px; opacity: 0.85; }
.ai-composer {
    border-top: 1px solid var(--chrome-border);
    padding: 0.55rem 0.6rem 0.65rem;
    background: #F8FAFC;
}
.ai-ref-chip {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 0.4rem;
    padding: 0.3rem 0.45rem 0.3rem 0.55rem;
    border-radius: 8px;
    background: #EEF2FF;
    border: 1px solid #C7D2FE;
    font-size: 11.5px;
    color: #3730A3;
}
.ai-ref-chip-text {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.ai-ref-clear {
    border: none;
    background: transparent;
    color: #6366F1;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    padding: 2px 4px;
    border-radius: 4px;
}
.ai-ref-clear:hover { background: #E0E7FF; color: #312E81; }
.ai-composer-box {
    display: flex;
    flex-direction: column;
    gap: 0;
    background: #fff;
    border: 1px solid var(--chrome-border);
    border-radius: 12px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    overflow: hidden;
}
.ai-composer-box:focus-within {
    border-color: #93C5FD;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}
.ai-composer-input {
    width: 100%;
    box-sizing: border-box;
    border: none;
    outline: none;
    resize: vertical;
    min-height: 52px;
    max-height: 140px;
    padding: 0.65rem 0.75rem 0.35rem;
    font-size: 13px;
    line-height: 1.45;
    color: var(--text);
    background: transparent;
    font-family: inherit;
}
.ai-composer-input:disabled { opacity: 0.55; }
.ai-composer-input::placeholder { color: #94A3B8; }
.ai-composer-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 0.35rem 0.45rem 0.45rem 0.5rem;
    border-top: 1px solid #F1F5F9;
}
.ai-composer-bar-left {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    min-width: 0;
    flex: 1;
}
.ai-model-select {
    max-width: 148px;
    border: 1px solid var(--chrome-border);
    border-radius: 999px;
    padding: 4px 8px;
    font-size: 11.5px;
    background: #F8FAFC;
    color: var(--text);
    cursor: pointer;
}
.ai-chip {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid var(--chrome-border);
    background: #fff;
    font-size: 11.5px;
    color: var(--muted);
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}
.ai-chip input[type="checkbox"] {
    width: 12px;
    height: 12px;
    margin: 0;
    accent-color: var(--accent);
}
.ai-chip.on {
    border-color: #93C5FD;
    background: #EFF6FF;
    color: var(--accent);
}
.ai-attach {
    overflow: hidden;
}
.ai-attach:hover { border-color: #93C5FD; color: var(--accent); }
.ai-file-native {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    font-size: 0;
}
.ai-send {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: none;
    background: var(--accent);
    color: #fff;
    cursor: pointer;
    font-size: 14px;
    flex-shrink: 0;
    display: grid;
    place-items: center;
}
.ai-send:hover:not(:disabled) { filter: brightness(1.06); }
.ai-send:disabled { opacity: 0.45; cursor: default; }

.ai-quota-bar {
    flex-shrink: 0;
    padding: 0.4rem 0.65rem 0.5rem;
    background: #fff;
    border-top: 1px solid var(--chrome-border);
}
.ai-quota-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 0.28rem;
    font-size: 11px;
    color: var(--muted);
}
.ai-quota-meta span:last-child {
    font-variant-numeric: tabular-nums;
    color: var(--text);
    font-weight: 550;
}
.ai-quota-track {
    height: 6px;
    border-radius: 999px;
    background: #E2E8F0;
    overflow: hidden;
}
.ai-quota-fill {
    height: 100%;
    border-radius: inherit;
    transition: width 0.25s ease;
}
.ai-quota-fill.ok { background: linear-gradient(90deg, #38BDF8, #2563EB); }
.ai-quota-fill.warn { background: linear-gradient(90deg, #FBBF24, #F59E0B); }
.ai-quota-fill.danger { background: linear-gradient(90deg, #FB7185, #DC2626); }
.ai-quota-fill.unlimited { background: linear-gradient(90deg, #34D399, #059669); }
.ai-quota-fill.muted { background: #CBD5E1; width: 0 !important; }

.statusbar {
    display: flex;
    flex-wrap: nowrap;
    gap: 1rem;
    padding: 0.25rem 12px;
    font-size: 12px;
    color: var(--muted);
    border-top: 1px solid var(--chrome-border);
    background: var(--chrome);
    white-space: nowrap;
    overflow-x: auto;
    flex-shrink: 0;
}
.statusbar-version {
    margin-left: auto;
    padding-left: 1rem;
    font-variant-numeric: tabular-nums;
    color: var(--muted);
    user-select: none;
}

.settings-page { padding: 1rem 1.25rem; max-width: 560px; }
.settings-header { display: flex; align-items: center; gap: 1rem; }
.settings-body label { display: block; margin-top: 0.5rem; font-size: 13px; }
.settings-check { display: flex; align-items: center; gap: 8px; margin: 0.6rem 0; }
.settings-check input { margin: 0; accent-color: var(--accent); }
.settings-fact-list { margin: 0.4rem 0 0.8rem; padding-left: 0; list-style: none; }
.settings-fact-list li {
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
    padding: 0.4rem 0.5rem; border: 1px solid var(--chrome-border);
    border-radius: 8px; margin-bottom: 6px; background: #fff; font-size: 13px;
}
.settings-mem-actions { display: flex; gap: 8px; margin-top: 0.75rem; }

.modal-backdrop {
    position: fixed; inset: 0;
    background: rgba(15, 23, 42, 0.35);
    display: grid; place-items: center; z-index: 100;
}
.modal-card {
    background: #fff; border-radius: 12px; padding: 1.25rem;
    width: min(380px, 92vw); border: 1px solid var(--chrome-border);
    box-shadow: 0 12px 40px rgba(15, 23, 42, 0.18);
}
.app-dialog-backdrop { z-index: 400; }
.app-dialog-card { width: min(420px, 92vw); }
.app-dialog-msg {
    white-space: pre-wrap; margin: 0.5rem 0 1rem; font-size: 14px; color: var(--text); line-height: 1.45;
}
.app-dialog-label { display: block; margin: 0.55rem 0 0.2rem; font-size: 12px; color: var(--muted); }
.app-dialog-actions {
    display: flex; justify-content: flex-end; gap: 0.5rem; margin-top: 1rem;
}
.app-dialog-card .form-control { width: 100%; box-sizing: border-box; }
.toast {
    position: fixed; bottom: 2rem; left: 50%; transform: translateX(-50%);
    background: #1A1D21; color: #fff; padding: 0.55rem 1rem;
    border-radius: 8px; z-index: 200; font-size: 13px;
}

.busy-overlay {
    position: fixed;
    inset: 0;
    z-index: 300;
    background: rgba(15, 23, 42, 0.45);
    display: grid;
    place-items: center;
}
.busy-card {
    background: #fff;
    border: 1px solid var(--chrome-border);
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
    min-width: min(360px, 86vw);
    text-align: center;
    box-shadow: 0 12px 32px rgba(0,0,0,0.18);
}
.busy-spinner {
    width: 36px;
    height: 36px;
    margin: 0 auto 0.75rem;
    border: 3px solid #DBEAFE;
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: busy-spin 0.8s linear infinite;
}
@keyframes busy-spin { to { transform: rotate(360deg); } }
.busy-text { font-weight: 600; font-size: 14px; }
.busy-hint { margin-top: 0.45rem; color: var(--muted); font-size: 12px; }

#blazor-error-ui {
    background: #FEF3C7; bottom: 0; box-shadow: 0 -1px 2px rgba(0,0,0,0.15);
    display: none; left: 0; padding: 0.6rem 1.25rem; position: fixed; width: 100%; z-index: 1000;
}
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: 0.75rem; top: 0.5rem; }

/* ========== å¯å¨å¼å±ï¼ç§ææï¼Blazor å°±ç»ªåé #app å
å®¹è¢«æ¿æ¢ï¼ ========== */
.boot-splash {
    --boot-ink: #070B14;
    --boot-panel: #0E1626;
    --boot-cyan: #67E8F9;
    --boot-blue: #3B82F6;
    --boot-muted: #8BA0B8;
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: grid;
    place-items: center;
    overflow: hidden;
    background: var(--boot-ink);
    color: #E8EEF7;
    font-family: "Bahnschrift", "Segoe UI Variable Display", "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

.boot-bg {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.boot-grid {
    position: absolute;
    inset: -20%;
    background-image:
        linear-gradient(rgba(103, 232, 249, 0.06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(103, 232, 249, 0.06) 1px, transparent 1px);
    background-size: 48px 48px;
    transform: perspective(600px) rotateX(58deg) translateY(-8%);
    transform-origin: center top;
    animation: boot-grid-drift 18s linear infinite;
    mask-image: radial-gradient(ellipse 70% 55% at 50% 35%, #000 20%, transparent 75%);
}

.boot-beam {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 55% 40% at 50% 28%, rgba(59, 130, 246, 0.28), transparent 70%),
        radial-gradient(ellipse 40% 30% at 70% 70%, rgba(103, 232, 249, 0.12), transparent 65%);
}

.boot-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(40px);
    opacity: 0.55;
    animation: boot-orb-breathe 5.5s ease-in-out infinite;
}
.boot-orb-a {
    width: 280px; height: 280px;
    left: 12%; top: 18%;
    background: rgba(59, 130, 246, 0.35);
}
.boot-orb-b {
    width: 220px; height: 220px;
    right: 10%; bottom: 16%;
    background: rgba(103, 232, 249, 0.22);
    animation-delay: -2.2s;
}

.boot-scan {
    position: absolute;
    left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(103, 232, 249, 0.55), transparent);
    box-shadow: 0 0 18px rgba(103, 232, 249, 0.45);
    animation: boot-scan 3.6s ease-in-out infinite;
}

.boot-stage {
    position: relative;
    z-index: 1;
    width: min(92vw, 420px);
    padding: 2rem 1.5rem 1.75rem;
    text-align: center;
    border-radius: 20px;
    background: linear-gradient(165deg, rgba(18, 28, 48, 0.82), rgba(10, 16, 28, 0.72));
    border: 1px solid rgba(103, 232, 249, 0.22);
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.03) inset,
        0 24px 60px rgba(0, 0, 0, 0.45),
        0 0 40px rgba(59, 130, 246, 0.12);
    backdrop-filter: blur(10px);
    animation: boot-stage-in 0.7s ease-out both;
}

.boot-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.85rem;
    margin-bottom: 1.4rem;
}

.boot-mark {
    width: 64px;
    height: 64px;
    display: grid;
    place-items: center;
    border-radius: 16px;
    background: rgba(103, 232, 249, 0.06);
    box-shadow: 0 0 28px rgba(103, 232, 249, 0.2);
    animation: boot-mark-pulse 2.8s ease-in-out infinite;
}

.boot-kicker {
    margin: 0;
    font-size: 11px;
    letter-spacing: 0.28em;
    color: var(--boot-cyan);
    opacity: 0.85;
}

.boot-name {
    margin: 0.2rem 0 0;
    font-size: clamp(1.45rem, 4vw, 1.85rem);
    font-weight: 600;
    letter-spacing: 0.02em;
    background: linear-gradient(105deg, #F0F9FF 10%, #67E8F9 55%, #93C5FD 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.boot-sub {
    margin: 0.35rem 0 0;
    font-size: 13px;
    color: var(--boot-muted);
    letter-spacing: 0.04em;
}

.boot-meter {
    position: relative;
    width: 7.5rem;
    height: 7.5rem;
    margin: 0.4rem auto 0.9rem;
}

.boot-ring-halo {
    position: absolute;
    inset: -8px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(103, 232, 249, 0.18), transparent 68%);
    animation: boot-orb-breathe 2.4s ease-in-out infinite;
}

.loading-progress {
    position: relative;
    display: block;
    width: 100%;
    height: 100%;
}

.loading-progress circle {
    fill: none;
    stroke-width: 0.55rem;
    transform-origin: 50% 50%;
    transform: rotate(-90deg);
}

.loading-progress circle.boot-track,
.loading-progress circle:first-child {
    stroke: rgba(148, 163, 184, 0.22);
}

.loading-progress circle.boot-value,
.loading-progress circle:last-child {
    stroke: #67E8F9;
    filter: drop-shadow(0 0 6px rgba(103, 232, 249, 0.75));
    /* ä¸ Blazor å®æ¹æ¨¡æ¿ä¸è´ï¼ç¨ --blazor-load-percentage é©±å¨ç¯é¿ */
    stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
    transition: stroke-dasharray 0.05s ease-in-out;
}

.loading-progress-text {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    font-size: 1.15rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    color: #E0F2FE;
    text-shadow: 0 0 12px rgba(103, 232, 249, 0.45);
}

.loading-progress-text:after {
    content: var(--blazor-load-percentage-text, "â¦");
}

.boot-caption {
    margin: 0;
    font-size: 12px;
    color: var(--boot-muted);
}

.boot-ticks {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 1rem;
}

.boot-ticks span {
    width: 18px;
    height: 2px;
    border-radius: 1px;
    background: rgba(103, 232, 249, 0.25);
    animation: boot-tick 1.4s ease-in-out infinite;
}
.boot-ticks span:nth-child(2) { animation-delay: 0.12s; }
.boot-ticks span:nth-child(3) { animation-delay: 0.24s; }
.boot-ticks span:nth-child(4) { animation-delay: 0.36s; }
.boot-ticks span:nth-child(5) { animation-delay: 0.48s; }

@keyframes boot-grid-drift {
    from { background-position: 0 0, 0 0; }
    to { background-position: 0 48px, 48px 0; }
}
@keyframes boot-orb-breathe {
    0%, 100% { opacity: 0.4; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(1.08); }
}
@keyframes boot-scan {
    0% { top: 8%; opacity: 0; }
    15% { opacity: 1; }
    85% { opacity: 1; }
    100% { top: 88%; opacity: 0; }
}
@keyframes boot-stage-in {
    from { opacity: 0; transform: translateY(16px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes boot-mark-pulse {
    0%, 100% { box-shadow: 0 0 18px rgba(103, 232, 249, 0.15); }
    50% { box-shadow: 0 0 36px rgba(103, 232, 249, 0.4); }
}
@keyframes boot-tick {
    0%, 100% { background: rgba(103, 232, 249, 0.2); transform: scaleX(1); }
    50% { background: rgba(103, 232, 249, 0.9); transform: scaleX(1.15); }
}

@media (prefers-reduced-motion: reduce) {
    .boot-grid, .boot-orb, .boot-scan, .boot-mark, .boot-ticks span, .boot-ring-halo {
        animation: none !important;
    }
}

.admin-shell {
    display: grid; grid-template-columns: 200px 1fr; min-height: 100vh; background: var(--chrome);
}
.admin-nav { background: #1A1D21; color: #E5E7EB; padding: 1rem 0.75rem; }
.admin-brand { font-weight: 600; margin-bottom: 1rem; padding: 0 0.5rem; }
.admin-nav a {
    display: block; color: #E5E7EB; text-decoration: none;
    padding: 0.45rem 0.5rem; border-radius: 4px; margin-bottom: 0.25rem;
}
.admin-nav a:hover { background: rgba(255,255,255,0.08); color: #fff; }
.admin-main { padding: 1.25rem 1.5rem; overflow: auto; }
.admin-page h1 { font-size: 1.4rem; margin: 0 0 0.75rem; }
.admin-page h2 { font-size: 1.05rem; margin: 0 0 0.5rem; }
.admin-cards {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem; margin-top: 1rem;
}
.admin-card {
    display: block; background: #fff; border: 1px solid var(--chrome-border);
    border-radius: 8px; padding: 1rem; text-decoration: none; color: inherit;
}
.admin-card:hover { border-color: var(--accent); }
.admin-form {
    background: #fff; border: 1px solid var(--chrome-border);
    border-radius: 8px; padding: 0.75rem 1rem; margin-bottom: 1rem;
}
.admin-form-row { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.admin-form-row .form-control { width: auto; min-width: 140px; margin-bottom: 0; }
.admin-table {
    width: 100%; border-collapse: collapse; background: #fff;
    border: 1px solid var(--chrome-border); font-size: 0.9rem;
}
.admin-table th, .admin-table td {
    border-bottom: 1px solid var(--chrome-border);
    padding: 0.45rem 0.55rem; text-align: left; vertical-align: middle;
}
.admin-table th { background: #F4F5F7; font-weight: 600; }
.admin-actions { white-space: nowrap; }
.admin-detail { max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-pager { display: flex; gap: 0.5rem; margin-top: 0.75rem; }
.admin-split {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(300px, 0.85fr);
    gap: 1rem;
    align-items: start;
}
@media (max-width: 1100px) {
    .admin-split { grid-template-columns: 1fr; }
}
.admin-split-col { min-width: 0; }
.admin-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem 0.75rem;
    margin-bottom: 0.5rem;
}
.admin-form-grid label {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    font-size: 0.85rem;
    color: #4B5563;
}
.admin-form-grid .form-control { width: 100%; min-width: 0; }
.admin-row-on td { background: #EEF4FF; }
.skill-check-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}
.skill-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    border: 1px solid var(--chrome-border);
    border-radius: 999px;
    padding: 0.2rem 0.65rem;
    font-size: 0.82rem;
    background: #F8F9FB;
}
.skill-chip.on {
    border-color: var(--accent);
    background: #EEF4FF;
}
.skill-list {
    list-style: none;
    margin: 0 0 0.75rem;
    padding: 0;
    max-height: 42vh;
    overflow: auto;
}
.skill-list li {
    border: 1px solid var(--chrome-border);
    border-radius: 6px;
    padding: 0.5rem 0.65rem;
    margin-bottom: 0.45rem;
    background: #F8F9FB;
}
.skill-list li strong { margin-right: 0.4rem; }
.skill-list li p { margin: 0.25rem 0 0.4rem; font-size: 0.82rem; }
.coin-in { color: #15803D; font-weight: 600; }
.coin-out { color: #B91C1C; font-weight: 600; }

/* —— 管理端数据看板 —— */
.dash-page { max-width: 1360px; }
.dash-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.75rem;
}
.dash-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.75rem;
    margin: 0.75rem 0 0.85rem;
}
.dash-kpi {
    background: #fff;
    border: 1px solid var(--chrome-border);
    border-radius: 12px;
    padding: 0.85rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    min-width: 0;
}
.dash-kpi.accent { border-color: #BFDBFE; background: linear-gradient(180deg, #EFF6FF, #fff); }
.dash-kpi-label { font-size: 12px; color: var(--muted); }
.dash-kpi strong { font-size: 1.4rem; color: #0F172A; line-height: 1.2; word-break: break-all; }
.dash-insight-row {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.75rem;
    margin-bottom: 0.85rem;
}
.dash-insight {
    background: #fff;
    border: 1px dashed var(--chrome-border);
    border-radius: 10px;
    padding: 0.65rem 0.85rem;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 0;
}
.dash-insight-label { font-size: 11.5px; color: var(--muted); }
.dash-insight strong { font-size: 1.15rem; color: #1E293B; }
.dash-charts {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.85rem;
}
.dash-panel {
    background: #fff;
    border: 1px solid var(--chrome-border);
    border-radius: 12px;
    padding: 0.85rem 1rem 1rem;
    min-height: 0;
    overflow: hidden; /* 禁止面板内滚动条 */
}
.dash-panel-wide { grid-column: span 3; }
.dash-panel h2 { margin: 0 0 0.65rem; font-size: 0.95rem; }
.dash-panel-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.35rem;
}
.dash-panel-head h2 { margin: 0; }
.dash-svg-chart {
    width: 100%;
    overflow: hidden;
}
.dash-svg-chart svg {
    display: block;
    width: 100%;
    height: 150px;
}
.dash-svg-axis { stroke: #E2E8F0; stroke-width: 1; }
.dash-svg-labels {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 1fr;
    gap: 0;
    margin-top: 2px;
    overflow: hidden;
}
.dash-svg-labels span {
    font-size: 10px;
    color: var(--muted);
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: clip;
}
.dash-hbar-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    overflow: hidden;
}
.dash-hbar-meta {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    font-size: 12px;
    min-width: 0;
}
.dash-hbar-meta span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}
.dash-hbar-track { height: 8px; background: #F1F5F9; border-radius: 999px; overflow: hidden; }
.dash-hbar-fill { height: 100%; border-radius: 999px; max-width: 100%; }
.dash-empty { margin: 0.5rem 0 0; font-size: 12px; }
.dash-mini-note { margin: 0.5rem 0 0; font-size: 11.5px; }
.dash-donut {
    width: 132px;
    height: 132px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    margin: 0.35rem auto 0.5rem;
}
.dash-donut-hole {
    width: 82px;
    height: 82px;
    border-radius: 50%;
    background: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.dash-donut-hole strong { font-size: 1.25rem; }
.dash-donut-hole span { font-size: 11px; color: var(--muted); }
.dash-donut-legend {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.55rem 0.85rem;
    font-size: 12px;
}
.dash-donut-legend i {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 2px;
    margin-right: 4px;
    vertical-align: middle;
}
.dash-table-panel { margin-top: 0.85rem; overflow: hidden; }
.dash-table { margin: 0; }
.dash-table-bar-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}
.dash-table-bar {
    height: 6px;
    background: #2563EB;
    border-radius: 999px;
    max-width: 140px;
    flex: 1;
}
.dash-links-title { margin: 1.25rem 0 0.35rem; }

@media (max-width: 1100px) {
    .dash-kpi-grid,
    .dash-insight-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .dash-charts { grid-template-columns: 1fr 1fr; }
    .dash-panel-wide { grid-column: span 2; }
}
@media (max-width: 720px) {
    .dash-kpi-grid,
    .dash-insight-row,
    .dash-charts { grid-template-columns: 1fr; }
    .dash-panel-wide { grid-column: span 1; }
}

.prop-kind { font-weight: 600; margin: 0 0 0.5rem; }
.prop-apply { width: 100%; margin-top: 0.75rem; }
.prop-color { width: 36px; height: 28px; padding: 0; border: 1px solid var(--chrome-border); border-radius: 4px; cursor: pointer; }
.prop-swatches { display: flex; flex-wrap: wrap; gap: 4px; margin: 0.25rem 0 0.5rem; }
.prop-swatch { width: 18px; height: 18px; border-radius: 4px; border: 1px solid var(--chrome-border); padding: 0; cursor: pointer; }
.prop-check { display: flex; align-items: center; gap: 6px; font-size: 12px; margin: 0.35rem 0; }
.prop-body label { display: block; color: var(--muted); font-size: 11px; margin: 0.35rem 0 0.15rem; }
.ctx-menu {
    position: fixed; z-index: 40; min-width: 140px; background: #fff;
    border: 1px solid var(--chrome-border); border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12); padding: 4px;
}
.ctx-menu button {
    display: block; width: 100%; text-align: left; border: none; background: transparent;
    padding: 0.45rem 0.65rem; border-radius: 6px; font-size: 13px; cursor: pointer;
    color: #1A1D21; /* 强制深色，避免继承/禁用态导致看不清 */
    font-weight: 500;
}
.ctx-menu button:hover:not(:disabled) { background: var(--accent-soft); color: var(--accent); }
.ctx-menu button:disabled {
    color: #64748B;
    opacity: 1; /* 不用低透明度，否则白底上几乎看不见 */
    cursor: default;
}
.ctx-backdrop { position: fixed; inset: 0; z-index: 39; }
.ai-plan {
    font-size: 12px; color: var(--muted); padding: 4px 10px;
    border-bottom: 1px solid var(--chrome-border);
}
.ai-ref-hint {
    font-size: 12px; color: var(--muted); padding: 4px 10px;
    border-bottom: 1px solid var(--chrome-border);
}

/* 右上角新手引导。压在菜单栏之上，但仍低于登录框，避免挡住登录。 */
.guide-btn {
    flex-shrink: 0;
    margin-left: 0.55rem;
    height: 24px;
    padding: 0 10px;
    border-radius: 999px;
    border: 1px solid var(--accent);
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 12px;
    line-height: 22px;
    cursor: pointer;
}
.guide-btn:hover { background: var(--checked-hover); }
.tour-root { position: fixed; inset: 0; z-index: 350; pointer-events: none; }
.tour-root:focus { outline: none; }
.tour-dim {
    position: fixed;
    background: rgba(15, 23, 42, 0.52);
    pointer-events: auto;
}
.tour-ring {
    position: fixed;
    border-radius: 8px;
    outline: 2px solid #fff;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.55);
    pointer-events: none;
    animation: tour-pulse 1.15s ease-in-out infinite;
}
@keyframes tour-pulse {
    0%, 100% { box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.45); }
    50% { box-shadow: 0 0 0 7px rgba(37, 99, 235, 0.15); }
}
.tour-card {
    position: fixed;
    z-index: 2;
    pointer-events: auto;
    width: 320px;
    max-width: calc(100vw - 24px);
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--chrome-border);
    border-radius: 8px;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.18);
    padding: 14px 16px 12px;
}
.tour-card-ok { outline: 2px solid var(--ok); }
.tour-task {
    margin: 0 0 12px;
    padding: 6px 8px;
    border-radius: 6px;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 13px;
    font-weight: 600;
}
.tour-kicker { font-size: 12px; color: var(--accent); margin-bottom: 4px; }
.tour-card h2 { margin: 0 0 6px; font-size: 16px; font-weight: 600; }
.tour-card p { margin: 0 0 12px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.tour-actions { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.tour-actions-right { display: flex; gap: 8px; }
.tour-actions .btn { min-height: 32px; padding: 4px 12px; font-size: 13px; }
