:root {
    --aqr-bg: #edf2f7;
    --aqr-panel: #ffffff;
    --aqr-panel-soft: #f7fafc;
    --aqr-ink: #101828;
    --aqr-text: #283548;
    --aqr-muted: #667085;
    --aqr-line: #d8e0ea;
    --aqr-line-strong: #b8c4d3;
    --aqr-sidebar: #12161f;
    --aqr-sidebar-soft: #1b2330;
    --aqr-teal: #0f766e;
    --aqr-cyan: #0891b2;
    --aqr-amber: #c97916;
    --aqr-rose: #be123c;
    --aqr-indigo: #4f46e5;
    --aqr-shadow-sm: 0 10px 22px rgba(16, 24, 40, 0.08);
    --aqr-shadow-md: 0 20px 48px rgba(16, 24, 40, 0.14);
    --aqr-radius: 8px;
}

* {
    box-sizing: border-box;
}

html {
    min-width: 320px;
    background: var(--aqr-sidebar);
}

body.aqr-admin {
    min-width: 320px;
    margin: 0;
    color: var(--aqr-text);
    letter-spacing: 0;
    font-family: Inter, Arial, "Microsoft YaHei", sans-serif;
    background:
        linear-gradient(90deg, rgba(15, 118, 110, 0.05) 1px, transparent 1px),
        linear-gradient(0deg, rgba(8, 145, 178, 0.045) 1px, transparent 1px),
        linear-gradient(135deg, #f8fafc 0%, #eef4f8 42%, #f7f3eb 100%);
    background-size: 36px 36px, 36px 36px, auto;
    overflow-x: hidden;
}

button,
input,
select {
    font: inherit;
}

.hidden {
    display: none !important;
}

/* 登录态和后台态分开渲染，避免刷新时先露出登录页或侧栏边缘。 */
body.auth-checking #loginView,
body.auth-checking #appView {
    display: none !important;
}

body.auth-checking .aqr-sidebar,
body.auth-checking .aqr-topbar {
    display: none !important;
}

body.auth-checking .aqr-shell {
    display: block;
    background: #12161f;
}

body.auth-checking .aqr-main {
    min-height: 100vh;
    background: #12161f;
}

body.auth-login {
    background:
        radial-gradient(circle at 16% 18%, rgba(20, 184, 166, 0.18), transparent 28%),
        radial-gradient(circle at 84% 76%, rgba(190, 18, 60, 0.14), transparent 30%),
        #12161f;
}

body.auth-login .aqr-shell {
    display: block;
    min-height: 100vh;
    background: #12161f;
}

body.auth-login .aqr-sidebar,
body.auth-login .aqr-topbar {
    display: none;
}

body.auth-login .aqr-main {
    min-height: 100vh;
    background: transparent;
}

body.auth-login .page-body {
    min-height: 100vh;
    display: grid;
    align-items: center;
    padding: 32px 0;
}

body.auth-login .aqr-container {
    max-width: none;
    padding: 0 24px;
}

body.auth-login .auth-view {
    min-height: calc(100vh - 64px);
}

/* Tabler 的 page/navbar 骨架仍然由 JSP 提供，这里叠加 AQR 后台自己的运行台视觉。 */
.aqr-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 296px minmax(0, 1fr);
    width: 100%;
    background: var(--aqr-sidebar);
    overflow-x: clip;
}

.aqr-sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    height: 100dvh;
    width: auto;
    padding: 0;
    color: #e7edf5;
    border: 0;
    border-right: 1px solid #26303d;
    background:
        linear-gradient(180deg, rgba(18, 22, 31, 0.98), rgba(25, 32, 43, 0.98)),
        repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0 1px, transparent 1px 16px);
    box-shadow: none;
    z-index: 5;
    overflow: hidden;
}

.aqr-sidebar::before {
    content: none;
}

.aqr-sidebar-inner {
    position: relative;
    /* 约束内部高度，让菜单收缩并滚动，底部账号区始终可见。 */
    height: 100%;
    min-height: 0;
    display: flex;
    flex-direction: column;
    padding: 0;
}

.aqr-brand {
    flex-shrink: 0;
    min-height: 92px;
    width: 100%;
    display: grid;
    grid-template-columns: 54px minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 0 18px 0 20px;
    margin: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.09);
    overflow: visible;
}

.brand-copy {
    min-width: 0;
}

.brand-title {
    display: block;
    color: #ffffff;
    font-size: 18px;
    line-height: 1.1;
    font-weight: 800;
}

.brand-subtitle {
    display: block;
    margin-top: 5px;
    color: #aab7c6;
    font-size: 12px;
    font-weight: 500;
}

.brand-chip,
.runtime-pill {
    height: 28px;
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 0 10px;
    color: #99f6e4;
    background: rgba(20, 184, 166, 0.12);
    border: 1px solid rgba(45, 212, 191, 0.28);
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
}

/* 太极改为 SVG 矢量图，避免 CSS 渐变拼接在旋转时产生锯齿和边缘抖动。 */
.taiji-logo {
    position: relative;
    width: 48px;
    height: 48px;
    display: inline-block;
    flex: 0 0 auto;
    border-radius: 50%;
    overflow: visible;
    background: transparent;
    filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.26));
}

.taiji-logo.large {
    width: 58px;
    height: 58px;
}

.taiji-svg {
    width: 100%;
    height: 100%;
    display: block;
    border-radius: 50%;
    animation: taijiSpin 5.6s linear infinite;
    transform-origin: 50% 50%;
    will-change: transform;
    backface-visibility: hidden;
}

.taiji-base {
    fill: #ffffff;
}

.taiji-dark {
    fill: #0b1220;
}

.taiji-dot.dark {
    fill: #0b1220;
}

.taiji-dot.light {
    fill: #ffffff;
}

.taiji-stroke {
    fill: none;
    stroke: rgba(153, 246, 228, 0.9);
    stroke-width: 2.8;
}

.aqr-nav-label {
    flex-shrink: 0;
    margin: 22px 20px 10px;
    color: #7dd3fc;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.aqr-nav {
    /* 只滚动菜单，网格行保持原高，不挤压分组和按钮。 */
    flex: 1;
    min-height: 0;
    display: grid;
    align-content: start;
    grid-auto-rows: max-content;
    gap: 8px;
    padding: 0 14px;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior-y: contain;
    scrollbar-width: thin;
    scrollbar-color: #667085 transparent;
}

.nav-section {
    display: grid;
    gap: 4px;
}

.nav-section-head {
    width: 100%;
    min-height: 40px;
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr) 20px;
    align-items: center;
    gap: 10px;
    margin: 0;
    padding: 0 10px;
    color: #94a3b8;
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid rgba(148, 163, 184, 0.12);
    border-radius: var(--aqr-radius);
    text-align: left;
    cursor: pointer;
    transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.nav-section-head:hover,
.nav-section.active .nav-section-head {
    color: #e7edf5;
    background: rgba(20, 184, 166, 0.09);
    border-color: rgba(45, 212, 191, 0.22);
}

.nav-section-icon,
.nav-section-arrow {
    display: grid;
    place-items: center;
    color: inherit;
}

.nav-section-icon {
    font-size: 18px;
}

.nav-section-title {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 13px;
    font-weight: 800;
}

.nav-section-arrow {
    font-size: 16px;
    transition: transform 0.18s ease;
}

.nav-section.collapsed .nav-section-arrow {
    transform: rotate(-90deg);
}

.nav-section-body {
    display: grid;
    gap: 5px;
    margin-left: 14px;
    padding: 5px 0 5px 10px;
    border-left: 1px solid rgba(125, 211, 252, 0.18);
}

.nav-section.collapsed .nav-section-body {
    display: none;
}

.aqr-nav .nav-item {
    position: relative;
    width: 100%;
    min-height: 42px;
    display: grid;
    grid-template-columns: 30px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    margin: 0;
    padding: 0 10px;
    color: #cbd5e1;
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--aqr-radius);
    text-align: left;
    cursor: pointer;
    overflow: hidden;
    transition: transform 0.18s ease, background 0.18s ease, color 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

/* 外层高频入口使用独立承载，避免被误认为折叠分组的子项。 */
.aqr-nav > .nav-item-top {
    min-height: 44px;
    background: rgba(255, 255, 255, 0.025);
    border-color: rgba(148, 163, 184, 0.12);
}

/* 导航 hover 时增加一道轻扫光效，让后台切换更有“框架感”，不影响原有 data-tab 绑定。 */
.aqr-nav .nav-item::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(110deg, transparent, rgba(255, 255, 255, 0.16), transparent);
    transform: translateX(-110%);
    transition: transform 0.42s ease;
}

.aqr-nav .nav-item:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.06);
    transform: translateX(3px);
}

.aqr-nav .nav-item:hover::before {
    transform: translateX(110%);
}

.aqr-nav .nav-item.active {
    color: #101828;
    background: linear-gradient(135deg, #ffffff, #e7f8f5);
    border-color: rgba(255, 255, 255, 0.44);
    box-shadow: 0 16px 30px rgba(0, 0, 0, 0.24);
    transform: translateX(5px);
}

.nav-link-icon {
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    border-radius: var(--aqr-radius);
    color: inherit;
    background: rgba(255, 255, 255, 0.09);
    font-size: 17px;
}

.nav-item.active .nav-link-icon {
    background: rgba(15, 118, 110, 0.12);
    color: var(--aqr-teal);
}

.nav-link-title {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 700;
}

.sidebar-foot {
    flex-shrink: 0;
    margin-top: auto;
    padding: 18px;
}

.button.sidebar-button {
    width: 100%;
    min-height: 40px;
    margin-top: 12px;
    justify-content: center;
    gap: 7px;
    color: #dce8f4;
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.12);
    font-size: inherit;
    font-weight: 800;
    box-shadow: none;
}

.button.sidebar-button i {
    font-size: 15px;
}

.button.sidebar-button:hover:not(:disabled) {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.18);
}

.admin-card {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    padding: 12px;
    border-radius: var(--aqr-radius);
    color: #ffffff;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.admin-avatar {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: #042f2e;
    background: #5eead4;
    font-weight: 900;
}

.admin-info {
    min-width: 0;
    color: #d7e2ef;
    font-size: 13px;
    line-height: 1.5;
    word-break: break-word;
}

.aqr-main {
    min-width: 0;
    width: 100%;
    background: var(--aqr-bg);
    overflow-x: hidden;
}

.aqr-container {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0 40px;
}

.aqr-topbar {
    position: sticky;
    top: 0;
    z-index: 4;
    margin: 0;
    padding: 22px 0 14px;
    color: var(--aqr-ink);
    backdrop-filter: blur(16px);
    background: rgba(237, 242, 247, 0.78);
    border-bottom: 1px solid rgba(184, 196, 211, 0.52);
}

.topbar-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.topbar-title {
    min-width: 0;
    flex: 1 1 auto;
}

.breadcrumb {
    margin-bottom: 8px;
    color: var(--aqr-teal);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.page-title {
    margin: 0;
    color: var(--aqr-ink);
    font-size: 30px;
    line-height: 1.15;
    font-weight: 900;
}

.page-pretitle {
    margin: 8px 0 0;
    color: var(--aqr-muted);
    font-size: 14px;
}

.topbar-actions {
    position: relative;
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 12px;
}

.runtime-pill {
    color: #0f5132;
    background: #ecfdf3;
    border-color: #abefc6;
}

.runtime-pill span {
    width: 7px;
    height: 7px;
    margin-right: 7px;
    border-radius: 50%;
    background: #12b76a;
    box-shadow: 0 0 0 rgba(18, 183, 106, 0.45);
    animation: livePulse 1.8s ease-out infinite;
}

.page-body {
    padding: 24px 0 44px;
}

.workspace,
.auth-view {
    animation: fadeLift 0.32s ease both;
}

.auth-view {
    min-height: calc(100vh - 170px);
    display: grid;
    place-items: center;
}

.auth-frame {
    width: min(980px, 100%);
    display: grid;
    grid-template-columns: minmax(280px, 0.95fr) minmax(320px, 1fr);
    overflow: hidden;
    border-radius: var(--aqr-radius);
    border: 1px solid rgba(216, 224, 234, 0.9);
    box-shadow: var(--aqr-shadow-md);
    background: var(--aqr-panel);
}

.auth-visual {
    position: relative;
    min-height: 440px;
    overflow: hidden;
    background: #11272d;
}

/* 近景图填满人物区，完整保留发髻与拂尘；不再叠加网格和项目展示。 */
.login-companion {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    contain: layout paint;
}

.sage-portrait,
.sage-privacy,
.sage-backplate,
.sage-canvas {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.sage-privacy,
.sage-backplate,
.sage-canvas {
    opacity: 0;
}

/* 渲染或资源不可用时保留完整原图和密码焦点反馈。 */
.sage-privacy {
    transition: opacity 220ms ease;
}

.auth-visual.cover-eyes .sage-privacy,
.login-companion.is-ready .sage-canvas {
    opacity: 1;
}

.login-companion.is-ready .sage-portrait,
.login-companion.is-ready .sage-privacy {
    opacity: 0;
}

@media (prefers-reduced-motion: reduce) {
    .sage-privacy {
        transition: none;
    }
}

.auth-panel {
    padding: 42px;
}

.auth-copy h2 {
    margin: 0 0 8px;
    color: var(--aqr-ink);
    font-size: 28px;
    font-weight: 900;
}

.auth-copy p {
    min-height: 22px;
    margin: 0 0 28px;
    color: var(--aqr-muted);
}

.auth-panel label,
.modal-panel label {
    display: block;
    margin: 16px 0 7px;
    color: var(--aqr-ink);
    font-size: 13px;
    font-weight: 800;
}

.form-control,
.form-select,
input,
select {
    min-height: 40px;
    width: 100%;
    border-radius: var(--aqr-radius);
    border: 1px solid var(--aqr-line);
    background: #ffffff;
    color: var(--aqr-text);
    outline: none;
    transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

input,
select {
    padding: 0 12px;
}

.clearable-input-shell {
    position: relative;
    display: block;
    width: 100%;
    min-width: 0;
}

.clearable-input-shell > input {
    width: 100%;
    padding-right: 40px;
}

.clearable-input-button {
    position: absolute;
    top: 50%;
    right: 8px;
    width: 26px;
    height: 26px;
    min-height: 26px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    border-radius: 7px;
    color: #667085;
    background: transparent;
    opacity: 0;
    pointer-events: none;
    cursor: pointer;
    transform: translateY(-50%);
    transition: opacity 0.14s ease, background 0.14s ease, color 0.14s ease;
}

.clearable-input-button i {
    font-size: 16px;
    line-height: 1;
}

.clearable-input-shell.show-clear .clearable-input-button {
    opacity: 1;
    pointer-events: auto;
}

.clearable-input-button:hover {
    color: #0f766e;
    background: rgba(15, 118, 110, 0.1);
}

select {
    appearance: none;
    padding-right: 34px;
    background-image:
        linear-gradient(45deg, transparent 50%, #667085 50%),
        linear-gradient(135deg, #667085 50%, transparent 50%);
    background-position:
        calc(100% - 17px) 17px,
        calc(100% - 12px) 17px;
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
}

select option {
    border-radius: var(--aqr-radius);
}

select[multiple] {
    height: auto;
    padding: 8px 10px;
    background-image: none;
}

select[multiple] option {
    padding: 6px 8px;
}

.native-select-hidden {
    position: absolute !important;
    width: 1px !important;
    min-height: 1px !important;
    height: 1px !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

.select-shell {
    position: relative;
    width: 100%;
}

.select-trigger {
    appearance: none;
    position: relative;
    min-height: 40px;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    padding: 0 42px 0 12px;
    color: var(--aqr-text);
    background: #ffffff;
    border: 1px solid var(--aqr-line);
    border-radius: var(--aqr-radius);
    text-align: left;
    cursor: pointer;
}

.select-trigger::after {
    content: "";
    position: absolute;
    right: 16px;
    top: 50%;
    width: 8px;
    height: 8px;
    border-right: 2px solid #667085;
    border-bottom: 2px solid #667085;
    pointer-events: none;
    transform: translateY(-62%) rotate(45deg);
}

.select-trigger:focus {
    border-color: rgba(15, 118, 110, 0.68);
    box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.13);
    outline: 0;
}

.multi-select-shell .select-trigger {
    height: 40px;
    display: flex;
    align-items: center;
    overflow: hidden;
    padding-right: 42px;
    color: var(--aqr-text);
    background: #ffffff !important;
    border-color: rgba(15, 118, 110, 0.46);
    box-shadow: inset 0 0 0 1px rgba(15, 118, 110, 0.04);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.multi-select-shell .select-trigger::after {
    border-color: #0f766e;
}

.multi-select-shell .select-trigger:hover {
    border-color: #0f766e;
    box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.1);
}

.select-trigger.placeholder,
.multi-select-shell .select-trigger.placeholder {
    color: #475467;
}

#modalBody .select-shell.multi-select-shell .select-trigger,
#modalBody .select-shell.multi-select-shell .select-trigger.placeholder {
    min-height: 40px !important;
    height: 40px !important;
    color: #101828 !important;
    background-color: #ffffff !important;
    background-image: none !important;
    border: 1px solid rgba(15, 118, 110, 0.46) !important;
    opacity: 1 !important;
}

#modalBody .select-shell.multi-select-shell .select-trigger:hover,
#modalBody .select-shell.multi-select-shell .select-trigger:focus {
    border-color: #0f766e !important;
    box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.1) !important;
}

#modalBody .select-shell.multi-select-shell .select-trigger.placeholder {
    color: #98a2b3 !important;
}

.select-menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    z-index: 1000;
    max-height: 220px;
    overflow: auto;
    padding: 6px;
    background: #ffffff;
    border: 1px solid var(--aqr-line);
    border-radius: var(--aqr-radius);
    box-shadow: var(--aqr-shadow-md);
}

.select-menu.select-menu-floating {
    position: fixed;
    right: auto;
    z-index: 1100;
}

.select-option {
    min-height: 36px;
    width: 100%;
    display: flex;
    align-items: center;
    padding: 0 10px;
    color: var(--aqr-text);
    background: transparent;
    border: 0;
    border-radius: 6px;
    text-align: left;
    cursor: pointer;
}

.select-option:hover,
.select-option.active {
    color: #0f766e;
    background: #ecfdf5;
}

.select-option:disabled {
    color: #98a2b3;
    background: #f8fafc;
    cursor: not-allowed;
}

.select-option:disabled:hover {
    color: #98a2b3;
    background: #f8fafc;
}

.multi-select-option {
    gap: 9px;
}

.select-check {
    position: relative;
    width: 16px;
    min-width: 16px;
    height: 16px;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    background: #ffffff;
}

.multi-select-option.active .select-check {
    background: #0f766e;
    border-color: #0f766e;
}

.multi-select-option.active .select-check::after {
    content: "";
    position: absolute;
    left: 4px;
    top: 1px;
    width: 5px;
    height: 9px;
    border: solid #ffffff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.select-option-label {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.form-control:focus,
.form-select:focus,
input:focus,
select:focus {
    border-color: rgba(15, 118, 110, 0.68);
    box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.13);
}

.checkline {
    display: inline-flex !important;
    align-items: center;
    justify-content: flex-start;
    gap: 6px;
    width: auto;
    max-width: 100%;
    height: 18px;
    min-height: 18px;
    margin-top: 14px !important;
    color: var(--aqr-muted) !important;
    font-weight: 700 !important;
    line-height: 18px;
    vertical-align: middle;
}

.checkline + .checkline {
    margin-left: 18px;
}

.checkline input[type="checkbox"] {
    position: absolute;
    width: 1px !important;
    max-width: 1px !important;
    height: 1px;
    min-height: 1px;
    margin: 0;
    padding: 0;
    opacity: 0;
    pointer-events: none;
}

.check-visual {
    width: 16px;
    height: 16px;
    flex: 0 0 16px;
    position: relative;
    display: inline-block;
    box-sizing: border-box;
    border: 1px solid #cbd5e1;
    border-radius: 3px;
    background: #ffffff;
    box-shadow: none;
}

.check-visual::after {
    content: "";
    position: absolute;
    left: 3px;
    top: 3px;
    width: 8px;
    height: 5px;
    border-left: 2px solid #ffffff;
    border-bottom: 2px solid #ffffff;
    transform: rotate(-45deg);
    opacity: 0;
}

.checkline input[type="checkbox"]:checked + .check-visual {
    border-color: #dc2626;
    background: #dc2626;
}

.checkline input[type="checkbox"]:checked + .check-visual::after {
    opacity: 1;
}

.check-text {
    display: inline-flex;
    align-items: center;
    height: 18px;
    min-height: 18px;
    line-height: 1;
    font-size: 13px;
    box-sizing: border-box;
    padding-top: 1px;
    transform: none;
}

.auth-actions,
.modal-actions,
.actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.auth-actions {
    margin-top: 24px;
}

.button {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    border: 1px solid var(--aqr-line);
    border-radius: var(--aqr-radius);
    padding: 0 15px;
    color: var(--aqr-text);
    background: #ffffff;
    font-weight: 800;
    line-height: 1;
    cursor: pointer;
    white-space: nowrap;
    transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease, background 0.16s ease, color 0.16s ease;
}

.button:hover:not(:disabled) {
    transform: translateY(-1px);
    border-color: var(--aqr-line-strong);
    box-shadow: var(--aqr-shadow-sm);
}

.button:disabled {
    opacity: 0.58;
    cursor: not-allowed;
}

.button.loading,
.link-button.loading {
    opacity: 0.82;
    cursor: wait;
    pointer-events: none;
}

.button-spinner {
    width: 14px;
    height: 14px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: buttonSpin 0.72s linear infinite;
}

@keyframes buttonSpin {
    to {
        transform: rotate(360deg);
    }
}

.button.primary {
    color: #ffffff;
    border-color: #0f766e;
    background: linear-gradient(135deg, #0f766e, #0891b2);
    box-shadow: 0 14px 26px rgba(15, 118, 110, 0.24);
}

.button.warn {
    color: #7a3b00;
    background: #fff7ed;
    border-color: #fed7aa;
}

.button.danger {
    color: #9f1239;
    background: #fff1f2;
    border-color: #fecdd3;
}

.button.ghost {
    width: 100%;
    margin-top: 12px;
    color: #dce8f4;
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.12);
}

.button.small {
    min-height: 32px;
    padding: 0 10px;
    font-size: 12px;
}

.form-msg,
.notice {
    min-height: 20px;
    color: var(--aqr-muted);
    font-size: 13px;
}

.form-msg {
    margin-top: 16px;
}

.form-msg.error,
.notice.error {
    color: var(--aqr-rose);
}

.notice {
    position: fixed;
    top: 22px;
    left: 50%;
    z-index: 9999;
    width: max-content;
    max-width: min(520px, calc(100vw - 32px));
    padding: 9px 12px;
    border-radius: var(--aqr-radius);
    background: #ffffff;
    border: 1px solid var(--aqr-line);
    box-shadow: var(--aqr-shadow-sm);
    animation: noticeIn 0.22s ease both;
    transform: translateX(-50%);
}

.notice.error {
    background: #fff1f2;
    border-color: #fecdd3;
}

.toolbar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 16px;
    padding: 14px;
    border-radius: var(--aqr-radius);
    border: 1px solid rgba(216, 224, 234, 0.92);
    box-shadow: var(--aqr-shadow-sm);
}

.toolbar input,
.toolbar select,
.toolbar .clearable-input-shell,
.toolbar .select-shell {
    width: 260px;
    max-width: 280px;
    flex: 0 0 auto;
}

.toolbar.search-toolbar {
    align-items: center;
    justify-content: flex-start;
    flex-wrap: wrap;
}

.toolbar.search-toolbar > input,
.toolbar.search-toolbar > .clearable-input-shell {
    min-height: 40px !important;
    height: 40px !important;
    width: auto;
    max-width: none;
    flex: 1 1 0;
}

.toolbar.search-toolbar > select,
.toolbar.search-toolbar > .select-shell {
    min-height: 40px !important;
    height: 40px !important;
    width: 260px;
    max-width: 260px;
    flex: 0 0 260px;
}

.toolbar.search-toolbar .button {
    min-height: 40px;
    height: 40px;
    flex: 0 0 auto;
}

.toolbar > .button:first-of-type {
    /* 顶部工具栏按钮统一靠右，保留左侧筛选或分段控件的自然位置。 */
    margin-left: auto;
}

.toolbar.announcement-filter-toolbar .announcement-filter {
    width: min(260px, 100%);
    max-width: none;
    flex: 0 1 260px;
    margin-right: auto;
}

@media (max-width: 600px) {
    .toolbar.announcement-filter-toolbar .announcement-filter {
        width: 100%;
        flex-basis: 100%;
    }
}

.toolbar.compact {
    margin: 0 0 14px;
    padding: 0;
    border: 0;
    box-shadow: none;
    background: transparent;
}

.toolbar.compact input {
    max-width: 220px;
}

.toolbar.currency-toolbar {
    display: grid !important;
    grid-template-columns: max-content 1fr max-content;
    align-items: center !important;
    align-content: center;
    gap: 10px;
    min-height: 68px;
    padding: 12px 16px;
}



.toolbar.finance-toolbar {
    /* 财务页按归集页同款分段标签布局，财务记录标签下才展示筛选项。 */
    display: grid !important;
    grid-template-columns: max-content minmax(240px, 1fr) minmax(160px, 220px) minmax(160px, 220px) max-content;
    align-items: center !important;
    align-content: center;
    gap: 10px;
    min-height: 68px;
    padding: 12px 16px;
}

.finance-toolbar .finance-record-filter,
.finance-toolbar .clearable-input-shell,
.finance-toolbar .select-shell {
    min-height: 40px !important;
    height: 40px !important;
    width: 100%;
    max-width: none;
}

.finance-toolbar #refreshFinanceBtn {
    width: auto;
    margin-left: 0;
    grid-column: 5;
    justify-self: end;
    align-self: center;
}

.toolbar.withdrawal-toolbar {
    display: grid !important;
    grid-template-columns: max-content 1fr max-content;
    align-items: center !important;
    align-content: center;
    gap: 10px;
    min-height: 68px;
    padding: 12px 16px;
}

.withdrawal-toolbar .withdrawal-status-filter {
    grid-column: 2;
    width: min(220px, 100%);
    min-width: 0;
}

.withdrawal-toolbar .withdrawal-status-filter .select-shell,
.withdrawal-toolbar .withdrawal-status-filter select {
    width: 100%;
    max-width: none;
}

.withdrawal-toolbar .button {
    width: auto;
    margin-left: 0;
    grid-column: 3;
    justify-self: end;
    align-self: center;
}

.withdrawal-tab-count {
    display: inline;
    margin-left: 4px;
    color: inherit;
    font: inherit;
}

.withdrawal-task-detail { display: block; margin-top: 4px; }
.withdrawal-task-detail.is-attention { color: var(--admin-bad-text, var(--art-danger)); }
.withdrawal-task-txid { display: block; max-width: 210px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.currency-toolbar .button {
    width: auto;
    margin-left: 0;
    grid-column: 3;
    justify-self: end;
    align-self: center;
}





.segmented {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    grid-column: 1;
    gap: 4px;
    padding: 4px;
    border-radius: var(--aqr-radius);
    border: 1px solid var(--aqr-line);
    background: #f8fafc;
}

.segmented-btn {
    min-height: 30px;
    padding: 0 14px;
    color: var(--aqr-muted);
    background: transparent;
    border: 0;
    border-radius: 6px;
    font-weight: 800;
    cursor: pointer;
}

.segmented-btn.active {
    color: #0f766e;
    background: #ffffff;
    box-shadow: var(--aqr-shadow-sm);
}

.price-cell {
    text-align: right;
    white-space: nowrap;
}

.price-display {
    display: inline-flex;
    align-items: baseline;
    justify-content: flex-end;
    gap: 1px;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.price-symbol {
    margin-right: 2px;
    color: currentColor;
    font-size: 0.78em;
    font-weight: 800;
    opacity: 0.82;
}

.price-int {
    font-size: 1em;
    font-weight: 900;
}

.price-decimal {
    font-size: 0.72em;
    font-weight: 800;
    opacity: 0.78;
}

.compact-check {
    width: auto !important;
    max-width: max-content;
    gap: 6px;
    min-height: 40px;
    display: inline-flex !important;
    justify-content: flex-start;
    align-items: center;
    flex: 0 0 auto;
    margin: 0 !important;
    white-space: nowrap;
}

.compact-check input,
.modal-check input {
    width: 16px !important;
    max-width: 16px !important;
    flex: 0 0 16px !important;
}

.table-card,
.detail-card,
.card {
    border-radius: var(--aqr-radius);
    border: 1px solid rgba(216, 224, 234, 0.95);
    background: rgba(255, 255, 255, 0.94);
    box-shadow: var(--aqr-shadow-sm);
}

.table-card {
    overflow: auto;
}

.table-card.menu-open {
    overflow: visible;
}

.section-title {
    margin: 22px 0 10px;
    color: #1f2a44;
    font-size: 15px;
    font-weight: 700;
}

table {
    width: 100%;
    min-width: 760px;
    border-collapse: collapse;
}

#currencyTable.currency-chain-table {
    table-layout: fixed;
}

#currencyTable.currency-chain-table th,
#currencyTable.currency-chain-table td {
    vertical-align: middle;
}

#currencyTable.currency-chain-table th:nth-child(1),
#currencyTable.currency-chain-table td:nth-child(1) {
    width: 24%;
}

#currencyTable.currency-chain-table th:nth-child(2),
#currencyTable.currency-chain-table td:nth-child(2) {
    width: 28%;
    text-align: center;
}

#currencyTable.currency-chain-table th:nth-child(3),
#currencyTable.currency-chain-table td:nth-child(3) {
    width: 30%;
    text-align: center;
}

#currencyTable.currency-chain-table th:nth-child(4),
#currencyTable.currency-chain-table td:nth-child(4) {
    width: 18%;
    text-align: right;
}

#currencyTable.currency-chain-table td:nth-child(4) .status {
    margin-right: 0;
}

th {
    padding: 14px;
    color: #475467;
    background: #f8fafc;
    border-bottom: 1px solid var(--aqr-line);
    font-size: 12px;
    text-align: left;
    white-space: nowrap;
}

td {
    padding: 14px;
    vertical-align: top;
    border-bottom: 1px solid #edf2f7;
    color: var(--aqr-text);
}

tbody tr {
    transition: background 0.15s ease, transform 0.15s ease;
}

tbody tr:hover {
    background: #f7fbfb;
}

.table-card :is(#announcementsTable, #appReleasesTable, #rnArtifactsTable, #versionChannelsTable) :is(th, td):last-child:not([colspan]),
#withdrawTable .withdraw-actions-cell {
    position: sticky;
    right: 0;
    z-index: 2;
    background: #fff;
    box-shadow: -1px 0 var(--aqr-line);
}

.table-card :is(#announcementsTable, #appReleasesTable, #rnArtifactsTable, #versionChannelsTable) th:last-child,
#withdrawTable th.withdraw-actions-cell {
    z-index: 3;
    background: #f8fafc;
}

.table-card :is(#announcementsTable, #appReleasesTable, #rnArtifactsTable, #versionChannelsTable) tbody tr:hover td:last-child:not([colspan]),
#withdrawTable tbody tr:hover .withdraw-actions-cell {
    background: #f7fbfb;
}

#announcementsTable .announcement-edit-row { cursor: pointer; }
#announcementsTable .announcement-edit-row:focus-visible { outline: 2px solid var(--theme-color); outline-offset: -2px; }

.cell-muted {
    margin-top: 4px;
    color: var(--aqr-muted);
    font-size: 12px;
    line-height: 1.6;
}

#usersTable {
    min-width: 930px;
    table-layout: fixed;
}

#usersTable .user-col-main,
#usersTable .user-col-relation,
#usersTable .user-col-assets,
#usersTable .user-col-team {
    width: calc((100% - 160px) / 4);
}

#usersTable .user-col-status {
    width: 112px;
}

#usersTable .user-col-actions {
    width: 48px;
}

/* 用户管理与收益等原生列表共用单元格留白和垂直对齐。 */
#usersTable th,
#usersTable td,
.admin-native-table th,
.admin-native-table td {
    padding: 14px 12px;
    vertical-align: middle;
}

#usersTable tbody tr {
    background: rgba(255, 255, 255, 0.78);
}

#usersTable tbody tr:hover {
    background: #f7fbfb;
}

#usersTable .table-actions-head,
#usersTable .table-actions-cell,
#usersTable thead th:last-child {
    position: sticky;
    right: 0;
    z-index: 2;
    background: rgba(255, 255, 255, 0.96);
    text-align: right;
}

#usersTable .table-status-head,
#usersTable .table-status-cell {
    text-align: right;
    white-space: normal;
}

#usersTable .table-actions-head,
#usersTable thead th:last-child {
    z-index: 3;
    background: #f8fafc;
    padding-right: 7px;
    padding-left: 7px;
}

#usersTable .table-actions-cell {
    padding-right: 7px;
    padding-left: 7px;
}

#usersTable .table-status-cell {
    padding-right: 10px;
    padding-left: 10px;
}

/* 其他原生列表的状态标签与用户管理保持同一文字节奏。 */
#usersTable .user-status-list .status,
.admin-native-table .status {
    display: inline-block;
    max-width: 100%;
    box-sizing: border-box;
    line-height: 1.4;
    text-align: center;
    white-space: normal;
    overflow-wrap: anywhere;
}

#usersTable thead th:is(:nth-child(2), :nth-child(3), :nth-child(4), .table-status-head, .table-actions-head),
#usersTable tbody td:is(:nth-child(2), :nth-child(3), :nth-child(4), .table-status-cell, .table-actions-cell) {
    text-align: center;
}

#usersTable .relation-meta,
#usersTable .user-balance-list,
#usersTable .asset-line,
#usersTable .investment-line {
    justify-content: center;
}

#usersTable .user-status-list {
    align-items: center;
}

#usersTable tbody tr:hover .table-actions-cell {
    background: #f7fbfb;
}

.user-primary > b {
    display: block;
    margin-bottom: 8px;
    color: #101828;
    font-size: 14px;
    line-height: 1.25;
}

.user-info-list,
.user-primary {
    display: grid;
    gap: 4px;
}

.user-meta {
    display: flex;
    align-items: center;
    gap: 4px;
    min-height: 22px;
    color: var(--aqr-muted);
    font-size: 12px;
    line-height: 1.35;
}

.user-meta span {
    color: #667085;
    white-space: nowrap;
}

.user-meta strong {
    min-width: 0;
    color: #344054;
    font-size: 12px;
    font-weight: 800;
    word-break: break-all;
}

.relation-meta {
    display: flex;
    align-items: center;
    gap: 4px;
    min-height: 22px;
    color: var(--aqr-muted);
    font-size: 12px;
    line-height: 1.35;
}

.relation-meta span {
    color: #667085;
    white-space: nowrap;
}

.relation-meta strong {
    min-width: 0;
    color: #344054;
    font-size: 12px;
    font-weight: 800;
    word-break: break-all;
}

.user-balance-list {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    min-height: 34px;
}

.user-status-list {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 7px;
}

.user-status-list .status,
.user-balance-list .status {
    margin: 0;
}

.asset-summary {
    display: grid;
    gap: 6px;
    min-width: 0;
    color: #344054;
    font-size: 12px;
    line-height: 1.35;
}

.asset-line {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 4px;
}

.asset-line > span {
    color: var(--aqr-muted);
    white-space: nowrap;
}

.asset-line strong,
.asset-line b {
    color: #344054;
    font-size: 13px;
    font-weight: 800;
}

.asset-split {
    column-gap: 10px;
    row-gap: 4px;
}

.investment-summary {
    display: grid;
    gap: 6px;
    min-width: 0;
    color: #344054;
    font-size: 12px;
    line-height: 1.35;
}

.investment-line {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 4px;
}

.investment-line > span {
    color: var(--aqr-muted);
    white-space: nowrap;
}

.investment-line b,
.investment-ratio {
    color: #344054;
    font-weight: 800;
}

.investment-ratio {
    display: inline-block;
    font-size: 13px;
    word-break: break-word;
}

.investment-counts {
    column-gap: 10px;
    row-gap: 4px;
}

.investment-ratio span {
    display: inline-block;
    margin: 0 1px;
    color: var(--aqr-muted);
    font-weight: 700;
}

.user-detail-view {
    display: grid;
    gap: 14px;
    max-height: min(72vh, 720px);
    overflow: auto;
    padding-right: 4px;
}

.user-detail-section {
    padding: 14px;
    border: 1px solid rgba(216, 224, 234, 0.95);
    border-radius: var(--aqr-radius);
    background: #f8fbfc;
}

.user-detail-section h4 {
    margin: 0 0 12px;
    color: var(--aqr-ink);
    font-size: 14px;
    line-height: 1.2;
    font-weight: 900;
}

.user-detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 12px;
}

.user-detail-item {
    min-width: 0;
    display: grid;
    gap: 4px;
}

.user-detail-item span {
    color: var(--aqr-muted);
    font-size: 12px;
    font-weight: 700;
}

.user-detail-item strong {
    min-width: 0;
    color: #344054;
    font-size: 13px;
    line-height: 1.45;
    font-weight: 800;
    word-break: break-word;
}

.user-detail-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.user-detail-badges span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 30px;
    padding: 0 10px;
    border-radius: var(--aqr-radius);
    color: #344054;
    background: #ffffff;
    border: 1px solid rgba(216, 224, 234, 0.95);
    font-size: 12px;
    font-weight: 800;
}

.user-detail-table {
    overflow: auto;
}

.user-detail-table table {
    min-width: 640px;
}

.detail-empty {
    color: var(--aqr-muted);
    font-size: 13px;
    font-weight: 700;
}

.user-actions {
    justify-content: flex-end;
    flex-wrap: nowrap;
    gap: 8px;
}

.user-actions .button.small {
    min-height: 32px;
    padding: 0 12px;
    border-radius: 8px;
    font-size: 12px;
}

.user-menu-wrap {
    position: relative;
    display: inline-flex;
    justify-content: flex-end;
}

.user-menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    min-width: 34px;
    height: 34px;
    padding: 0;
    border: 1px solid rgba(216, 224, 234, 0.95);
    border-radius: 8px;
    color: #475467;
    background: #ffffff;
    box-shadow: 0 6px 16px rgba(16, 24, 40, 0.06);
    cursor: pointer;
    transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease, box-shadow 0.16s ease;
}

.user-menu-toggle:hover,
.user-menu-toggle:focus-visible,
.user-menu-toggle.active {
    color: var(--aqr-teal);
    border-color: rgba(15, 118, 110, 0.28);
    background: #f0fdfa;
    box-shadow: 0 8px 20px rgba(15, 118, 110, 0.12);
    outline: none;
}

.user-menu-toggle i {
    font-size: 18px;
    line-height: 1;
}

.user-menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    z-index: 40;
    display: grid;
    min-width: 148px;
    padding: 6px;
    border: 1px solid var(--aqr-line);
    border-radius: var(--aqr-radius);
    background: #ffffff;
    box-shadow: var(--aqr-shadow);
}

.user-menu.user-menu-floating {
    position: fixed;
    top: 0;
    right: auto;
    left: 0;
    z-index: 10000;
    max-height: min(360px, calc(100vh - 16px));
    overflow: auto;
}

.user-menu.hidden {
    display: none;
}

.user-menu button {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    min-height: 34px;
    padding: 0 10px;
    border: 0;
    border-radius: 7px;
    color: #344054;
    background: transparent;
    font: inherit;
    font-size: 12px;
    font-weight: 800;
    text-align: left;
    cursor: pointer;
}

.user-menu button:hover {
    background: #f2f4f7;
}

.user-menu button.primary {
    color: var(--aqr-primary);
}

.metric-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}

.dashboard-brief {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    align-items: center;
    gap: 0;
    min-height: 58px;
    padding: 12px 16px;
    border-radius: var(--aqr-radius);
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(216, 224, 234, 0.95);
    box-shadow: var(--aqr-shadow-sm);
}

.dashboard-brief-6 {
    grid-template-columns: repeat(6, minmax(0, 1fr));
}

.dashboard-brief div {
    display: inline-flex;
    justify-content: center;
    align-items: baseline;
    gap: 10px;
    min-width: 0;
    padding: 0 14px;
    border-right: 1px solid var(--aqr-line);
}

.dashboard-brief div:last-child {
    border-right: 0;
}

.dashboard-brief span {
    color: var(--aqr-muted);
    font-size: 12px;
    font-weight: 800;
}

.dashboard-brief b {
    color: var(--aqr-ink);
    font-size: 18px;
    font-weight: 900;
}

.chart-grid {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.chart-card {
    min-height: 336px;
    padding: 16px;
    border-radius: var(--aqr-radius);
    background:
        linear-gradient(rgba(15, 118, 110, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(15, 118, 110, 0.035) 1px, transparent 1px),
        rgba(255, 255, 255, 0.94);
    background-size: 36px 36px, 36px 36px, auto;
    border: 1px solid rgba(216, 224, 234, 0.95);
    box-shadow: var(--aqr-shadow-sm);
}

.chart-card div:first-child {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
}

.chart-card b {
    color: var(--aqr-ink);
    font-size: 14px;
}

.chart-card span {
    color: var(--aqr-muted);
    font-size: 12px;
}

.analytics-metrics,
.analytics-chart-grid {
    margin-top: 16px;
}

/* 数据分析读数减轻字重并保持整笔金额同一行；极长金额可横向查看完整数值。 */
.analytics-metrics .metric span {
    font-weight: 500;
}

.analytics-metrics .metric strong {
    max-width: 100%;
    font-size: clamp(24px, 2.2vw, 30px);
    font-weight: 600;
    line-height: 1.2;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    word-break: normal;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: thin;
}

.analytics-table-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-top: 16px;
}

.analytics-table-grid > div {
    min-width: 0;
}

.analytics-table-grid > .table-card {
    padding: 16px 18px 14px;
}

.analytics-table-grid > div:last-child {
    grid-column: 1 / -1;
}

.analytics-table-grid .section-title {
    margin: 0 0 12px;
}

.analytics-table-grid table {
    min-width: 520px;
}

.sparkline {
    width: 100%;
    height: 236px;
}

.spark-area {
    fill: rgba(15, 118, 110, 0.055);
    transform-origin: 50% 100%;
    animation: sparkAreaIn 0.7s ease both;
}

.sparkline.flat .spark-area {
    opacity: 0;
}

.spark-line {
    fill: none;
    stroke: var(--aqr-teal);
    stroke-width: 1.65;
    stroke-linecap: round;
    stroke-linejoin: round;
    vector-effect: non-scaling-stroke;
    animation: sparkLineIn 0.28s ease both;
}

.spark-dot {
    fill: #ffffff;
    stroke: var(--aqr-teal);
    stroke-width: 1.4;
    vector-effect: non-scaling-stroke;
    opacity: 0;
    animation: sparkDotIn 0.28s ease forwards;
    animation-delay: 0.62s;
}

.sparkline.flat .spark-line {
    stroke: rgba(15, 118, 110, 0.82);
    stroke-width: 1.35;
}

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

@keyframes sparkAreaIn {
    from {
        opacity: 0;
        transform: scaleY(0.92);
    }
    to {
        opacity: 1;
        transform: scaleY(1);
    }
}

@keyframes sparkDotIn {
    from {
        opacity: 0;
        transform: scale(0.7);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* 控制台统计卡片保持 JS 原来的 metric/tone 渲染方式，只在样式层做动效和分色。 */
.metric {
    position: relative;
    min-height: 154px;
    padding: 18px;
    overflow: hidden;
    border-radius: var(--aqr-radius);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.28);
    box-shadow: var(--aqr-shadow-md);
    transform: translateY(0);
    animation: fadeLift 0.34s ease both;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.metric:hover {
    transform: translateY(-4px);
    box-shadow: 0 28px 60px rgba(16, 24, 40, 0.2);
}

.metric::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(255, 255, 255, 0.12) 1px, transparent 1px),
        linear-gradient(0deg, rgba(255, 255, 255, 0.12) 1px, transparent 1px);
    background-size: 28px 28px;
    opacity: 0.34;
}

.metric::after {
    content: "";
    position: absolute;
    left: 18px;
    right: 18px;
    bottom: 15px;
    height: 3px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.34);
    transform-origin: left;
    transform: scaleX(0.78);
    opacity: 0.64;
}

.metric.just-refreshed::after {
    animation: metricRefresh 0.9s ease-out 1;
}

.metric.tone-0 {
    background: linear-gradient(135deg, #0f766e, #0891b2);
}

.metric.tone-1 {
    background: linear-gradient(135deg, #334155, #4f46e5);
}

.metric.tone-2 {
    background: linear-gradient(135deg, #a16207, #be123c);
}

.metric.tone-3 {
    background: linear-gradient(135deg, #14532d, #0f766e);
}

.metric span,
.metric strong,
.metric em {
    position: relative;
    z-index: 1;
}

.metric span {
    display: block;
    color: rgba(255, 255, 255, 0.82);
    font-size: 13px;
    font-weight: 800;
}

.metric strong {
    display: block;
    margin-top: 14px;
    color: #ffffff;
    font-size: 30px;
    line-height: 1.1;
    font-weight: 900;
    word-break: break-word;
}

.metric em {
    display: block;
    margin-top: 12px;
    color: rgba(255, 255, 255, 0.72);
    font-size: 12px;
    font-style: normal;
    line-height: 1.4;
}

.detail-card {
    margin-top: 18px;
    padding: 18px;
}

.detail-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.detail-head h3,
.modal-panel h3 {
    margin: 0;
    color: var(--aqr-ink);
    font-size: 18px;
    font-weight: 900;
}

pre,
.result-box {
    min-height: 120px;
    max-height: 360px;
    overflow: auto;
    margin: 0;
    padding: 14px;
    border-radius: var(--aqr-radius);
    color: #d6e4ff;
    background: #101828;
    border: 1px solid #22304a;
    font-size: 12px;
    line-height: 1.6;
}

/* 配置页把当前值和操作按钮放进同一个编辑组，减少表格横向扫视成本。 */
.config-group-row td {
    padding: 24px 12px 12px !important;
    text-align: left !important;
    background: transparent !important;
    border-bottom: 0 !important;
}

.config-group-row:first-child td {
    padding-top: 16px !important;
}

.config-group-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 0 2px;
    padding: 12px 14px;
    border: 1px solid rgba(15, 118, 110, 0.16);
    border-radius: var(--aqr-radius);
    background: linear-gradient(135deg, rgba(15, 118, 110, 0.08), rgba(8, 145, 178, 0.06));
}

.config-group-title strong {
    display: block;
    color: var(--aqr-ink);
    font-size: 14px;
    line-height: 1.2;
    font-weight: 900;
}

.config-group-title span {
    display: block;
    margin-top: 4px;
    color: var(--aqr-muted);
    font-size: 12px;
    line-height: 1.35;
    font-weight: 700;
}

.config-group-title em {
    flex: 0 0 auto;
    min-width: 46px;
    padding: 5px 9px;
    border-radius: 999px;
    color: #0f766e;
    background: #ecfeff;
    border: 1px solid #99f6e4;
    font-size: 12px;
    line-height: 1;
    font-style: normal;
    font-weight: 900;
    text-align: center;
}

.config-editor {
    display: inline-grid;
    grid-template-columns: minmax(168px, 260px);
    align-items: center;
    gap: 10px;
    width: min(100%, 360px);
    justify-content: end;
}

.config-secret-editor {
    grid-template-columns: minmax(168px, 260px);
    width: min(100%, 360px);
}

.secret-input-wrap {
    position: relative;
    min-width: 0;
}

.secret-input-wrap input {
    padding-right: 44px;
}

.secret-eye {
    position: absolute;
    top: 50%;
    right: 8px;
    width: 30px;
    height: 30px;
    min-height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    border-radius: 8px;
    color: var(--aqr-muted);
    background: transparent;
    cursor: pointer;
    transform: translateY(-50%);
}

.secret-eye:hover {
    color: var(--aqr-teal);
    background: rgba(15, 118, 110, 0.08);
}

.config-editor input,
.config-editor select {
    min-width: 0;
}

#configTable th:last-child,
#configTable td:last-child,
#incomeConfigTable th:last-child,
#incomeConfigTable td:last-child {
    text-align: right;
}

.switch-control {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    min-height: 40px;
    width: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
    user-select: none;
}

.switch-control:focus,
.switch-control:focus-visible {
    outline: none;
    box-shadow: none;
}

.switch-control:disabled {
    cursor: not-allowed;
    opacity: 0.68;
}

.switch-control span {
    position: relative;
    width: 48px;
    height: 26px;
    flex: 0 0 auto;
    border-radius: 999px;
    background: #cbd5e1;
    box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.08);
    transition: background 0.16s ease, box-shadow 0.16s ease;
}

.switch-control span::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 3px 10px rgba(15, 23, 42, 0.25);
    transition: transform 0.16s ease;
}

.switch-control.is-on span {
    background: var(--aqr-teal);
    box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.13);
}

.switch-control.is-on span::after {
    transform: translateX(22px);
}

.readonly-input,
input:disabled {
    color: #98a2b3;
    background: #f2f4f7;
    cursor: not-allowed;
}

/* 每日收益结果改为读得懂的结果面板，后端字段只在 JS 里映射一次。 */
.income-result {
    display: grid;
    gap: 14px;
    min-height: 136px;
    padding: 16px;
    border-radius: var(--aqr-radius);
    margin: 0;
    color: #d8e3ef;
    white-space: normal;
    background: linear-gradient(180deg, #111827 0%, #0f172a 100%);
    border: 1px solid rgba(148, 163, 184, 0.18);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03), 0 14px 30px rgba(15, 23, 42, 0.12);
}

.income-result.empty,
.income-result.loading {
    place-items: center;
    color: #9fb0c5;
    background: linear-gradient(180deg, #111827 0%, #0f172a 100%);
}

.income-result.success {
    border-color: rgba(20, 184, 166, 0.42);
    background: linear-gradient(180deg, #10252c 0%, #0f172a 100%);
}

.income-result.error {
    border-color: rgba(248, 113, 113, 0.54);
    background: linear-gradient(180deg, #241724 0%, #0f172a 100%);
}

.income-result p {
    margin: 0;
    color: #d8e3ef;
    font-size: 13px;
    line-height: 1.8;
}

.income-placeholder {
    color: #9fb0c5;
    font-size: 13px;
}

.income-status {
    justify-self: start;
    min-height: 28px;
    display: inline-flex;
    align-items: center;
    padding: 0 10px;
    border-radius: 999px;
    color: #99f6e4;
    background: rgba(20, 184, 166, 0.16);
    border: 1px solid rgba(45, 212, 191, 0.34);
    font-size: 12px;
    font-weight: 900;
}

.income-status.bad {
    color: #fecdd3;
    background: rgba(244, 63, 94, 0.16);
    border-color: rgba(251, 113, 133, 0.42);
}

.income-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.income-item {
    min-height: 72px;
    padding: 12px;
    border-radius: var(--aqr-radius);
    background: rgba(15, 23, 42, 0.52);
    border: 1px solid rgba(148, 163, 184, 0.16);
}

.income-item span {
    display: block;
    color: #8ea2ba;
    font-size: 12px;
    font-weight: 800;
}

.income-item strong {
    display: block;
    margin-top: 7px;
    color: #f8fafc;
    font-size: 18px;
    line-height: 1.2;
    word-break: break-word;
}

.fund-panel-view {
    display: grid;
    gap: 16px;
}

.fund-summary-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    border-radius: var(--aqr-radius);
    background: linear-gradient(135deg, rgba(15, 118, 110, 0.09), rgba(8, 145, 178, 0.08));
    border: 1px solid rgba(15, 118, 110, 0.16);
}

.fund-summary-head span,
.fund-summary-head em {
    color: var(--aqr-muted);
    font-size: 12px;
    font-style: normal;
    font-weight: 800;
}

.fund-summary-head strong {
    display: block;
    margin-top: 4px;
    color: var(--aqr-ink);
    font-size: 18px;
}

.fund-balance-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.fund-balance-card,
.fund-empty {
    min-height: 82px;
    padding: 14px;
    border-radius: var(--aqr-radius);
    background: #ffffff;
    border: 1px solid var(--aqr-line);
}

.fund-balance-card span {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 0 8px;
    border-radius: 999px;
    color: #0f766e;
    background: #ecfeff;
    border: 1px solid #a5f3fc;
    font-size: 12px;
    font-weight: 900;
}

.fund-balance-card strong {
    display: block;
    margin-top: 12px;
    color: var(--aqr-ink);
    font-size: 20px;
    line-height: 1.2;
    word-break: break-all;
}

.fund-empty {
    display: grid;
    place-items: center;
    color: var(--aqr-muted);
    font-size: 13px;
    font-weight: 800;
}

.fund-record-table {
    overflow: auto;
    border: 1px solid var(--aqr-line);
    border-radius: var(--aqr-radius);
    background: #ffffff;
}

.fund-record-table table {
    min-width: 980px;
}

.fund-record-table th,
.fund-record-table td {
    padding: 13px 14px;
    vertical-align: middle;
}

.fund-amount {
    color: #344054;
    font-weight: 900;
    white-space: nowrap;
}

#financeTable .finance-record-amount,
#financeTable .finance-record-balance {
    display: block;
    white-space: nowrap;
}

#financeTable .finance-record-balance {
    color: var(--aqr-muted);
    font-size: 12px;
    line-height: 18px;
}

.fund-amount.plus {
    color: #067647;
}

.fund-amount.minus {
    color: #b42318;
}

.status {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    margin: 2px 4px 2px 0;
    padding: 0 9px;
    border-radius: 999px;
    color: #344054;
    background: #f2f4f7;
    border: 1px solid #eaecf0;
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
}

.status.ok {
    color: #047857;
    background: #d1fae5;
    border-color: #34d399;
}

.status.bad {
    color: #ffffff;
    background: #e11d48;
    border-color: #be123c;
    box-shadow: 0 4px 10px rgba(225, 29, 72, 0.16);
}

.status.wait {
    color: #9a3412;
    background: #fff7ed;
    border-color: #fed7aa;
}

.grid-form {
    display: grid;
    grid-template-columns: repeat(4, minmax(140px, 1fr));
    align-items: center;
}

.compact-check {
    margin: 0 !important;
}

.coin-icon,
.coin-symbol {
    width: 28px;
    height: 28px;
    display: inline-grid;
    place-items: center;
    margin-right: 8px;
    border-radius: 50%;
    vertical-align: middle;
}

.coin-icon {
    object-fit: cover;
}

.coin-symbol {
    color: #042f2e;
    background: #ccfbf1;
    font-size: 12px;
    font-weight: 900;
    overflow: hidden;
    text-transform: uppercase;
}

.coin-icon-uploader {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.coin-icon-preview {
    width: 38px;
    min-width: 38px;
    height: 38px;
    flex: 0 0 38px;
    display: grid;
    place-items: center;
    color: #0f766e;
    background: #f0fdfa;
    border: 1px solid rgba(15, 118, 110, 0.28);
    border-radius: 50%;
    overflow: hidden;
}

.coin-icon-preview.empty {
    color: #667085;
    background: #f8fafc;
    border-color: var(--aqr-line);
}

.coin-icon-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.coin-icon-uploader .button {
    flex: 0 0 auto;
    width: auto !important;
    max-width: max-content !important;
    min-width: auto;
    margin: 0;
    white-space: nowrap;
}

.coin-icon-uploader .button i {
    font-size: 16px;
}

.modal-icon-clear {
    width: 40px;
    min-width: 40px;
    padding: 0;
}

.coin-icon-path {
    flex: 1 1 auto;
    width: auto;
    min-width: 0;
    min-height: 32px;
    display: block;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 0 10px;
    color: #344054;
    background: #ffffff;
    border: 1px solid var(--aqr-line);
    border-radius: var(--aqr-radius);
    font-size: 12px;
    font-weight: 700;
    line-height: 30px;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    user-select: text;
}

.coin-icon-path.empty {
    color: var(--aqr-muted);
    background: #f8fafc;
}

#modalBody .coin-icon-uploader {
    width: 100%;
    flex-wrap: nowrap;
}

#modalBody .coin-icon-preview {
    width: 38px !important;
    min-width: 38px !important;
    height: 38px !important;
    flex: 0 0 38px !important;
}

#modalBody .coin-icon-path {
    flex: 1 1 auto;
    width: auto;
    min-width: 0;
    max-width: none;
}

.click-row {
    cursor: pointer;
}

.click-row:hover td {
    background: #f8fafc;
}

.chain-chip {
    margin: 2px 4px 2px 0;
    cursor: default;
    font: inherit;
}

.chain-chip.bad {
    color: #9f1239;
    background: #fff1f2;
    border-color: #fda4af;
}

.chain-chip:hover {
    filter: none;
}

.modal-check {
    margin-top: 10px !important;
}

.coin-editor-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: center;
    gap: 16px;
    margin: 16px 0 10px;
}

.coin-editor-row[data-field-pair="chain-sort"] {
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
}

.coin-editor-field {
    display: grid;
    grid-template-columns: max-content minmax(0, 1fr);
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.modal-panel .coin-editor-field label {
    margin: 0;
    align-self: center;
}

.coin-editor-field .select-shell { min-width: 0; }

@media (max-width: 480px) {
    .coin-editor-field { grid-template-columns: minmax(0, 1fr); gap: 6px; }
}

.coin-chain-configs {
    display: grid;
    gap: 10px;
    margin-top: 10px;
}

/* Only the form body scrolls when a network editor field receives focus. */
.modal-panel.modal-panel-chain-network { overflow: clip; min-width: 0; max-width: 100%; }
.modal-panel-chain-network .modal-header { flex: 0 0 auto; }
html:has(#modal:not(.hidden) > .modal-panel-chain-network) { overflow: hidden; }

.chain-network-tabs {
    width: fit-content;
    max-width: 100%;
    flex-wrap: wrap;
    background: var(--el-fill-color-light);
    border-color: var(--el-border-color-lighter);
}

.chain-network-tabs .segmented-btn {
    white-space: normal;
    overflow-wrap: anywhere;
    font-weight: 500;
}

.chain-network-tabs .segmented-btn.active {
    color: var(--el-color-primary);
    background: var(--el-bg-color);
}

.coin-chain-memo-fields,
.coin-chain-asset-fields { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(92px, 0.32fr) minmax(0, 1fr); align-items: center; gap: 8px 10px; min-width: 0; }
.coin-chain-memo-fields.hidden,
.coin-chain-asset-fields.hidden { display: none; }
.coin-chain-options { grid-column: 1 / -1; display: flex; align-items: center; flex-wrap: wrap; gap: 12px 18px; }
.modal-panel .coin-chain-options .modal-check { margin: 4px 0 !important; }
/* 链参数是横向表单，不能继承普通弹窗标签的上下外边距。 */
.modal-panel .coin-chain-config label { margin: 0; align-self: center; }
.coin-chain-config > .modal-check { grid-column: 1 / -1; margin: 4px 0 !important; }
.chain-editor-options { display: flex; align-items: center; flex-wrap: wrap; gap: 12px 18px; margin-top: 16px; }
.chain-chip.catalog-disabled { color: var(--art-gray-500); background: var(--art-gray-100); }
.modal-panel .chain-editor-options .modal-check { margin: 0 !important; }
/* 链编辑保持成对纵向字段，网络输入框占满标签右侧余量。 */
.chain-editor-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: center; gap: 12px; margin-bottom: 16px; }
.chain-editor-field { display: grid; gap: 7px; min-width: 0; }
.modal-panel .chain-editor-field label { margin: 0; }
.chain-editor-field .select-shell { min-width: 0; }
.chain-editor-network-row { display: grid; grid-template-columns: max-content minmax(0, 1fr); align-items: center; gap: 12px; min-width: 0; }
.chain-editor-network-row:empty { display: none; }
.chain-editor-network-row .chain-network-tabs { flex-wrap: nowrap; }
.chain-editor-network-row .segmented-btn { white-space: nowrap; }
/* 最窄手机优先压缩网络按钮留白，给四字提示保留完整宽度。 */
@media (max-width: 360px) {
    .chain-editor-network-row .segmented-btn { padding-inline: 8px; }
}
.coin-chain-config label { overflow-wrap: anywhere; }
.coin-chain-config-title { flex-wrap: wrap; }

#modalCoinChainConfigs {
    display: grid;
    gap: 10px;
}

.coin-chain-configs-title {
    color: var(--aqr-muted);
    font-size: 12px;
    font-weight: 800;
}

.coin-chain-config {
    display: grid;
    grid-template-columns: minmax(92px, 0.32fr) minmax(0, 1fr);
    align-items: center;
    gap: 8px 10px;
    padding: 10px;
    border: 1px solid var(--aqr-line);
    border-radius: var(--aqr-radius);
    background: var(--aqr-panel-soft);
}

.coin-chain-config-title {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    color: var(--aqr-ink);
    font-size: 13px;
    font-weight: 900;
}

.coin-chain-config-title span {
    color: var(--aqr-muted);
    font-size: 12px;
    font-weight: 800;
}

@media (max-width: 480px) {
    .coin-chain-config,
    .coin-chain-memo-fields,
    .coin-chain-asset-fields { grid-template-columns: minmax(0, 1fr); }
}

.link-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 0;
    color: var(--aqr-teal);
    background: none;
    border: 0;
    font-weight: 900;
    cursor: pointer;
}

.level-list {
    display: grid;
    gap: 10px;
}

.level-list div {
    padding: 12px;
    border-radius: var(--aqr-radius);
    background: var(--aqr-panel-soft);
    border: 1px solid var(--aqr-line);
}

.level-list span {
    float: right;
    color: var(--aqr-teal);
    font-weight: 900;
}

.level-list p {
    clear: both;
    margin: 8px 0 0 !important;
    color: var(--aqr-muted) !important;
    word-break: break-word;
}

.secret-cell {
    max-width: 420px;
    word-break: break-word;
}

#noRegTable {
    min-width: 840px;
    table-layout: fixed;
}

#noRegTable th,
#noRegTable td {
    width: 33.333%;
}

#noRegTable th:nth-child(2),
#noRegTable td:nth-child(2) {
    text-align: center;
}

#noRegTable th:nth-child(3),
#noRegTable td:nth-child(3) {
    text-align: right;
}

.tab-page:not(.hidden) {
    animation: fadeLift 0.28s ease both;
}

.modal {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(15, 23, 42, 0.58);
    backdrop-filter: blur(8px);
}

.modal-panel {
    width: min(520px, 100%);
    max-height: calc(100vh - 40px);
    max-height: calc(100dvh - 40px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 0;
    border-radius: 6px;
    animation: modalIn 0.22s ease both;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 20px 0 24px;
}

.modal-header h3 {
    min-width: 0;
    font-size: 20px;
    font-weight: 500;
    line-height: 28px;
}

.modal-close {
    display: grid;
    place-items: center;
    flex: 0 0 32px;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 0;
    border-radius: 4px;
    background: transparent;
    color: var(--aqr-muted);
    cursor: pointer;
}

.modal-close:hover { color: var(--aqr-ink); background: var(--aqr-panel-soft); }
.modal-close:focus-visible { outline: 2px solid var(--aqr-teal); outline-offset: 2px; }
.modal-panel label { font-size: 14px; font-weight: 600; }

.modal-panel.modal-panel-wide {
    width: min(920px, 100%);
}

.announcement-locale-editor .announcement-toolbar {
    margin-top: 8px;
    border: 1px solid var(--aqr-line);
    border-radius: 6px 6px 0 0;
    background: #fff;
}

.announcement-locale-editor .announcement-toolbar button {
    width: 30px;
    height: 28px;
}

.announcement-locale-editor #announcementBody {
    min-height: 220px;
    max-height: min(45vh, 420px);
    overflow-y: auto;
    border: 1px solid var(--aqr-line);
    border-top: 0;
    border-radius: 0 0 6px 6px;
    background: #fff;
    color: var(--aqr-text);
    font: inherit;
}

.announcement-locale-editor #announcementBody .ql-editor {
    min-height: 210px;
    font: inherit;
    line-height: 1.6;
}

.announcement-locale-editor #announcementBody img {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 12px 0;
}

.announcement-link-panel {
    display: flex;
    align-items: end;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px 0 0;
}

.announcement-link-panel label { width: 100%; }
.announcement-link-panel select,
.announcement-link-panel input { min-width: 140px; flex: 1; }

.announcement-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 6px;
}

#appReleasesTable th:last-child,
#appReleasesTable td:last-child,
#versionChannelsTable th:last-child,
#versionChannelsTable td:last-child { text-align: right; }
#appReleasesTable td.app-release-empty { text-align: left; }
#versionChannelsTable td.version-channel-empty { text-align: left; }
/* 操作列与渠道管理统一为 50px，其他列保持原布局。 */
:is(#appReleasesTable, #rnArtifactsTable, #announcementsTable) :is(th, td):last-child:not([colspan]),
#withdrawTable .withdraw-actions-cell {
    box-sizing: border-box;
    width: 50px;
    min-width: 50px;
    max-width: 50px;
    padding-left: 7px;
    padding-right: 7px;
    white-space: nowrap;
    text-align: center;
    vertical-align: middle;
}
.version-row-actions-source { display: none; }
.version-row-actions-host { display: inline-flex; vertical-align: middle; }
#versionChannelsTable { table-layout: fixed; }
#versionChannelsTable th:nth-child(-n+3) { width: calc((100% - 72px) / 3); }
#versionChannelsTable th:last-child { width: 72px; }
#versionChannelsTable td:not(:last-child) { overflow-wrap: anywhere; }
#versionChannelsTable .app-release-actions { white-space: nowrap; }

.app-release-toolbar { justify-content: space-between !important; }
.app-release-filters { display: flex; flex-wrap: wrap; gap: 8px; }
.app-release-filters select { width: 180px; max-width: 100%; }
#appReleaseNotes { min-height: 96px; resize: vertical; }
.app-release-toolbar-actions { display: flex; justify-content: flex-end; gap: 8px; }
.app-release-toolbar-actions .button { margin-left: 0; }
.version-channel-toolbar-actions { grid-column: 3; display: flex; justify-content: flex-end; gap: 8px; }
.version-channel-toolbar-actions .button { margin-left: 0; white-space: nowrap; }


.modal-panel.modal-panel-funds {
    width: min(1100px, 100%);
}

.modal-actions {
    flex: 0 0 auto;
    justify-content: flex-end;
    margin: 0;
    padding: 12px 24px 20px;
    border-top: 0;
    background: transparent;
}

.modal-extra-actions {
    display: inline-flex;
    align-items: center;
    margin-right: auto;
}

.modal-icon-button {
    width: 40px;
    min-width: 40px;
    min-height: 40px;
    justify-content: center;
    padding: 0;
}

.modal-icon-button i {
    font-size: 18px;
    line-height: 1;
}

#modalBody p {
    margin: 12px 0;
    color: var(--aqr-text);
}

#modalBody {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    margin-top: 0;
    padding: 12px 24px 8px;
}

#modalBody input,
#modalBody select {
    margin-bottom: 10px;
}

#modalBody .clearable-input-shell {
    margin-bottom: 10px;
}

#modalBody .clearable-input-shell > input {
    margin-bottom: 0;
}

#modalBody .select-shell {
    margin-bottom: 10px;
}

#modalBody .rn-target-heading { margin: 16px 0 8px; }
#modalBody .rn-targets {
    max-height: min(240px, 35vh);
    overflow-y: auto;
    padding: 4px 10px;
    border: 1px solid var(--aqr-line);
    border-radius: var(--aqr-radius);
    background: var(--aqr-panel-soft);
}
#modalBody .rn-targets label {
    display: flex;
    align-items: center;
    gap: 9px;
    margin: 0;
    padding: 10px 4px;
    min-width: 0;
    cursor: pointer;
    font-weight: 600;
    overflow-wrap: anywhere;
}
#modalBody .rn-targets label + label { border-top: 1px solid var(--aqr-line); }
#modalBody .rn-targets input[type="checkbox"] {
    width: 18px;
    max-width: 18px;
    height: 18px;
    min-height: 18px;
    flex: 0 0 18px;
    margin: 0;
    padding: 0;
    accent-color: var(--aqr-teal);
}
#modalBody .rn-targets code { overflow-wrap: anywhere; }

.fund-panel-view {
    display: grid;
    gap: 14px;
    color: var(--aqr-text);
    max-height: min(72vh, 720px);
    overflow: auto;
    padding-right: 4px;
}

.fund-panel-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 16px;
    border: 1px solid rgba(216, 224, 234, 0.95);
    border-radius: var(--aqr-radius);
    background: #f8fbfc;
}

.fund-panel-summary span,
.fund-empty {
    color: var(--aqr-muted);
    font-size: 13px;
}

.fund-panel-summary strong {
    display: block;
    margin-top: 4px;
    color: var(--aqr-ink);
    font-size: 16px;
}

.fund-balance-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
}

.fund-balance-card,
.fund-empty {
    min-height: 68px;
    padding: 16px;
    border: 1px solid rgba(216, 224, 234, 0.95);
    border-radius: var(--aqr-radius);
    background: #ffffff;
}

.fund-balance-card span {
    display: block;
    color: var(--aqr-muted);
    font-size: 12px;
    font-weight: 800;
}

.fund-balance-card strong {
    display: block;
    margin-top: 8px;
    color: var(--aqr-ink);
    font-size: 18px;
    font-weight: 900;
}

.fund-record-table {
    overflow: auto;
    border: 1px solid rgba(216, 224, 234, 0.95);
    border-radius: var(--aqr-radius);
    background: #ffffff;
}

.fund-record-table table {
    min-width: 980px;
    background: #ffffff;
}

.fund-record-table th {
    background: #f8fafc;
    color: #475467;
}

.fund-record-table td {
    color: #344054;
    background: #ffffff;
}

.fund-source-cell {
    width: 260px;
    max-width: 260px;
    padding-right: 22px;
}

.fund-remark-cell {
    padding-left: 22px;
}

.fund-source {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 28px;
    align-items: center;
    gap: 6px;
    width: 260px;
    max-width: 100%;
}

.fund-source.no-copy {
    grid-template-columns: minmax(0, 1fr);
}

.fund-source-value {
    min-width: 0;
    overflow: hidden;
    color: inherit;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.fund-source-copy {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    color: var(--aqr-muted);
    border: 1px solid transparent;
    border-radius: 6px;
    background: transparent;
    cursor: copy;
}

.fund-source-copy:hover,
.fund-source-copy:focus-visible {
    color: var(--aqr-primary);
    border-color: rgba(15, 118, 110, 0.22);
    background: rgba(15, 118, 110, 0.08);
    outline: 0;
}

.fund-source-copy:disabled {
    cursor: wait;
    opacity: 0.55;
}

#modalBody input.modal-invalid,
#modalBody select.modal-invalid,
#modalBody .select-shell.modal-invalid .select-trigger {
    border-color: var(--aqr-rose);
    box-shadow: 0 0 0 3px rgba(225, 29, 72, 0.13);
}

@keyframes taijiSpin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes sidebarScan {
    0% {
        transform: translateY(-100%);
    }
    100% {
        transform: translateY(100%);
    }
}

@keyframes livePulse {
    0% {
        box-shadow: 0 0 0 0 rgba(18, 183, 106, 0.42);
    }
    70% {
        box-shadow: 0 0 0 8px rgba(18, 183, 106, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(18, 183, 106, 0);
    }
}

@keyframes fadeLift {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes tileFloat {
    0%,
    100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-8px);
    }
}

@keyframes metricRefresh {
    0% {
        transform: scaleX(0.24);
        opacity: 0.35;
    }
    62% {
        transform: scaleX(1);
        opacity: 0.95;
    }
    100% {
        transform: scaleX(0.78);
        opacity: 0.64;
    }
}

@keyframes noticeIn {
    from {
        opacity: 0;
        transform: translate(-50%, -6px);
    }
    to {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: scale(0.98) translateY(8px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@media (max-width: 1180px) {
    .metric-grid,
    .chart-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .analytics-table-grid {
        grid-template-columns: 1fr;
    }

    .analytics-table-grid > div:last-child {
        grid-column: auto;
    }

    .dashboard-brief {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dashboard-brief-6 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dashboard-brief div:nth-child(2n) {
        border-right: 0;
    }
}

@media (max-width: 920px) {
    .aqr-shell {
        grid-template-columns: 1fr;
    }

    .aqr-sidebar {
        position: relative;
        height: auto;
    }

    .aqr-sidebar-inner {
        /* 窄屏沿用上下布局，展开菜单仍限制在当前视口内。 */
        height: auto;
        max-height: 100vh;
        max-height: 100dvh;
    }

    .aqr-brand {
        min-height: 76px;
    }

    .aqr-nav {
        padding-bottom: 14px;
    }

    .sidebar-foot {
        display: block;
        padding: 18px;
    }

    .auth-frame {
        width: min(520px, 100%);
        grid-template-columns: 1fr;
    }

    .auth-visual {
        /* 窄屏保持完整近景比例，避免裁掉面部或发髻。 */
        min-height: 0;
        aspect-ratio: 1;
    }
}

@media (max-width: 640px) {
    .page-title {
        font-size: 24px;
    }

    .topbar-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .aqr-container {
        padding: 0 18px;
    }

    .notice {
        max-width: 100%;
    }

    .metric-grid,
    .chart-grid,
    .analytics-table-grid,
    .grid-form {
        grid-template-columns: 1fr;
    }

    .dashboard-brief {
        grid-template-columns: 1fr;
    }

    .dashboard-brief-6 {
        grid-template-columns: 1fr;
    }

    .dashboard-brief div {
        justify-content: space-between;
        border-right: 0;
        border-bottom: 1px solid var(--aqr-line);
        padding: 8px 0;
    }

    .dashboard-brief div:last-child {
        border-bottom: 0;
    }

    .auth-panel,
    .auth-visual {
        padding: 24px;
    }

    .toolbar,
    .auth-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .modal-actions {
        align-items: center;
        flex-direction: row;
    }

    .toolbar.search-toolbar {
        align-items: center;
        flex-direction: row;
        flex-wrap: wrap;
    }

    .toolbar.currency-toolbar {
        align-items: center !important;
    }

    

    .toolbar.finance-toolbar {
        grid-template-columns: 1fr;
        align-items: stretch !important;
    }

    .toolbar.withdrawal-toolbar {
        grid-template-columns: 1fr;
        align-items: stretch !important;
    }

    .toolbar input,
    .toolbar select,
    .toolbar .clearable-input-shell,
    .toolbar .select-shell,
    .toolbar.compact input,
    .button {
        width: 100%;
        max-width: none;
    }

    .modal-extra-actions {
        align-self: center;
        margin-right: auto;
    }

    .modal-actions > .button {
        width: auto;
        max-width: none;
    }

    .modal-icon-button {
        width: 40px !important;
        max-width: 40px !important;
    }

    .toolbar.search-toolbar .button {
        width: auto;
    }

    .toolbar.currency-toolbar .button,
    .toolbar.currency-toolbar .segmented {
        width: auto;
        max-width: max-content;
    }

    .toolbar.app-release-toolbar { grid-template-columns: 1fr; }
    .toolbar.app-release-toolbar .app-release-filters { width: 100%; }
    .toolbar.app-release-toolbar .app-release-filters select { flex: 1 1 150px; width: auto; }
    .toolbar.app-release-toolbar .app-release-toolbar-actions { width: 100%; }
    .toolbar.app-release-toolbar .app-release-toolbar-actions .button { flex: 1; width: auto; max-width: none; }
    .toolbar.version-channel-toolbar { grid-template-columns: minmax(0, 1fr); }
    .toolbar.version-channel-toolbar .version-channel-toolbar-actions {
        grid-column: 1;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: 100%;
    }
    .toolbar.version-channel-toolbar .version-channel-toolbar-actions .button {
        width: 100%;
        max-width: none;
        min-width: 0;
    }
    

    .toolbar.finance-toolbar .segmented,
    .finance-toolbar .finance-record-filter,
    .finance-toolbar .clearable-input-shell,
    .finance-toolbar .select-shell,
    .finance-toolbar #refreshFinanceBtn {
        /* 小屏下财务标签、筛选和按钮改为单列，保持切换状态可读。 */
        grid-column: 1;
        width: 100%;
        max-width: none;
        margin-left: 0;
    }

    .withdrawal-toolbar .segmented,
    .withdrawal-toolbar .withdrawal-status-filter,
    .withdrawal-toolbar .button {
        grid-column: 1;
        width: 100%;
        max-width: none;
    }

    .toolbar.search-toolbar > input,
    .toolbar.search-toolbar > .clearable-input-shell {
        min-height: 40px !important;
        height: 40px !important;
        width: auto;
        max-width: none;
        flex: 1 1 0;
    }

    .toolbar.search-toolbar > select,
    .toolbar.search-toolbar > .select-shell {
        min-height: 40px !important;
        height: 40px !important;
        width: min(260px, 100%);
        max-width: min(260px, 100%);
        flex: 0 0 min(260px, 100%);
    }

    .toolbar.search-toolbar > .clearable-input-shell > input {
        width: 100%;
        max-width: none;
    }

    .config-editor,
    .income-grid {
        grid-template-columns: 1fr;
        width: 100%;
        max-width: none;
    }

    .config-secret-editor {
        grid-template-columns: 1fr;
    }

    .user-detail-grid {
        grid-template-columns: 1fr;
    }

    .switch-control {
        width: 100%;
    }
}

/* 搜索/筛选栏必须保持一行工具条形态，避免被移动端或卡片规则拉成竖向大块。 */
.toolbar.search-toolbar {
    display: flex !important;
    position: relative;
    z-index: 30;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    align-content: center !important;
    justify-content: flex-start !important;
    gap: 10px !important;
    min-height: 68px !important;
    height: auto !important;
    overflow: visible !important;
}

.toolbar.search-toolbar > input,
.toolbar.search-toolbar > .clearable-input-shell {
    /* 顶部搜索框占满除按钮和筛选项外的剩余横向空间。 */
    flex: 1 1 0 !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
    min-height: 40px !important;
    height: 40px !important;
    max-height: 40px !important;
    align-self: center !important;
    box-sizing: border-box;
}

.toolbar.search-toolbar > .clearable-input-shell > input {
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
}

.toolbar.search-toolbar > select,
.toolbar.search-toolbar > .select-shell {
    flex: 0 0 260px !important;
    width: 260px !important;
    min-width: 260px !important;
    max-width: 260px !important;
    min-height: 40px !important;
    height: 40px !important;
    max-height: 40px !important;
    align-self: center !important;
    box-sizing: border-box;
}

.toolbar.search-toolbar > .select-shell {
    z-index: 60;
}

.toolbar.search-toolbar > .button {
    flex: 0 0 auto !important;
    width: auto !important;
    min-width: max-content !important;
    min-height: 40px !important;
    height: 40px !important;
    max-height: 40px !important;
    align-self: center !important;
}

#tab-agents .agent-list-card {
    width: calc(100% - 24px);
    margin: 10px auto 0;
    background: #ffffff;
    border: 1px solid #d8e2ec;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 14px 28px rgba(15, 23, 42, 0.05);
}

#tab-agents .agent-list-card .table {
    margin: 0;
    background: #ffffff;
}

#tab-agents .agent-list-card .table thead th {
    background: #f8fafc;
}

#tab-dashboard .metric-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 20px 24px;
    align-items: stretch;
}

#tab-dashboard .dashboard-brief {
    grid-column: 1 / -1;
    min-height: 52px;
    border-radius: 4px;
    background: #ffffff;
    border: 0;
    box-shadow: none;
}

#tab-dashboard .metric {
    display: grid;
    grid-template-columns: minmax(116px, 40%) minmax(0, 1fr);
    min-height: 100px;
    padding: 0;
    border: 0;
    border-radius: 4px;
    background: #ffffff;
    box-shadow: none;
    color: #94a3b8;
}

#tab-dashboard .metric:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 36px rgba(15, 23, 42, 0.08);
}

#tab-dashboard .metric::before,
#tab-dashboard .metric::after {
    display: none;
}

#tab-dashboard .metric-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100px;
    color: #ffffff;
    font-size: 44px;
}

#tab-dashboard .metric.tone-0 .metric-icon {
    background: #68c9c4;
}

#tab-dashboard .metric.tone-1 .metric-icon {
    background: #ff675f;
}

#tab-dashboard .metric.tone-2 .metric-icon {
    background: #ffd547;
}

#tab-dashboard .metric.tone-3 .metric-icon {
    background: #52c3e6;
}

#tab-dashboard .metric-main {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 0;
    padding: 12px 18px;
    text-align: center;
}

#tab-dashboard .metric span {
    order: 2;
    margin-top: 4px;
    color: #a8b1c3;
    font-size: 13px;
    font-weight: 500;
}

#tab-dashboard .metric strong {
    order: 1;
    margin: 0;
    color: #b8c0d0;
    font-size: 34px;
    font-weight: 300;
    letter-spacing: 0;
}

#tab-dashboard .metric em {
    order: 3;
    max-width: 100%;
    margin-top: 6px;
    color: #94a3b8;
    font-size: 11px;
    line-height: 1.35;
}

#tab-dashboard .chart-grid {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(300px, 0.96fr);
    gap: 20px 24px;
}

#tab-dashboard .chart-grid::before {
    content: "统计数据";
    grid-column: 1 / -1;
    color: #64748b;
    font-size: 16px;
    line-height: 1;
}

#tab-dashboard .chart-card {
    min-height: 170px;
    padding: 16px 16px 0;
    border: 0;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: none;
    background: #ffffff;
}

#tab-dashboard .chart-card:first-child {
    grid-row: span 2;
    min-height: 360px;
    background:
        linear-gradient(0deg, rgba(148, 163, 184, 0.22) 1px, transparent 1px),
        #f3f5f9;
    background-size: 100% 58px, auto;
}

#tab-dashboard .chart-card:nth-child(2) {
    background: linear-gradient(135deg, #46c9c1, #33b4aa);
}

#tab-dashboard .chart-card:nth-child(3) {
    background: linear-gradient(135deg, #a7db6f, #8fc45b);
}

#tab-dashboard .chart-card:nth-child(4) {
    grid-column: 1 / -1;
    min-height: 220px;
    background: linear-gradient(135deg, #54c2e4, #4d93d7);
}

#tab-dashboard .chart-card div:first-child {
    margin-bottom: 12px;
}

#tab-dashboard .chart-card b {
    color: #0f172a;
    font-size: 14px;
}

#tab-dashboard .chart-card span {
    color: #64748b;
}

#tab-dashboard .chart-card:nth-child(n+2) b,
#tab-dashboard .chart-card:nth-child(n+2) span {
    color: #ffffff;
}

#tab-dashboard .chart-card:nth-child(n+2) .spark-area {
    fill: rgba(255, 255, 255, 0.15);
}

#tab-dashboard .chart-card:nth-child(n+2) .spark-line {
    stroke: rgba(255, 255, 255, 0.95);
}

#tab-dashboard .chart-card:nth-child(n+2) .spark-dot {
    fill: #ffffff;
    stroke: rgba(255, 255, 255, 0.9);
}

#tab-dashboard .sparkline {
    height: 118px;
}

#tab-dashboard .chart-card:first-child .sparkline {
    height: 286px;
}

#tab-dashboard .chart-card:nth-child(4) .sparkline {
    height: 150px;
}

@media (max-width: 1200px) {
    #tab-dashboard .metric-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    #tab-dashboard .chart-grid {
        grid-template-columns: 1fr;
    }

    #tab-dashboard .chart-card:first-child,
    #tab-dashboard .chart-card:nth-child(4) {
        grid-column: auto;
        grid-row: auto;
    }
}
