/* =====================================================
   黑白主题 UI 组件库 v1.0
   - 纯 CSS/JS 自绘所有交互组件
   - 禁用所有平台原生点击动画/高亮
   ===================================================== */

/* ---------- 全局重置 & 原生动效禁用 ---------- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent; /* 禁用安卓点击高亮 */
    -webkit-touch-callout: none;
}

html, body {
    height: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: #111;
    background: #f5f5f5;
    -webkit-font-smoothing: antialiased;
}

/* 禁用原生外观：按钮/输入框/下拉/单选/多选 */
button, input, select, textarea {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    outline: none;
    font-family: inherit;
    font-size: inherit;
    color: inherit;
}

button, [role="button"] {
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
}

input[type="checkbox"], input[type="radio"] {
    appearance: none;
    -webkit-appearance: none;
    display: none; /* 使用自绘组件替代 */
}

/* 禁用 iOS 输入框圆角/阴影 */
input, textarea, select {
    border-radius: 0;
}

a {
    color: inherit;
    text-decoration: none;
}

ul, ol { list-style: none; }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #c4c4c4; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #999; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- 布局框架：顶栏 + 侧边栏 + 内容区 ---------- */
.app-shell {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.app-topbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 56px;
    background: #111;
    color: #fff;
    display: flex;
    align-items: center;
    padding: 0 16px;
    z-index: 100;
    gap: 12px;
}

/* 汉堡按钮（侧边栏收放） */
.btn-hamburger {
    width: 38px;
    height: 38px;
    background: transparent;
    border: none;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    border-radius: 6px;
    transition: background .18s ease;
}
.btn-hamburger:hover { background: rgba(255,255,255,.12); }
.btn-hamburger:active { background: rgba(255,255,255,.22); transform: scale(.94); }
.btn-hamburger span {
    display: block;
    width: 20px;
    height: 2px;
    background: #fff;
    border-radius: 1px;
    transition: transform .25s ease, opacity .25s ease;
    transform-origin: center;
}
.btn-hamburger.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.btn-hamburger.is-open span:nth-child(2) { opacity: 0; }
.btn-hamburger.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.topbar-brand {
    font-size: 16px;
    font-weight: 700;
    letter-spacing: .5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.topbar-spacer { flex: 1; }

/* 顶栏头像 */
.topbar-avatar {
    position: relative;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid rgba(255,255,255,.85);
    background: #fff;
    transition: transform .18s ease, border-color .18s ease;
    flex-shrink: 0;
}
.topbar-avatar:hover { transform: scale(1.06); border-color: #fff; }
.topbar-avatar:active { transform: scale(.96); }
.topbar-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    background: #fff;
}
/* 非QQ邮箱：首字母头像 */
.topbar-avatar .avatar-letter {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    color: #111;
    font-weight: 700;
    font-size: 16px;
    text-transform: uppercase;
}
/* 头像下拉菜单 */
.avatar-menu {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    min-width: 180px;
    background: #fff;
    border: 1px solid #111;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,.16);
    padding: 6px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity .18s ease, transform .18s ease, visibility .18s;
    z-index: 120;
}
.avatar-wrap { position: relative; }
.avatar-wrap.is-open .avatar-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.avatar-menu .menu-header {
    padding: 10px 12px;
    border-bottom: 1px solid #e5e5e5;
    margin-bottom: 4px;
}
.avatar-menu .menu-header .m-title {
    font-weight: 600; color: #111; font-size: 13px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.avatar-menu .menu-header .m-sub {
    font-size: 12px; color: #555;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.avatar-menu a, .avatar-menu button.menu-item {
    display: block;
    width: 100%;
    padding: 9px 12px;
    background: none;
    border: none;
    text-align: left;
    color: #111;
    font-size: 13px;
    border-radius: 6px;
    transition: background .15s ease, padding-left .15s ease;
}
.avatar-menu a:hover, .avatar-menu button.menu-item:hover {
    background: #111;
    color: #fff;
    padding-left: 16px;
}
.avatar-menu a:active, .avatar-menu button.menu-item:active {
    background: #000;
    transform: scale(.98);
}

/* 主体区域 */
.app-body {
    display: flex;
    padding-top: 56px;
    min-height: calc(100vh - 56px);
}

/* 侧边栏 */
.app-sidebar {
    width: 220px;
    background: #fff;
    border-right: 1px solid #111;
    position: fixed;
    top: 56px;
    bottom: 0;
    left: 0;
    z-index: 90;
    overflow-y: auto;
    overflow-x: hidden;
    transition: width .25s cubic-bezier(.4,0,.2,1), transform .25s cubic-bezier(.4,0,.2,1);
    padding: 12px 10px;
}
.app-sidebar.is-collapsed { width: 0; padding: 12px 0; border-right: none; }

.app-sidebar .nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 14px;
    margin-bottom: 4px;
    border-radius: 8px;
    color: #111;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    transition: background .16s ease, color .16s ease, padding-left .16s ease;
    position: relative;
}
.app-sidebar .nav-item:hover {
    background: #eee;
    padding-left: 18px;
}
.app-sidebar .nav-item:active { transform: scale(.98); }
.app-sidebar .nav-item.active {
    background: #111;
    color: #fff;
    padding-left: 18px;
}
.app-sidebar .nav-item.active::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 20px;
    background: #fff;
    border-radius: 0 2px 2px 0;
}
.app-sidebar .nav-item .nav-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
}

.sidebar-nav-group {
    margin-top: 14px;
    padding: 0 12px 6px;
    font-size: 11px;
    color: #767676;
    letter-spacing: 1px;
    white-space: nowrap;
}

/* 内容区 */
.app-main {
    flex: 1;
    margin-left: 220px;
    padding: 24px;
    transition: margin-left .25s cubic-bezier(.4,0,.2,1);
    min-width: 0;
}
.app-main.sidebar-collapsed { margin-left: 0; }

@media (max-width: 768px) {
    .app-sidebar {
        transform: translateX(-100%);
        width: 220px !important;
        padding: 12px 10px;
        border-right: 1px solid #111;
        box-shadow: 4px 0 24px rgba(0,0,0,.12);
    }
    .app-sidebar.mobile-open { transform: translateX(0); }
    .app-main { margin-left: 0 !important; padding: 16px; }
    /* 移动端遮罩 */
    .sidebar-mask {
        position: fixed;
        top: 56px;
        right: 0;
        bottom: 0;
        left: 0;
        background: rgba(0,0,0,.4);
        z-index: 85;
        opacity: 0;
        visibility: hidden;
        transition: opacity .2s ease, visibility .2s;
    }
    .sidebar-mask.show { opacity: 1; visibility: visible; }
}

/* ---------- 按钮 ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 18px;
    font-size: 14px;
    font-weight: 500;
    border: 1px solid #111;
    background: #111;
    color: #fff;
    border-radius: 6px;
    transition: transform .15s ease, background .15s ease, color .15s ease, box-shadow .15s ease;
    position: relative;
    overflow: hidden;
}
.btn:hover { background: #333; border-color: #333; box-shadow: 0 2px 8px rgba(0,0,0,.2); }
.btn:active { transform: scale(.965); background: #000; }
.btn:disabled, .btn.is-disabled {
    opacity: .45;
    pointer-events: none;
}

.btn-outline {
    background: #fff;
    color: #111;
    border: 1px solid #111;
}
.btn-outline:hover { background: #111; color: #fff; }
.btn-outline:active { background: #000; color: #fff; }

.btn-ghost {
    background: transparent;
    color: #111;
    border: 1px solid transparent;
}
.btn-ghost:hover { background: #eee; border-color: #eee; box-shadow: none; }

/* 顶栏按钮（黑底顶栏内使用：透明底白字白边，hover反白） */
.btn-topbar {
    background: transparent;
    color: #fff;
    border: 1px solid #fff;
}
.btn-topbar:hover { background: #fff; color: #111; border-color: #fff; box-shadow: none; }
.btn-topbar:active { background: #eee; color: #111; transform: scale(.965); }

.btn-sm { padding: 5px 12px; font-size: 12px; border-radius: 5px; }
.btn-lg { padding: 12px 28px; font-size: 15px; }
.btn-block { width: 100%; }

/* 危险按钮（黑底白字反白动画） */
.btn-danger {
    background: #fff;
    color: #111;
    border: 1px solid #111;
}
.btn-danger:hover { background: #111; color: #fff; }

/* ---------- 表单 ---------- */
.form-group { margin-bottom: 18px; }
.form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 7px;
    color: #111;
}
.form-label .req { color: #111; margin-left: 2px; font-weight: 700; }
.form-label .form-tip { font-weight: 400; color: #666; font-size: 12px; margin-left: 6px; }

.form-input, .form-textarea, .form-select {
    width: 100%;
    padding: 10px 13px;
    border: 1px solid #111;
    background: #fff;
    color: #111;
    border-radius: 6px;
    font-size: 14px;
    transition: box-shadow .18s ease, border-color .18s ease;
}
.form-input:focus, .form-textarea:focus {
    border-color: #111;
    box-shadow: 0 0 0 3px rgba(17,17,17,.14);
}
.form-input::placeholder, .form-textarea::placeholder { color: #767676; }
.form-input.is-error { border-color: #111; box-shadow: 0 0 0 3px rgba(17,17,17,.25); }
.form-textarea { min-height: 120px; resize: vertical; }
.form-hint { font-size: 12px; color: #666; margin-top: 5px; }
.form-hint.is-error { color: #111; font-weight: 600; }

/* ---------- 自绘单选框（radio） ---------- */
.radio-row { display: flex; flex-wrap: wrap; gap: 12px; }
.dsygl-radio {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 8px 14px;
    border: 1px solid #111;
    border-radius: 6px;
    background: #fff;
    user-select: none;
    transition: background .16s ease, color .16s ease, transform .12s ease;
}
.dsygl-radio:hover { background: #f0f0f0; }
.dsygl-radio:active { transform: scale(.97); }
.dsygl-radio .r-mark {
    width: 16px;
    height: 16px;
    border: 2px solid #111;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background .15s ease;
}
.dsygl-radio .r-mark::after {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #fff;
    transform: scale(0);
    transition: transform .18s cubic-bezier(.34,1.56,.64,1);
}
.dsygl-radio.is-checked {
    background: #111;
    color: #fff;
}
.dsygl-radio.is-checked .r-mark { border-color: #fff; }
.dsygl-radio.is-checked .r-mark::after { transform: scale(1); }

/* ---------- 自绘复选框（checkbox） ---------- */
.dsygl-checkbox {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
}
.dsygl-checkbox .c-mark {
    width: 16px;
    height: 16px;
    border: 2px solid #111;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background .15s ease, border-color .15s ease;
}
.dsygl-checkbox .c-mark::after {
    content: "";
    width: 9px;
    height: 5px;
    border-left: 2px solid #fff;
    border-bottom: 2px solid #fff;
    transform: rotate(-45deg) scale(0);
    margin-top: -2px;
    transition: transform .18s cubic-bezier(.34,1.56,.64,1);
}
.dsygl-checkbox.is-checked .c-mark { background: #111; }
.dsygl-checkbox.is-checked .c-mark::after { transform: rotate(-45deg) scale(1); }
.dsygl-checkbox:hover .c-mark { border-color: #555; }
.dsygl-checkbox:active .c-mark { transform: scale(.9); }

/* ---------- 自绘开关（switch） ---------- */
.dsygl-switch {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    cursor: pointer;
    user-select: none;
}
.dsygl-switch .s-track {
    width: 42px;
    height: 23px;
    border: 1px solid #111;
    border-radius: 12px;
    background: #fff;
    position: relative;
    transition: background .2s ease;
    flex-shrink: 0;
}
.dsygl-switch .s-thumb {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 17px;
    height: 17px;
    border-radius: 50%;
    background: #111;
    transition: transform .22s cubic-bezier(.4,0,.2,1), background .2s ease;
}
.dsygl-switch.is-on .s-track { background: #111; }
.dsygl-switch.is-on .s-thumb { transform: translateX(19px); background: #fff; }
.dsygl-switch:active .s-thumb { width: 19px; }
.dsygl-switch.is-on:active .s-thumb { transform: translateX(16px); width: 19px; }
.dsygl-switch .s-label { font-size: 13px; }

/* ---------- 自绘下拉选择 ---------- */
.dsygl-select {
    position: relative;
    width: 100%;
}
.dsygl-select .sel-trigger {
    width: 100%;
    padding: 10px 13px;
    border: 1px solid #111;
    background: #fff;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    font-size: 14px;
    transition: box-shadow .18s ease;
    user-select: none;
}
.dsygl-select .sel-trigger:hover { background: #fafafa; }
.dsygl-select .sel-trigger:active { transform: scale(.995); }
.dsygl-select.is-open .sel-trigger { box-shadow: 0 0 0 3px rgba(17,17,17,.14); }
.dsygl-select .sel-arrow {
    width: 0; height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 6px solid #111;
    transition: transform .2s ease;
}
.dsygl-select.is-open .sel-arrow { transform: rotate(180deg); }
.dsygl-select .sel-placeholder { color: #767676; }
.dsygl-select .sel-list {
    position: absolute;
    top: calc(100% + 5px);
    left: 0; right: 0;
    background: #fff;
    border: 1px solid #111;
    border-radius: 6px;
    max-height: 240px;
    overflow-y: auto;
    z-index: 60;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: opacity .16s ease, transform .16s ease, visibility .16s;
    box-shadow: 0 8px 24px rgba(0,0,0,.14);
}
.dsygl-select.is-open .sel-list {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.dsygl-select .sel-list .opt {
    padding: 9px 13px;
    cursor: pointer;
    font-size: 13px;
    transition: background .13s ease, padding-left .13s ease;
}
.dsygl-select .sel-list .opt:hover { background: #f0f0f0; padding-left: 17px; }
.dsygl-select .sel-list .opt.selected { background: #111; color: #fff; }

/* ---------- 卡片 ---------- */
.card {
    background: #fff;
    border: 1px solid #111;
    border-radius: 10px;
    padding: 20px;
}
.card-title {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.card-title::before {
    content: "";
    width: 4px;
    height: 16px;
    background: #111;
    border-radius: 2px;
}

/* ---------- 标签 / 徽章 ---------- */
.tag {
    display: inline-flex;
    align-items: center;
    padding: 2px 10px;
    font-size: 12px;
    border-radius: 4px;
    border: 1px solid #111;
    background: #fff;
    color: #111;
    white-space: nowrap;
}
.tag-dark { background: #111; color: #fff; }
.tag-gray { background: #f2f2f2; border-color: #ccc; color: #555; }
.tag-outline { background: transparent; }

/* ---------- 表格 ---------- */
.table-wrap {
    width: 100%;
    overflow-x: auto;
    border: 1px solid #111;
    border-radius: 8px;
    background: #fff;
}
.data-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 640px;
}
.data-table th {
    background: #111;
    color: #fff;
    text-align: left;
    padding: 11px 14px;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
}
.data-table td {
    padding: 11px 14px;
    border-bottom: 1px solid #e8e8e8;
    font-size: 13px;
    color: #222;
    vertical-align: middle;
    white-space: nowrap;
}
.data-table tbody tr { transition: background .14s ease; }
.data-table tbody tr:hover { background: #f7f7f7; }
.data-table tbody tr:active { background: #efefef; }
.data-table tbody tr:last-child td { border-bottom: none; }

/* 无刷新切换页面时的加载态 */
.app-main.is-soft-loading {
    opacity: .55;
    pointer-events: none;
    transition: opacity .15s ease;
}

/* ---------- 弹窗（Modal） ---------- */
.modal-mask {
    position: fixed;
    /* 兼容老版本安卓/WebView：不使用 inset 简写，显式声明四边 */
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background: rgba(0,0,0,.5);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: opacity .2s ease, visibility .2s;
}
.modal-mask.is-open { opacity: 1; visibility: visible; }
.modal-box {
    background: #fff;
    border: 1px solid #111;
    border-radius: 12px;
    width: 100%;
    max-width: 460px;
    max-height: 86vh;
    display: flex;
    flex-direction: column;
    transform: translateY(24px) scale(.96);
    transition: transform .22s cubic-bezier(.34,1.2,.64,1);
    box-shadow: 0 20px 60px rgba(0,0,0,.3);
}
.modal-mask.is-open .modal-box { transform: translateY(0) scale(1); }
.modal-head {
    padding: 16px 20px;
    border-bottom: 1px solid #111;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.modal-title { font-size: 15px; font-weight: 700; }
.modal-close {
    width: 28px;
    height: 28px;
    background: transparent;
    border: 1px solid #111;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    line-height: 1;
    transition: background .15s ease, color .15s ease, transform .15s ease;
}
.modal-close:hover { background: #111; color: #fff; }
.modal-close:active { transform: scale(.9) rotate(90deg); }
.modal-body { padding: 20px; overflow-y: auto; overflow-x: auto; }
.modal-foot {
    padding: 14px 20px;
    border-top: 1px solid #e5e5e5;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}
.modal-box.modal-lg { max-width: 680px; }

/* ---------- Toast 通知 ---------- */
.toast-wrap {
    position: fixed;
    top: 68px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 300;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    pointer-events: none;
    width: min(90vw, 400px);
}
.toast-item {
    background: #111;
    color: #fff;
    padding: 10px 18px;
    border-radius: 8px;
    font-size: 13px;
    box-shadow: 0 6px 20px rgba(0,0,0,.25);
    display: flex;
    align-items: center;
    gap: 8px;
    max-width: 100%;
    opacity: 0;
    transform: translateY(-14px) scale(.95);
    transition: opacity .22s ease, transform .22s cubic-bezier(.34,1.3,.64,1);
    pointer-events: auto;
}
.toast-item.toast-show { opacity: 1; transform: translateY(0) scale(1); }
.toast-item .t-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #fff;
    flex-shrink: 0;
}
.toast-item.toast-success .t-dot { background: #fff; }
.toast-item.toast-error { background: #fff; color: #111; border: 1.5px solid #111; }
.toast-item.toast-error .t-dot { background: #111; }

/* ---------- 加载中 ---------- */
.loading-spin {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(17,17,17,.2);
    border-top-color: #111;
    border-radius: 50%;
    animation: dsyglSpin .7s linear infinite;
    display: inline-block;
}
.btn .loading-spin { border-color: rgba(255,255,255,.35); border-top-color: #fff; }
@keyframes dsyglSpin { to { transform: rotate(360deg); } }

/* ---------- 空状态 ---------- */
.empty-box {
    text-align: center;
    padding: 50px 20px;
    color: #767676;
}
.empty-box .e-icon {
    font-size: 38px;
    margin-bottom: 10px;
    color: #8a8a8a;
}

/* ---------- 分页 ---------- */
.pager {
    display: flex;
    gap: 6px;
    margin-top: 16px;
    flex-wrap: wrap;
    justify-content: center;
}
.pager .p-btn {
    min-width: 34px;
    height: 34px;
    padding: 0 10px;
    border: 1px solid #111;
    background: #fff;
    border-radius: 6px;
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background .14s ease, color .14s ease, transform .12s ease;
}
.pager .p-btn:hover { background: #eee; }
.pager .p-btn:active { transform: scale(.94); }
.pager .p-btn.is-current { background: #111; color: #fff; pointer-events: none; }
.pager .p-btn.is-disabled { opacity: .35; pointer-events: none; }

/* ---------- 网格工具类 ---------- */
.grid-2 { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.flex-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-16 { margin-bottom: 16px; }
.text-muted { color: #666; }
.text-bold { font-weight: 700; }
.text-right { text-align: right; }
.w-full { width: 100%; }
/* 长文本单行截断：一条数据一行，超宽省略号（悬停有 title 可看全文），只加宽不增高 */
.text-break {
    display: inline-block;
    max-width: 320px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    word-break: normal;
    vertical-align: middle;
}
/* 账号数据列：同样单行截断（内容较长，放宽到 520px），悬停 title 看全文 */
.acc-content {
    display: inline-block;
    max-width: 520px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: middle;
}

/* ---------- 统计卡（仪表盘） ---------- */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}
.stat-card {
    background: #fff;
    border: 1px solid #111;
    border-radius: 10px;
    padding: 16px 18px;
    position: relative;
    overflow: hidden;
}
.stat-card .s-label { font-size: 12px; color: #666; margin-bottom: 6px; }
.stat-card .s-value {
    font-size: 24px;
    font-weight: 800;
    color: #111;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.5px;
}
.stat-card .s-foot { margin-top: 8px; font-size: 12px; color: #666; }
.stat-card .s-trend { font-weight: 700; color: #111; }

/* 数字滚动动画 */
@keyframes numPop {
    0% { transform: scale(.92); opacity: .4; }
    100% { transform: scale(1); opacity: 1; }
}
.stat-card .s-value.num-anim { animation: numPop .3s ease; }

/* ---------- 简易图表条 ---------- */
.bar-chart {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    height: 180px;
    padding: 10px 4px 0;
}
.bar-chart .bar-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    min-width: 0;
}
.bar-chart .bar {
    width: 100%;
    max-width: 46px;
    background: #111;
    border-radius: 4px 4px 0 0;
    transition: height .5s cubic-bezier(.4,0,.2,1), background .2s ease;
    min-height: 2px;
    position: relative;
}
.bar-chart .bar:hover { background: #444; }
.bar-chart .bar-val { font-size: 10px; color: #444; white-space: nowrap; }
.bar-chart .bar-label { font-size: 11px; color: #666; white-space: nowrap; }

/* ---------- 登录/注册页 ---------- */
.auth-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: #f5f5f5;
}
.auth-card {
    width: 100%;
    max-width: 400px;
    background: #fff;
    border: 1px solid #111;
    border-radius: 14px;
    padding: 34px 30px;
    box-shadow: 8px 8px 0 #111; /* 黑白硬阴影风格 */
}
.auth-logo {
    font-size: 22px;
    font-weight: 800;
    text-align: center;
    margin-bottom: 26px;
    letter-spacing: 1px;
}
.auth-foot { text-align: center; margin-top: 18px; font-size: 13px; color: #666; }
.auth-foot a {
    color: #111;
    font-weight: 600;
    border-bottom: 1px solid #111;
    transition: opacity .15s ease;
}
.auth-foot a:active { opacity: .6; }

/* ---------- 购买页 ---------- */
.buy-grid { display: grid; grid-template-columns: 240px 1fr; gap: 18px; align-items: start; }
@media (max-width: 900px) { .buy-grid { grid-template-columns: 1fr; } }

.cat-item {
    border: 1px solid #111;
    border-radius: 8px;
    padding: 13px 15px;
    cursor: pointer;
    background: #fff;
    transition: background .15s ease, color .15s ease, transform .12s ease;
    position: relative;
}
.cat-item:hover { background: #f2f2f2; }
.cat-item:active { transform: scale(.98); }
.cat-item.is-selected { background: #111; color: #fff; }
.cat-item .c-name { font-weight: 700; font-size: 14px; }
.cat-item .c-meta { font-size: 12px; margin-top: 3px; color: #666; }
.cat-item.is-selected .c-meta { color: #ccc; }
.cat-item .c-price { font-weight: 800; font-size: 15px; }

.qty-input {
    display: flex;
    align-items: center;
    border: 1px solid #111;
    border-radius: 6px;
    width: fit-content;
    overflow: hidden;
}
.qty-input button {
    width: 40px;
    height: 40px;
    background: #fff;
    border: none;
    font-size: 18px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .13s ease, color .13s ease;
}
.qty-input button:hover { background: #111; color: #fff; }
.qty-input button:active { transform: scale(.92); }
.qty-input input {
    width: 80px;
    height: 40px;
    border: none;
    text-align: center;
    font-size: 15px;
    font-weight: 700;
    border-left: 1px solid #111;
    border-right: 1px solid #111;
    -moz-appearance: textfield;
}
.qty-input input::-webkit-outer-spin-button,
.qty-input input::-webkit-inner-spin-button { -webkit-appearance: none; }

/* ---------- 结果展示 ---------- */
.result-box {
    background: #fafafa;
    border: 1px solid #111;
    border-radius: 8px;
    padding: 14px;
    max-height: 320px;
    overflow-y: auto;
    font-family: "JetBrains Mono", Menlo, Consolas, monospace;
    font-size: 12px;
    line-height: 1.8;
    white-space: pre-wrap;
    word-break: break-all;
}

/* ---------- 页面标题 ---------- */
.page-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}
.page-title { font-size: 20px; font-weight: 800; }
.page-sub { font-size: 13px; color: #666; margin-top: 2px; }

/* ---------- 设置板块 ---------- */
.setting-tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}
.setting-tabs .tab-btn {
    padding: 8px 18px;
    border: 1px solid #111;
    background: #fff;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 500;
    transition: background .15s ease, color .15s ease, transform .12s ease;
}
.setting-tabs .tab-btn:hover { background: #eee; }
.setting-tabs .tab-btn:active { transform: scale(.95); }
.setting-tabs .tab-btn.is-active { background: #111; color: #fff; }
