/* ================= 插件管理系统 全局样式（高端版） ================= */
:root {
    --primary: #4f6ef7;
    --primary-dark: #3b54d8;
    --primary-light: #eef2ff;
    --accent: #8b5cf6;
    --success: #23a55a;
    --danger: #e14b4b;
    --warning: #e8a33d;
    --bg: #f2f4f9;
    --panel: #ffffff;
    --border: #e6e9f0;
    --text: #1f2733;
    --text-sub: #6b7690;
    --sidebar-bg: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
    --sidebar-hover: rgba(99, 102, 241, .18);
    --radius: 12px;
    --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 6px 18px rgba(15, 23, 42, .06);
    --shadow-lg: 0 20px 50px rgba(15, 23, 42, .18);
    --gradient-primary: linear-gradient(135deg, #4f6ef7 0%, #7c3aed 100%);
}

* {
    box-sizing: border-box;
}

html, body {
    height: 100%;
}

body {
    margin: 0;
    font-family: -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    font-size: 14px;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--primary);
    text-decoration: none;
}

/* ================= 登录页 ================= */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        radial-gradient(circle at 18% 22%, rgba(139, 92, 246, .55), transparent 45%),
        radial-gradient(circle at 82% 78%, rgba(79, 110, 247, .55), transparent 45%),
        linear-gradient(135deg, #0f172a 0%, #1e1b4b 50%, #312e81 100%);
    padding: 30px;
    position: relative;
    overflow: hidden;
}

.login-page::before {
    content: '';
    position: absolute;
    width: 520px;
    height: 520px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(139, 92, 246, .35), transparent 70%);
    top: -160px;
    left: -120px;
    animation: floatBlob 14s ease-in-out infinite;
}

.login-page::after {
    content: '';
    position: absolute;
    width: 460px;
    height: 460px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(79, 110, 247, .35), transparent 70%);
    bottom: -160px;
    right: -120px;
    animation: floatBlob 16s ease-in-out infinite reverse;
}

@keyframes floatBlob {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(40px, -30px) scale(1.08); }
}

.login-card {
    width: 840px;
    max-width: 100%;
    background: rgba(255, 255, 255, .96);
    backdrop-filter: blur(14px);
    border-radius: 22px;
    box-shadow: var(--shadow-lg), 0 0 0 1px rgba(255, 255, 255, .15);
    padding: 40px 48px 36px;
    position: relative;
    z-index: 1;
    animation: cardIn .5s cubic-bezier(.2, .8, .2, 1);
}

@keyframes cardIn {
    from { opacity: 0; transform: translateY(24px) scale(.97); }
    to { opacity: 1; transform: none; }
}

.login-brand {
    text-align: center;
    margin-bottom: 28px;
}

.login-brand .logo {
    width: 64px;
    height: 64px;
    border-radius: 18px;
    background: var(--gradient-primary);
    color: #fff;
    font-size: 28px;
    font-weight: 700;
    line-height: 64px;
    margin: 0 auto 14px;
    box-shadow: 0 12px 28px rgba(79, 110, 247, .4);
}

.login-brand h1 {
    margin: 0;
    font-size: 24px;
    letter-spacing: 2px;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.login-brand p {
    margin: 8px 0 0;
    color: var(--text-sub);
    font-size: 13px;
    letter-spacing: 1px;
}

/* 登录表单：单列居中 */
.login-form .form-item {
    margin-bottom: 18px;
}

.login-form .form-control {
    height: 46px;
}

.login-form .form-row {
    gap: 16px;
}

.captcha-row {
    display: flex;
    gap: 12px;
    align-items: center;
}

.captcha-row .form-control {
    flex: 1;
}

.captcha-img {
    width: 180px;
    height: 46px;
    border-radius: 10px;
    border: 1px solid var(--border);
    cursor: pointer;
    object-fit: cover;
    background: #f7f9fc;
    transition: transform .15s;
}

.captcha-img:hover {
    transform: translateY(-1px);
}

.login-btn {
    width: 100%;
    height: 46px;
    font-size: 15px;
    letter-spacing: 3px;
    margin-top: 8px;
    background: var(--gradient-primary);
    border: 0;
    color: #fff;
    box-shadow: 0 10px 22px rgba(79, 110, 247, .32);
    transition: transform .15s, box-shadow .15s, opacity .15s;
}

.login-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 28px rgba(79, 110, 247, .4);
    opacity: .95;
}

.login-btn:active {
    transform: translateY(0);
}

.login-links {
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
    font-size: 13px;
}

.login-links a:hover {
    text-decoration: underline;
}

/* 协议链接（免责声明/用户协议）：使用正常文字颜色，不用主题蓝 */
.login-links .doc-link {
    color: var(--text-sub);
}

.login-links .doc-link:hover {
    color: var(--text);
}

.login-tip {
    margin-top: 20px;
    padding: 12px 16px;
    background: var(--primary-light);
    border-radius: 10px;
    color: #3559a8;
    font-size: 12.5px;
    line-height: 1.8;
    border-left: 3px solid var(--primary);
}

/* ================= 主框架 ================= */
.layout {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

.sidebar {
    width: 220px;
    background: var(--sidebar-bg);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    box-shadow: 2px 0 20px rgba(15, 23, 42, .15);
}

.sidebar-header {
    height: 60px;
    display: flex;
    align-items: center;
    padding: 0 20px;
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 1px;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.sidebar-header .dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--gradient-primary);
    margin-right: 10px;
    box-shadow: 0 0 12px rgba(124, 58, 237, .8);
}

.sidebar-menu {
    flex: 1;
    overflow-y: auto;
    padding: 10px 0 20px;
}

.sidebar-menu::-webkit-scrollbar {
    width: 6px;
}

.sidebar-menu::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, .14);
    border-radius: 3px;
}

.menu-group-title {
    padding: 14px 20px 6px;
    color: #7d8aa4;
    font-size: 12px;
    letter-spacing: 1.5px;
}

.menu-item {
    display: flex;
    align-items: center;
    padding: 11px 20px;
    color: #c3cbd9;
    cursor: pointer;
    font-size: 13.5px;
    border-left: 3px solid transparent;
    transition: background .18s, color .18s, border-color .18s;
    user-select: none;
    position: relative;
}

.menu-item:hover {
    background: var(--sidebar-hover);
    color: #fff;
}

.menu-item.active {
    background: var(--sidebar-hover);
    color: #fff;
    border-left-color: #8b5cf6;
}

.menu-item.active::after {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 18px;
    background: var(--gradient-primary);
    border-radius: 2px 0 0 2px;
}

/* 可折叠菜单分组：默认收起，点击分组标题展开 */
.menu-group-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 13px 20px 11px;
    color: #8b97ad;
    font-size: 12.5px;
    letter-spacing: 1.2px;
    cursor: pointer;
    user-select: none;
    transition: color .18s, background .18s;
}

.menu-group-head:hover {
    background: var(--sidebar-hover);
    color: #fff;
}

.menu-group-arrow {
    font-size: 11px;
    line-height: 1;
    transition: transform .2s ease;
}

.menu-group.open .menu-group-arrow {
    transform: rotate(90deg);
}

.menu-group-body {
    display: none;
}

.menu-group.open .menu-group-body {
    display: block;
}

.menu-group .menu-item {
    padding-left: 34px;
    font-size: 13px;
}

.main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.topbar {
    height: 60px;
    background: #fff;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    flex-shrink: 0;
    box-shadow: 0 1px 8px rgba(15, 23, 42, .04);
}

.topbar-title {
    font-size: 16px;
    font-weight: 600;
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 13px;
    color: var(--text-sub);
}

.avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--gradient-primary);
    color: #fff;
    line-height: 32px;
    text-align: center;
    font-size: 13px;
    font-weight: 600;
}

.content {
    flex: 1;
    overflow: auto;
    padding: 6px 18px 18px;
}

.content iframe {
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
}

/* ================= 顶部页签栏 ================= */
.page-tabs {
    display: flex;
    align-items: flex-end;
    gap: 6px;
    padding: 8px 18px 0;
    background: #fff;
    border-bottom: 1px solid var(--border);
    overflow-x: auto;
    flex-shrink: 0;
}

.page-tab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 14px;
    font-size: 13px;
    color: var(--text-sub);
    background: #f6f8fb;
    border: 1px solid var(--border);
    border-bottom: 0;
    border-radius: 8px 8px 0 0;
    cursor: pointer;
    white-space: nowrap;
    transition: all .15s;
}

.page-tab:hover {
    color: var(--primary);
}

.page-tab.active {
    color: var(--primary);
    background: #fff;
    font-weight: 600;
    box-shadow: 0 -2px 6px rgba(79, 110, 247, .06);
}

.page-tab .tab-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 4px;
    font-size: 14px;
    line-height: 1;
    color: #9aa4b8;
}

.page-tab .tab-close:hover {
    color: #fff;
    background: var(--danger);
}

/* 页签右键菜单 */
.tab-ctx-menu {
    position: fixed;
    z-index: 9999;
    min-width: 132px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    padding: 5px;
}

.ctx-item {
    padding: 7px 12px;
    font-size: 13px;
    color: var(--text);
    border-radius: 6px;
    cursor: pointer;
    white-space: nowrap;
}

.ctx-item:hover {
    background: var(--primary-light);
    color: var(--primary);
}

/* ================= 顶栏分享按钮 ================= */
.share-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.share-btn svg {
    fill: currentColor;
}

/* ================= 分享弹窗 ================= */
.share-channels {
    display: flex;
    gap: 16px;
    padding: 6px 0;
}

.share-channel {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 18px 12px;
    font-size: 13px;
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 12px;
    cursor: pointer;
    transition: transform .18s, box-shadow .18s, border-color .18s;
}

.share-channel:hover {
    border-color: var(--primary);
    box-shadow: 0 8px 20px rgba(79, 110, 247, .16);
    transform: translateY(-2px);
}

.share-channel.loading {
    opacity: .6;
    pointer-events: none;
}

.share-icon {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
}

.share-icon svg {
    width: 26px;
    height: 26px;
    fill: currentColor;
}

.share-icon.wechat {
    background: linear-gradient(135deg, #2fd06f, #07c160);
}

.share-icon.qq {
    background: linear-gradient(135deg, #4ecbff, #12b7f5);
}

.share-result {
    text-align: center;
    padding: 4px 0 0;
}

.share-result .share-link {
    font-family: "SFMono-Regular", Consolas, "Courier New", monospace;
    font-size: 14px;
    color: var(--primary);
    background: var(--primary-light);
    border: 1px dashed var(--primary);
    border-radius: 10px;
    padding: 12px 14px;
    margin: 12px 0 10px;
    user-select: all;
    cursor: copy;
    word-break: break-all;
    text-align: left;
}

.share-code-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 14px;
}

.share-code-label {
    font-size: 12.5px;
    color: var(--text-sub);
}

.share-code-val {
    font-family: "SFMono-Regular", Consolas, "Courier New", monospace;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    background: #f6f8fb;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 3px 10px;
    user-select: all;
}

/* 分享码列表：分享链接列换行展示 */
.share-cell-link {
    display: inline-block;
    word-break: break-all;
    color: var(--primary);
    user-select: all;
}

/* ================= 列表开关按钮 ================= */
.switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    vertical-align: middle;
}

.switch input {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    cursor: pointer;
}

.switch .slider {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #cbd5e1;
    border-radius: 999px;
    transition: background .2s;
    pointer-events: none;
}

.switch .slider::before {
    content: '';
    position: absolute;
    left: 3px;
    top: 3px;
    width: 18px;
    height: 18px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(15, 23, 42, .25);
    transition: transform .2s;
}

.switch input:checked + .slider {
    background: var(--primary);
}

.switch input:checked + .slider::before {
    transform: translateX(20px);
}

.switch.disabled {
    opacity: .55;
}

.switch.disabled input {
    cursor: not-allowed;
}

.share-copy-btn {
    min-width: 140px;
}

.share-result .share-tip {
    color: var(--text-sub);
    font-size: 12.5px;
    line-height: 1.8;
}

/* ================= 通用面板 ================= */
.page {
    padding: 0;
}

.card {
    background: var(--panel);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px 22px;
    margin-bottom: 16px;
    border: 1px solid rgba(230, 233, 240, .6);
}

.card-title {
    font-size: 15px;
    font-weight: 600;
    margin: 0 0 16px;
    padding-left: 12px;
    border-left: 3px solid var(--primary);
    line-height: 1.2;
}

.toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.toolbar-left,
.toolbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.search-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.search-bar .form-control {
    width: 180px;
    height: 36px;
}

/* ================= 按钮 ================= */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    height: 36px;
    padding: 0 16px;
    border: 1px solid var(--border);
    background: #fff;
    color: var(--text);
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    transition: all .16s;
    white-space: nowrap;
    font-family: inherit;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: var(--gradient-primary);
    border: 0;
    color: #fff;
    box-shadow: 0 6px 16px rgba(79, 110, 247, .28);
}

.btn-primary:hover {
    opacity: .93;
    box-shadow: 0 10px 22px rgba(79, 110, 247, .38);
}

.btn-danger {
    background: #fff;
    border-color: #f3c2c2;
    color: var(--danger);
}

.btn-danger:hover {
    background: var(--danger);
    border-color: var(--danger);
    color: #fff;
}

.btn-sm {
    height: 28px;
    padding: 0 10px;
    font-size: 12.5px;
    border-radius: 6px;
}

.btn[disabled] {
    opacity: .55;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.link-btn {
    display: inline-block;
    border: 0;
    background: none;
    color: var(--primary);
    cursor: pointer;
    font-size: 13px;
    padding: 2px 4px;
    font-family: inherit;
}

.link-btn:hover {
    text-decoration: underline;
}

.link-btn.danger {
    color: var(--danger);
}

.link-btn + .link-btn {
    margin-left: 6px;
}

/* ================= 表格 ================= */
.table-wrap {
    width: 100%;
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: #fff;
}

table.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.5px;
}

table.data-table th {
    background: linear-gradient(180deg, #f8fafd, #eef1f8);
    color: #4a566d;
    font-weight: 600;
    text-align: left;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

table.data-table td {
    padding: 12px 14px;
    border-bottom: 1px solid #f0f2f7;
    vertical-align: middle;
}

table.data-table tbody tr:last-child td {
    border-bottom: 0;
}

table.data-table tbody tr {
    transition: background .15s;
}

table.data-table tbody tr:hover {
    background: var(--primary-light);
}

table.data-table td.center,
table.data-table th.center {
    text-align: center;
}

.ellipsis {
    max-width: 320px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
    line-height: 18px;
    font-weight: 500;
}

.badge-on {
    background: #e8f7ee;
    color: var(--success);
}

.badge-off {
    background: #fdeaea;
    color: var(--danger);
}

.empty {
    padding: 48px 0;
    text-align: center;
    color: var(--text-sub);
    font-size: 13px;
}

/* ================= 分页 ================= */
.pagination {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    padding-top: 16px;
    font-size: 13px;
    color: var(--text-sub);
    flex-wrap: wrap;
}

.pagination .page-btn {
    min-width: 32px;
    height: 32px;
    border: 1px solid var(--border);
    background: #fff;
    border-radius: 7px;
    cursor: pointer;
    color: var(--text);
    font-size: 13px;
    transition: all .15s;
}

.pagination .page-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.pagination .page-btn.active {
    background: var(--gradient-primary);
    border-color: transparent;
    color: #fff;
}

.pagination .page-btn[disabled] {
    opacity: .5;
    cursor: not-allowed;
}

/* ================= 表单 ================= */
.form-item {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    margin-bottom: 7px;
    font-size: 13px;
    color: #56617a;
    font-weight: 500;
}

.form-label .req {
    color: var(--danger);
    margin-right: 3px;
}

.form-control {
    width: 100%;
    padding: 0 12px;
    height: 38px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 13.5px;
    color: var(--text);
    background: #fff;
    outline: none;
    transition: border-color .16s, box-shadow .16s;
    font-family: inherit;
}

textarea.form-control {
    height: 80px;
    padding: 9px 12px;
    resize: none;
    line-height: 1.6;
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 110, 247, .15);
}

.form-control[disabled] {
    background: #f5f7fa;
    color: var(--text-sub);
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2 4.5L6 8.5L10 4.5' stroke='%236b7690' stroke-width='1.4' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 12px;
    padding-right: 28px;
}

.form-row {
    display: flex;
    gap: 16px;
}

.form-row > .form-item {
    flex: 1;
    min-width: 0;
}

.form-tip {
    font-size: 12px;
    color: var(--text-sub);
    margin-top: 5px;
}

.checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.checkbox-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    background: #fff;
    user-select: none;
    transition: all .15s;
}

.checkbox-item:hover {
    border-color: #c9d2e4;
}

.checkbox-item input {
    margin: 0;
    accent-color: var(--primary);
}

.checkbox-item.checked {
    border-color: var(--primary);
    background: var(--primary-light);
    color: var(--primary-dark);
}

/* ================= 弹窗 ================= */
.modal-mask {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, .5);
    backdrop-filter: blur(3px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
    animation: fadeIn .18s ease;
}

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

.modal {
    background: #fff;
    border-radius: 14px;
    width: 540px;
    max-width: 100%;
    max-height: 86vh;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-lg);
    animation: modalIn .22s cubic-bezier(.2, .8, .2, 1);
}

@keyframes modalIn {
    from { opacity: 0; transform: translateY(-16px) scale(.97); }
    to { opacity: 1; transform: none; }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 22px;
    border-bottom: 1px solid var(--border);
    font-size: 15px;
    font-weight: 600;
}

.modal-close {
    border: 0;
    background: none;
    font-size: 22px;
    line-height: 1;
    color: #9aa4b8;
    cursor: pointer;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    transition: all .15s;
}

.modal-close:hover {
    color: var(--text);
}

/* 弹窗右上角窗口控制按钮（最大化 / 最小化，如音乐播放器） */
.modal-title {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.modal-tools {
    display: flex;
    align-items: center;
    gap: 2px;
    flex-shrink: 0;
}

.modal-tool {
    border: 0;
    background: none;
    font-size: 15px;
    line-height: 1;
    color: #9aa4b8;
    cursor: pointer;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    transition: all .15s;
}

.modal-tool:hover {
    color: var(--text);
    background: #f1f5f9;
}

/* 最大化：铺满窗口 */
.modal.is-max {
    width: calc(100vw - 40px);
    max-width: calc(100vw - 40px);
    height: calc(100vh - 40px);
    max-height: calc(100vh - 40px);
}

.modal.is-max .modal-body {
    flex: 1;
    min-height: 0;
}

/* 最小化：收起内容，仅保留标题栏悬浮在右下角 */
.modal.is-min {
    position: fixed;
    right: 20px;
    bottom: 20px;
    width: 360px;
    max-width: calc(100vw - 40px);
    max-height: none;
}

.modal.is-min .modal-body,
.modal.is-min .modal-footer {
    display: none;
}

.modal.is-min .modal-header {
    border-bottom: 0;
    cursor: move;
}

/* 最小化后的悬浮窗：遮罩透明且不拦截鼠标，页面其他区域可正常操作 */
.modal-mask.is-min {
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    pointer-events: none;
}

.modal-mask.is-min .modal {
    pointer-events: auto;
    box-shadow: 0 10px 30px rgba(15, 23, 42, .22);
}

.modal-body {
    padding: 20px 22px;
    overflow-y: auto;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 14px 22px 18px;
    border-top: 1px solid var(--border);
}

.modal.wide {
    width: 740px;
}

/* 项目管理新增/编辑/查看弹窗：740 的 2 倍宽、高度约 1.5 倍（82vh），居屏幕中央 */
.modal.project-modal {
    width: min(1480px, 96vw);
    max-height: 96vh;
    min-height: 82vh;
}

.modal.project-modal .modal-body {
    flex: 1;
}

/* 博客新增/编辑弹窗：与项目管理弹窗保持一致的尺寸 */
.modal.blog-form-modal {
    width: min(1480px, 96vw);
    max-height: 96vh;
    min-height: 82vh;
    /* 整体上移 30px */
    transform: translateY(-30px);
    animation: blogModalIn .22s cubic-bezier(.2, .8, .2, 1);
}

@keyframes blogModalIn {
    from { opacity: 0; transform: translateY(-46px) scale(.97); }
    to { opacity: 1; transform: translateY(-30px); }
}

.modal.blog-form-modal.is-max {
    transform: none;
    animation: modalIn .22s cubic-bezier(.2, .8, .2, 1);
}

/* 摘要与封面图同一行，高度对齐 */
.modal.blog-form-modal .blog-meta-row {
    align-items: stretch;
    flex: 0 0 auto;
    margin-bottom: 16px;
}

.modal.blog-form-modal .blog-meta-row > .form-item {
    display: flex;
    flex-direction: column;
    margin-bottom: 0;
}

.modal.blog-form-modal .blog-meta-row textarea.form-control {
    flex: 1;
    height: 100px;
    min-height: 100px;
    resize: none;
}

.modal.blog-form-modal .modal-body {
    flex: 1;
    display: flex;
}

.modal.blog-form-modal .form-body {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.modal.blog-form-modal .form-body .form-item:last-child {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.modal.blog-form-modal .rte {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.modal.blog-form-modal .rte-body {
    flex: 1;
    max-height: none;
}

.modal.blog-form-modal .rte-source {
    flex: 1;
    min-height: 0;
}

/* ================= 树形列表 ================= */
.tree {
    font-size: 13.5px;
}

.tree-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-radius: 8px;
    border-bottom: 1px solid #f0f2f7;
    transition: background .15s;
}

.tree-row:hover {
    background: var(--primary-light);
}

.tree-toggle {
    width: 20px;
    height: 20px;
    line-height: 18px;
    text-align: center;
    border: 1px solid var(--border);
    border-radius: 5px;
    cursor: pointer;
    color: var(--text-sub);
    font-size: 11px;
    background: #fff;
    flex-shrink: 0;
    user-select: none;
    transition: all .15s;
}

.tree-toggle:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.tree-toggle.empty {
    visibility: hidden;
}

.tree-name {
    min-width: 160px;
    font-weight: 500;
}

.tree-actions {
    margin-left: auto;
    display: flex;
    gap: 4px;
}

/* ================= 上传 / 媒体 ================= */
.upload-box {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.upload-name {
    color: var(--text-sub);
    font-size: 12.5px;
    word-break: break-all;
}

.progress {
    height: 6px;
    background: #eceff6;
    border-radius: 4px;
    overflow: hidden;
    margin-top: 8px;
}

.progress > i {
    display: block;
    height: 100%;
    width: 0;
    background: var(--gradient-primary);
    transition: width .2s;
}

.player-box audio,
.player-box video {
    width: 100%;
    border-radius: 10px;
    outline: none;
}

.player-box video {
    max-height: 320px;
    background: #000;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .25);
}

/* 播放窗口内的上一首 / 播放暂停 / 下一首 */
.player-ctrl {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.player-btn {
    min-width: 108px;
    height: 34px;
    padding: 0 16px;
    font-size: 13px;
    color: var(--text);
    background: #f5f7fb;
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    transition: .15s;
}

.player-btn:hover:not(:disabled) {
    color: var(--primary);
    border-color: var(--primary);
    background: var(--primary-light);
}

.player-btn:disabled {
    opacity: .45;
    cursor: not-allowed;
}

.player-btn-main {
    color: #fff;
    background: var(--gradient-primary);
    border-color: transparent;
}

.player-btn-main:hover:not(:disabled) {
    color: #fff;
    filter: brightness(1.06);
}

/* ================= 音乐播放弹窗（宽度为普通弹窗 2 倍） ================= */
.modal.player-modal {
    width: min(1080px, 94vw);
}

/* 播放器最大化时铺满窗口（覆盖 player-modal 的固定宽度） */
.modal.player-modal.is-max {
    width: calc(100vw - 40px);
    max-width: calc(100vw - 40px);
    height: calc(100vh - 40px);
    max-height: calc(100vh - 40px);
}

/* 播放器最小化时收起为右下角标题条（覆盖 player-modal 的固定宽度） */
.modal.player-modal.is-min {
    width: 420px;
    max-width: calc(100vw - 40px);
    height: auto;
    max-height: none;
}

/* 最小化浮窗：当前歌词 + 上一首/暂停/下一首（仅在最小化时显示） */
.player-mini {
    display: none;
}

.modal.player-modal.is-min .player-mini {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 0 16px 16px;
}

.mini-top {
    display: flex;
    align-items: center;
    gap: 8px;
}

.mini-lyric {
    flex: 1;
    min-width: 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--primary);
    line-height: 1.4;
    min-height: 20px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mini-mode {
    flex: none;
    padding: 3px 8px;
    font-size: 12px;
    color: var(--text-sub);
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 6px;
    cursor: pointer;
    transition: color .18s, border-color .18s, background .18s;
}

.mini-mode:hover {
    color: var(--primary);
    border-color: var(--primary);
    background: var(--primary-light);
}

.mini-ctrl {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.mini-btn {
    flex: 1;
    height: 32px;
    padding: 0 10px;
    font-size: 13px;
    color: var(--text);
    background: #f5f7fb;
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    transition: .15s;
}

.mini-btn:hover:not(:disabled) {
    border-color: var(--primary);
    color: var(--primary);
}

.mini-btn:disabled {
    opacity: .45;
    cursor: not-allowed;
}

.mini-main {
    flex: 1.2;
    color: #fff;
    background: var(--gradient-primary);
    border-color: transparent;
}

.mini-main:hover:not(:disabled) {
    color: #fff;
    filter: brightness(1.06);
}

/* 播放器最大化时歌词区自动撑满剩余空间 */
.modal.player-modal.is-max .modal-body {
    display: flex;
    flex-direction: column;
}

.modal.player-modal.is-max .player-wrap {
    flex: 1;
    min-height: 0;
}

.modal.player-modal.is-max .lyric-box {
    flex: 1;
    height: auto;
    min-height: 0;
}

.player-wrap {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.player-info {
    display: flex;
    align-items: baseline;
    gap: 12px;
    flex-wrap: wrap;
}

.player-name {
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.player-sub {
    font-size: 13px;
    color: var(--text-sub);
}

/* 歌词区 */
.lyric-head {
    display: flex;
    align-items: center;
    gap: 10px;
}

.lyric-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
}

.lyric-tip {
    font-size: 12px;
    color: var(--text-sub);
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.lyric-size {
    display: inline-flex;
    gap: 6px;
}

.lyric-size button {
    border: 1px solid var(--border);
    background: #fff;
    color: var(--text-sub);
    font-size: 12px;
    line-height: 1;
    padding: 5px 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: color .18s, border-color .18s, background .18s;
}

.lyric-size button:hover:not(:disabled) {
    color: var(--primary);
    border-color: var(--primary);
    background: var(--primary-light);
}

.lyric-size button:disabled {
    opacity: .4;
    cursor: not-allowed;
}

.lyric-box {
    border: 1px solid var(--border);
    border-radius: 10px;
    background-color: #f8faff;
    /* 歌词背景图：音乐字符（♪♫♬♩）平铺水印 */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cg fill='rgb(79,110,247)' fill-opacity='0.12' font-family='Arial' font-size='36'%3E%3Ctext x='12' y='46'%3E%E2%99%AA%3C/text%3E%3Ctext x='84' y='80' font-size='30'%3E%E2%99%AB%3C/text%3E%3Ctext x='26' y='120' font-size='32'%3E%E2%99%AC%3C/text%3E%3Ctext x='100' y='34' font-size='24'%3E%E2%99%A9%3C/text%3E%3Ctext x='108' y='126' font-size='30'%3E%E2%99%AB%3C/text%3E%3C/g%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 140px 140px;
    padding: 12px 18px;
    height: 260px;
    overflow-y: auto;
    text-align: center;
    scroll-behavior: smooth;
}

.lyric-line {
    margin: 0;
    padding: 6px 0;
    color: var(--text-sub);
    line-height: 1.7;
    transition: color .2s, transform .2s;
}

.lyric-line.lyric-on {
    color: var(--primary);
    font-weight: 600;
    transform: scale(1.04);
}

.lyric-empty {
    text-align: center;
    color: var(--text-sub);
    font-size: 13px;
    padding: 40px 0;
}

/* ================= Toast ================= */
.toast-wrap {
    position: fixed;
    top: 22px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
    pointer-events: none;
}

.toast {
    padding: 10px 20px;
    border-radius: 10px;
    font-size: 13.5px;
    color: #fff;
    background: #2c3446;
    box-shadow: var(--shadow-lg);
    animation: toastIn .22s ease;
    max-width: 460px;
}

.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }
.toast.warning { background: var(--warning); }

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

/* ================= 其它 ================= */
.muted {
    color: var(--text-sub);
}

.mono {
    font-family: Consolas, Monaco, monospace;
    font-size: 12.5px;
}

.text-right {
    text-align: right;
}

/* ================= 权限树（角色分配权限） ================= */
.perm-tree {
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px 16px;
    max-height: 340px;
    overflow: auto;
    background: #fafbff;
}

.perm-group {
    padding: 8px 0 10px;
    border-bottom: 1px dashed var(--border);
}

.perm-group:last-child {
    border-bottom: none;
    padding-bottom: 2px;
}

.perm-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    user-select: none;
}

.perm-label input {
    accent-color: var(--primary);
    cursor: pointer;
    margin: 0;
}

.perm-parent .perm-label {
    font-weight: 600;
    color: var(--text);
}

.perm-children {
    margin: 8px 0 0 22px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.perm-menu {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    flex-wrap: wrap;
}

.perm-menu > .perm-label {
    min-width: 130px;
    color: var(--text);
}

.perm-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 16px;
}

.perm-buttons .perm-label {
    color: var(--text-sub);
    font-size: 13px;
}

/* ================= 项目管理：媒体上传/调序 ================= */
.pm-uploader {
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px;
    background: #fafbff;
}

.pm-add {
    margin-top: 4px;
    border-style: dashed;
    cursor: pointer;
    width: 100%;
    text-align: center;
}

.pm-list:empty + .pm-add {
    margin-top: 0;
}

.pm-empty {
    color: var(--text-sub);
    font-size: 13px;
    text-align: center;
    padding: 14px 0 10px;
}

/* 图片宫格 */
.pm-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 8px;
}

.pm-tile {
    position: relative;
    width: 96px;
    height: 96px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border);
    background: #eef1f8;
}

.pm-tile img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.pm-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    color: var(--primary);
    font-size: 13px;
    font-weight: 600;
}

.pm-order {
    position: absolute;
    left: 4px;
    top: 4px;
    min-width: 18px;
    height: 18px;
    line-height: 18px;
    text-align: center;
    padding: 0 5px;
    border-radius: 9px;
    background: rgba(15, 23, 42, .65);
    color: #fff;
    font-size: 12px;
}

.pm-mask {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    background: rgba(15, 23, 42, .55);
    opacity: 0;
    transition: opacity .15s;
}

.pm-tile:hover .pm-mask {
    opacity: 1;
}

.pm-move {
    display: flex;
    gap: 4px;
}

.pm-arrow, .pm-del {
    width: 24px;
    height: 24px;
    border: none;
    border-radius: 6px;
    background: rgba(255, 255, 255, .92);
    color: #1e293b;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
}

.pm-arrow:hover {
    color: var(--primary);
}

.pm-arrow:disabled {
    opacity: .4;
    cursor: not-allowed;
}

.pm-del {
    color: #e11d48;
    font-size: 16px;
}

.pm-del:hover {
    transform: translateY(-1px);
}

/* 视频行 */
.pm-row {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
}

/* ================= 首页仪表盘 ================= */
.home {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* 侧边菜单-首页 */
.menu-item.menu-home svg {
    width: 15px;
    height: 15px;
    fill: currentColor;
    margin-right: 8px;
    flex-shrink: 0;
}

/* 上部统计卡片 */
.stat-row {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 16px;
}

.stat-card {
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--panel);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 18px 20px;
    transition: transform .2s, box-shadow .2s;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-icon svg {
    width: 24px;
    height: 24px;
    fill: #fff;
}

.stat-icon.p { background: linear-gradient(135deg, #4f6ef7, #7c3aed); }
.stat-icon.v { background: linear-gradient(135deg, #f59e0b, #ef6c4d); }
.stat-icon.m { background: linear-gradient(135deg, #8b5cf6, #d946ef); }
.stat-icon.g { background: linear-gradient(135deg, #10b981, #0ea5e9); }
.stat-icon.u { background: linear-gradient(135deg, #4f6ef7, #22d3ee); }

.stat-info { min-width: 0; }

.stat-num {
    font-size: 26px;
    font-weight: 700;
    color: var(--text);
    line-height: 1.1;
}

.stat-label {
    font-size: 13px;
    color: var(--text-sub);
    margin-top: 4px;
    white-space: nowrap;
}

/* 中部趋势柱状图（最近 12 个月） */
.chart-card { padding: 20px 20px 16px; }

.chart-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.chart-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
}

/* 图例 */
.trend-legend {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 18px;
    margin-bottom: 10px;
}

.legend-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12.5px;
    color: var(--text-sub);
}

.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 3px;
    display: inline-block;
}

.legend-dot.p { background: linear-gradient(135deg, #7c3aed, #4f6ef7); }
.legend-dot.v { background: linear-gradient(135deg, #ef6c4d, #f59e0b); }
.legend-dot.m { background: linear-gradient(135deg, #d946ef, #8b5cf6); }
.legend-dot.g { background: linear-gradient(135deg, #0ea5e9, #10b981); }
.legend-dot.u { background: linear-gradient(135deg, #22d3ee, #4f6ef7); }

.bar-chart {
    display: flex;
    align-items: flex-end;
    justify-content: space-around;
    gap: 6px;
    padding: 4px 4px 0;
    min-height: 226px;
    overflow-x: auto;
    overflow-y: hidden;
}

/* 一个月份一组，组内 5 根柱子（按模块着色） */
.bar-group {
    flex: 1;
    min-width: max-content;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.bar-cols {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 3px;
    height: 200px;
}

.bar-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
    height: 100%;
    min-width: 0;
}

.bar-value {
    font-size: 11px;
    font-weight: 600;
    color: var(--text);
    line-height: 1;
}

.bar-fill {
    width: 12px;
    height: 0;
    flex-shrink: 0;
    border-radius: 5px 5px 2px 2px;
    transition: height .7s cubic-bezier(.25, .8, .35, 1);
}

.bar-fill:hover { filter: brightness(1.08); }

.bar-fill.p { background: linear-gradient(180deg, #7c3aed, #4f6ef7); }
.bar-fill.v { background: linear-gradient(180deg, #ef6c4d, #f59e0b); }
.bar-fill.m { background: linear-gradient(180deg, #d946ef, #8b5cf6); }
.bar-fill.g { background: linear-gradient(180deg, #0ea5e9, #10b981); }
.bar-fill.u { background: linear-gradient(180deg, #22d3ee, #4f6ef7); }

.bar-label {
    font-size: 11px;
    color: var(--text-sub);
    padding-bottom: 2px;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 下部最新5条面板 */
.panel-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.panel { padding: 16px 18px 10px; }

.panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}

.panel-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 8px;
}

.panel-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

.panel-dot.p { background: #4f6ef7; }
.panel-dot.v { background: #ef6c4d; }
.panel-dot.m { background: #8b5cf6; }
.panel-dot.g { background: #10b981; }
.panel-dot.u { background: #22b8ee; }

.panel-more {
    font-size: 13px;
    color: var(--text-sub);
    cursor: pointer;
    user-select: none;
    padding: 2px 4px;
    border-radius: 6px;
    transition: color .18s, background .18s;
}

.panel-more:hover {
    color: var(--primary);
    background: var(--primary-light);
}

.home-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 9px 8px;
    border-radius: 8px;
    border-bottom: 1px dashed var(--border);
    transition: background .15s;
}

.home-row:hover { background: #f6f8ff; }

.home-row:last-child { border-bottom: none; }

.home-row-main {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.home-row-name {
    font-size: 14px;
    color: var(--text);
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.home-row-sub {
    font-size: 12px;
    color: var(--text-sub);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.home-row-side {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.home-row-time {
    font-size: 12px;
    color: var(--text-sub);
}

.home-status {
    font-size: 12px;
    line-height: 1;
    padding: 4px 8px;
    border-radius: 999px;
}

.home-status.on {
    color: #16a34a;
    background: rgba(35, 165, 90, .12);
}

.home-status.off {
    color: #94a3b8;
    background: rgba(148, 163, 184, .16);
}

.home-empty {
    text-align: center;
    color: var(--text-sub);
    font-size: 13px;
    padding: 22px 0;
}

@media (max-width: 1200px) {
    .stat-row { grid-template-columns: repeat(3, 1fr); }
    .panel-grid { grid-template-columns: 1fr; }
    .bar-fill { width: 9px; }
    .bar-cols { gap: 2px; }
    .bar-chart { gap: 4px; }
}

@media (max-width: 720px) {
    .stat-row { grid-template-columns: repeat(2, 1fr); }
}

.pm-vicon {
    width: 30px;
    height: 30px;
    flex: none;
    border-radius: 50%;
    background: var(--gradient-primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
}

.pm-vinfo {
    flex: 1;
    min-width: 0;
}

.pm-vname {
    font-size: 13px;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pm-vsize {
    font-size: 12px;
    color: var(--text-sub);
    margin-top: 2px;
}

.pm-row .pm-move {
    position: static;
    opacity: 1;
    background: none;
}

.pm-row .pm-arrow, .pm-row .pm-del {
    border: 1px solid var(--border);
    background: #fff;
}

/* 列表单元格省略 */
.cell-ellipsis {
    max-width: 260px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-sub);
}

/* 列表封面缩略图 */
.pm-cover {
    position: relative;
    width: 54px;
    height: 40px;
    margin: 0 auto;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid var(--border);
}

.pm-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.pm-count {
    position: absolute;
    right: 0;
    bottom: 0;
    min-width: 18px;
    height: 16px;
    line-height: 16px;
    padding: 0 4px;
    background: rgba(15, 23, 42, .7);
    color: #fff;
    font-size: 11px;
    text-align: center;
    border-top-left-radius: 6px;
}

.pm-count-zero {
    color: var(--text-sub);
}

/* ================= 项目详情弹窗 ================= */
.pd-wrap {
    padding: 2px 4px;
}

.pd-info {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 28px;
    padding: 10px 14px;
    background: #fafbff;
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 13px;
}

.pd-info b {
    color: var(--text-sub);
    font-weight: 500;
    margin-right: 4px;
}

.pd-section {
    margin-top: 16px;
}

.pd-title {
    font-weight: 600;
    margin-bottom: 8px;
    padding-left: 8px;
    border-left: 3px solid var(--primary);
}

.pd-intro {
    line-height: 1.8;
    color: var(--text);
    white-space: pre-wrap;
    word-break: break-all;
    max-height: 180px;
    overflow: auto;
    background: #fafbff;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px 14px;
}

.pd-images {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.pd-images a {
    display: block;
    width: 120px;
    height: 120px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border);
}

.pd-images img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .2s;
}

.pd-images a:hover img {
    transform: scale(1.06);
}

.pd-empty {
    color: var(--text-sub);
    font-size: 13px;
}

.pd-video {
    margin-bottom: 14px;
}

.pd-vname {
    font-size: 13px;
    color: var(--text-sub);
    margin-bottom: 6px;
}

.pd-video video {
    width: 100%;
    max-height: 320px;
    border-radius: 10px;
    background: #000;
}

/* ================= 富文本编辑器 ================= */
.rt-wrap {
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
    transition: border-color .16s, box-shadow .16s;
    width: 100%;
}

.rt-wrap:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 110, 247, .15);
}

.rt-toolbar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 2px;
    padding: 6px 8px;
    border-bottom: 1px solid var(--border);
    background: #f8fafd;
    border-radius: 8px 8px 0 0;
}

.rt-sep {
    width: 1px;
    height: 16px;
    background: var(--border);
    margin: 0 4px;
}

.rt-btn {
    min-width: 26px;
    height: 26px;
    padding: 0 7px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--text);
    font-size: 13px;
    line-height: 26px;
    font-family: inherit;
    cursor: pointer;
    user-select: none;
    transition: background .15s, color .15s;
    position: relative;
}

.rt-btn:hover {
    background: var(--primary-light);
    color: var(--primary);
}

.rt-color input[type=color] {
    position: absolute;
    left: 0;
    bottom: 0;
    width: 0;
    height: 0;
    opacity: 0;
    border: 0;
    padding: 0;
}

.rt-color::after {
    content: '';
    position: absolute;
    left: 7px;
    right: 7px;
    bottom: 4px;
    height: 3px;
    border-radius: 2px;
    background: linear-gradient(135deg, #e14b4b, #e8a33d, #23a55a, #4f6ef7);
}

.rt-editor {
    padding: 10px 12px;
    font-size: 14px;
    line-height: 1.7;
    outline: none;
    word-break: break-word;
    white-space: pre-wrap;
}

.rt-editor.rt-placeholder::before {
    content: attr(data-placeholder);
    color: #a7b0c0;
    pointer-events: none;
}

.rt-editor p {
    margin: .35em 0;
}

.rt-editor h2 {
    margin: .5em 0 .35em;
    font-size: 1.3em;
}

.rt-editor ul, .rt-editor ol {
    margin: .35em 0;
    padding-left: 1.6em;
}

.rt-editor a {
    color: var(--primary);
    text-decoration: underline;
}

.rt-editor img,
.rt-editor video {
    max-width: 100%;
}

/* 插入的视频限制最大高度，避免大分辨率视频撑爆编辑区 */
.rt-editor video {
    display: block;
    max-height: 420px;
    margin: 8px 0;
    border-radius: 8px;
}

/* 富文本内嵌媒体：默认以约 25% 缩略图形式展示，不撑爆编辑区；点击弹窗看原图/原视频 */
.rt-editor .rt-inline-media {
    display: inline-block;
    max-width: 25%;
    max-height: 120px;
    margin: 4px 4px 4px 0;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(15, 23, 42, .08);
    cursor: zoom-in;
    transition: transform .15s, box-shadow .15s;
    vertical-align: middle;
}

.rt-editor .rt-inline-media:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(79, 110, 247, .25);
}

.rt-editor .rt-inline-media.video,
.rt-editor video.rt-inline-media {
    max-width: 30%;
    max-height: 140px;
    cursor: zoom-in;
}

/* 详情中的富文本展示 */
.pd-intro.pd-rich {
    white-space: normal;
    word-break: break-word;
    max-height: 340px;
}

.pd-intro.pd-rich p {
    margin: .35em 0;
}

.pd-intro.pd-rich img,
.pd-intro.pd-rich video {
    max-width: 100%;
}

.pd-intro.pd-rich video {
    max-height: 300px;
    border-radius: 8px;
}

/* 详情页中，富文本内嵌媒体恢复正常预览尺寸（编辑器里是缩略图） */
.pd-intro.pd-rich .rt-inline-media {
    display: block;
    max-width: 100%;
    max-height: none;
    margin: 8px 0;
    border-radius: 8px;
    cursor: zoom-in;
}

.pd-intro.pd-rich img.rt-inline-media {
    border-radius: 8px;
}

.pd-intro.pd-rich video.rt-inline-media {
    max-height: 320px;
    background: #000;
}

/* ============ 密码框眼睛（明文/密文切换） ============ */
.pwd-wrap {
    position: relative;
}

.form-control.has-eye {
    padding-right: 36px;
}

.pwd-eye {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    color: #94a3b8;
    cursor: pointer;
    transition: color .15s;
}

.pwd-eye:hover {
    color: var(--primary);
}

.pwd-eye .eye-off {
    display: none;
}

.pwd-wrap.pwd-on .eye-open {
    display: none;
}

.pwd-wrap.pwd-on .eye-off {
    display: block;
}

/* ============ 协议文档展示页 ============ */
.doc-page {
    min-height: 100vh;
    padding: 32px 16px 60px;
    background: linear-gradient(180deg, #eef2ff 0%, #f8fafc 260px, #f8fafc 100%);
    box-sizing: border-box;
}

.doc-card {
    max-width: 860px;
    margin: 0 auto;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(30, 41, 59, .08);
    padding: 32px 40px 40px;
}

.doc-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.doc-head h1 {
    margin: 0;
    font-size: 22px;
    color: #1e293b;
}

.doc-update {
    font-size: 12.5px;
    color: #94a3b8;
}

.doc-content {
    margin-top: 20px;
    color: #334155;
    line-height: 1.9;
    font-size: 14px;
    word-break: break-word;
}

.doc-content h2 {
    margin: 22px 0 8px;
    font-size: 16px;
    color: #1e293b;
    padding-left: 10px;
    border-left: 3px solid var(--primary);
    line-height: 1.4;
}

.doc-content p {
    margin: 8px 0;
}

.doc-content ul,
.doc-content ol {
    margin: 8px 0;
    padding-left: 22px;
}

.doc-content li {
    margin: 4px 0;
}

.doc-content a {
    color: var(--primary);
}

.doc-empty {
    margin-top: 24px;
    text-align: center;
    color: #94a3b8;
    padding: 40px 0;
}

.pd-intro.pd-rich h2, .pd-intro.pd-rich h3 {
    margin: .5em 0 .35em;
}

.pd-intro.pd-rich ul, .pd-intro.pd-rich ol {
    margin: .35em 0;
    padding-left: 1.6em;
}

.pd-intro.pd-rich a {
    color: var(--primary);
    text-decoration: underline;
}

.pd-intro.pd-rich img {
    max-width: 100%;
    border-radius: 8px;
}

/* ==================== 博客管理 ==================== */
.blog-cover-thumb {
    width: 62px;
    height: 40px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid var(--border);
    vertical-align: middle;
}

.blog-cover-thumb.blog-cover-empty {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #a9b2c4;
    font-size: 12px;
    background: #f7f9fc;
}

.blog-title {
    font-weight: 600;
    color: var(--text);
}

.blog-top {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 6px;
    font-size: 11px;
    color: var(--danger);
    background: #fdecec;
    border-radius: 4px;
    vertical-align: middle;
}

.blog-tag {
    display: inline-block;
    margin: 2px 4px 2px 0;
    padding: 2px 8px;
    font-size: 12px;
    color: var(--primary);
    background: var(--primary-light);
    border-radius: 10px;
    line-height: 18px;
}

/* 封面选择 */
.blog-cover-pick {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px;
}

.blog-cover-preview {
    width: 180px;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px dashed var(--border);
    border-radius: 8px;
    background: #fafbfe;
    color: #a9b2c4;
    font-size: 13px;
    overflow: hidden;
}

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

.blog-cover-ops {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

/* 富文本编辑器 */
.rte {
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
}

.rte-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 6px 8px;
    background: #f7f9fc;
    border-bottom: 1px solid var(--border);
}

.rte-toolbar button {
    min-width: 32px;
    height: 28px;
    padding: 0 8px;
    font-size: 12px;
    color: var(--text);
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 6px;
    cursor: pointer;
    transition: .15s;
}

.rte-toolbar button:hover,
.rte-toolbar button.active {
    color: var(--primary);
    border-color: var(--primary);
    background: var(--primary-light);
}

.rte-body {
    min-height: 340px;
    max-height: 52vh;
    overflow-y: auto;
    padding: 12px 14px;
    outline: none;
    font-size: 14px;
    line-height: 1.9;
    color: var(--text);
}

.rte-body:empty::before {
    content: attr(data-placeholder);
    color: #a9b2c4;
}

.rte-body img {
    max-width: 100%;
    border-radius: 6px;
}

.rte-body h2 {
    font-size: 18px;
    margin: 14px 0 8px;
}

.rte-body blockquote {
    margin: 10px 0;
    padding: 8px 14px;
    border-left: 3px solid var(--border);
    background: #fafbfe;
    color: var(--text-sub);
}

.rte-source {
    min-height: 340px;
    margin: 0;
    border: 0;
    border-radius: 0;
    font-family: Consolas, Monaco, monospace;
    font-size: 13px;
    line-height: 1.6;
    resize: vertical;
}

/* 预览 */
.blog-preview {
    max-width: 820px;
    margin: 0 auto;
    padding: 4px 4px 20px;
}

.blog-preview-cover {
    width: 100%;
    max-height: 320px;
    object-fit: cover;
    border-radius: 10px;
}

.blog-preview h1 {
    margin: 18px 0 10px;
    font-size: 24px;
    line-height: 1.4;
}

.blog-preview-meta {
    color: var(--text-sub);
    font-size: 13px;
    margin-bottom: 14px;
}

.blog-preview-summary {
    margin-bottom: 18px;
    padding: 10px 14px;
    color: var(--text-sub);
    background: #f7f9fc;
    border-left: 3px solid var(--primary);
    border-radius: 0 8px 8px 0;
}

.blog-preview-content {
    font-size: 14px;
    line-height: 1.9;
}

.blog-preview-content img {
    max-width: 100%;
    border-radius: 6px;
}

.blog-preview-content h2 {
    margin: 18px 0 10px;
}

.blog-preview-content blockquote {
    margin: 10px 0;
    padding: 8px 14px;
    border-left: 3px solid var(--border);
    background: #fafbfe;
    color: var(--text-sub);
}

.blog-preview-tags {
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
}

/* 分类管理 */
.cat-manager .cat-form {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.cat-manager .cat-form .form-control {
    flex: 1;
}

.cat-manager .cat-form input[type=number] {
    flex: 0 0 100px;
}

.cat-list {
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
}

.cat-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
}

.cat-row:last-child {
    border-bottom: 0;
}

.cat-row .cat-name {
    flex: 1;
    font-weight: 600;
}

.cat-row .cat-count {
    color: var(--text-sub);
    font-size: 13px;
}

.cat-row .cat-actions {
    display: flex;
    gap: 12px;
}

/* ================= 首页仪表盘（重构版） ================= */
.dash {
    --dash-primary: #4f6ef7;
    --dash-primary-2: #7c3aed;
    --dash-primary-soft: #eef2ff;
    --dash-green: #12a05c;
    --dash-red: #e14b4b;
    --dash-amber: #e8a33d;
    --dash-ink: #101828;
    --dash-ink-2: #475467;
    --dash-ink-3: #98a2b3;
    --dash-line: #e8ebf2;
    --dash-radius: 14px;
    --dash-shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 4px 14px rgba(16, 24, 40, .045);
    display: flex;
    flex-direction: column;
    gap: 14px;
    max-width: 1360px;
    margin: 0 auto;
    font-size: 13px;
    color: var(--dash-ink);
}

.dash .num {
    font-variant-numeric: tabular-nums;
    letter-spacing: -.02em;
}

/* 状态条 */
.dash-status {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    background: #fff;
    border: 1px solid var(--dash-line);
    border-radius: var(--dash-radius);
    padding: 13px 20px;
    box-shadow: var(--dash-shadow);
}

.dash-say {
    display: flex;
    align-items: baseline;
    gap: 10px;
    min-width: 0;
    flex-wrap: wrap;
}

.dash-say h1 {
    margin: 0;
    font-size: 14.5px;
    font-weight: 600;
    letter-spacing: -.01em;
    color: var(--dash-ink);
}

.dash-say span {
    font-size: 12px;
    color: var(--dash-ink-3);
}

.dash-chips {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.dash-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 26px;
    padding: 0 11px;
    border-radius: 7px;
    background: #f7f8fc;
    border: 1px solid #eef0f6;
    font-size: 11.5px;
    color: var(--dash-ink-2);
    white-space: nowrap;
}

.dash-chip b {
    font-weight: 600;
    color: var(--dash-ink);
}

.dash-chip.warn {
    background: #fff6f6;
    border-color: #fbe4e4;
    color: #c53d3d;
}

.dash-chip.warn b {
    color: #c53d3d;
}

.dash-pulse {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--dash-green);
    box-shadow: 0 0 0 3px rgba(18, 160, 92, .15);
    display: inline-block;
}

/* KPI */
.dash-kpis {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
}

.dash-kpi {
    position: relative;
    background: #fff;
    border: 1px solid var(--dash-line);
    border-radius: var(--dash-radius);
    padding: 16px 18px 15px;
    box-shadow: var(--dash-shadow);
    overflow: hidden;
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.dash-kpi:hover {
    transform: translateY(-2px);
    border-color: #d5ddf5;
    box-shadow: 0 2px 4px rgba(16, 24, 40, .04), 0 12px 28px rgba(79, 110, 247, .10);
}

.dash-kpi::after {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, var(--dash-primary), var(--dash-primary-2));
    opacity: 0;
    transition: opacity .18s;
}

.dash-kpi:hover::after {
    opacity: 1;
}

.dash-kpi-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 9px;
}

.dash-kpi-label {
    font-size: 11.5px;
    color: var(--dash-ink-3);
    display: flex;
    align-items: center;
    gap: 6px;
}

.dash-kpi-label em {
    font-style: normal;
    width: 3px;
    height: 11px;
    border-radius: 2px;
    background: var(--dash-primary);
    opacity: .75;
}

.dash-kpi-ico {
    width: 26px;
    height: 26px;
    border-radius: 8px;
    background: var(--dash-primary-soft);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--dash-primary);
}

.dash-kpi-ico svg {
    width: 14px;
    height: 14px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.dash-kpi-val {
    display: flex;
    align-items: flex-end;
    gap: 7px;
}

.dash-kpi-num {
    font-size: 30px;
    line-height: 1;
    font-weight: 600;
    letter-spacing: -.03em;
}

.dash-kpi-unit {
    font-size: 11.5px;
    color: var(--dash-ink-3);
    padding-bottom: 3px;
}

.dash-kpi-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 11px;
    gap: 8px;
}

.dash-trend {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11.5px;
    font-weight: 500;
    min-width: 0;
}

.dash-trend.up {
    color: var(--dash-green);
}

.dash-trend.down {
    color: var(--dash-red);
}

.dash-trend.flat {
    color: var(--dash-ink-3);
    font-weight: 400;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dash-trend svg {
    width: 9px;
    height: 9px;
    fill: currentColor;
    flex-shrink: 0;
}

.dash-trend .muted {
    color: var(--dash-ink-3);
    font-weight: 400;
}

.dash-spark {
    width: 66px;
    height: 26px;
    flex-shrink: 0;
}

/* 通用卡片 */
.dash-card {
    background: #fff;
    border: 1px solid var(--dash-line);
    border-radius: var(--dash-radius);
    box-shadow: var(--dash-shadow);
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.dash-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 15px 18px 0;
    gap: 10px;
}

.dash-card-title {
    font-size: 13px;
    font-weight: 600;
    letter-spacing: -.005em;
    display: flex;
    align-items: center;
    gap: 7px;
    color: var(--dash-ink);
}

.dash-card-title i {
    width: 3px;
    height: 12px;
    border-radius: 2px;
    background: var(--dash-primary);
    opacity: .8;
}

.dash-card-sub {
    font-size: 11px;
    color: var(--dash-ink-3);
    margin-top: 3px;
    padding-left: 10px;
}

.dash-card-note {
    font-size: 10.5px;
    color: var(--dash-ink-3);
    white-space: nowrap;
}

.dash-more {
    font-size: 10.5px;
    color: var(--dash-ink-3);
    cursor: pointer;
    user-select: none;
}

.dash-more:hover {
    color: var(--dash-primary);
}

.dash-card-body {
    padding: 12px 18px 16px;
    flex: 1;
    min-width: 0;
}

/* 分析区 */
.dash-analysis {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 14px;
}

.dash-seg {
    display: inline-flex;
    background: #f5f6fa;
    border-radius: 8px;
    padding: 2px;
    gap: 1px;
}

.dash-seg span {
    padding: 4px 11px;
    border-radius: 6px;
    font-size: 11.5px;
    color: var(--dash-ink-2);
    cursor: pointer;
    transition: .15s;
    white-space: nowrap;
}

.dash-seg span.on {
    background: #fff;
    color: var(--dash-primary);
    font-weight: 600;
    box-shadow: 0 1px 2px rgba(16, 24, 40, .09);
}

.dash-legend {
    display: flex;
    gap: 14px;
    padding: 5px 0 0 10px;
    flex-wrap: wrap;
}

.dash-lg {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: var(--dash-ink-3);
    cursor: pointer;
    user-select: none;
    transition: opacity .15s;
}

.dash-lg i {
    width: 11px;
    height: 2.5px;
    border-radius: 2px;
    display: inline-block;
}

.dash-lg.off {
    opacity: .3;
}

.dash-chart {
    width: 100%;
    height: 186px;
    display: block;
}

/* 资产构成 */
.dash-donut-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 2px;
}

.dash-donut {
    position: relative;
    width: 126px;
    height: 126px;
}

.dash-donut-center {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
}

.dash-donut-center b {
    font-size: 20px;
    font-weight: 600;
    letter-spacing: -.03em;
    color: var(--dash-ink);
}

.dash-donut-center span {
    font-size: 10.5px;
    color: var(--dash-ink-3);
}

.dash-donut svg {
    transform: rotate(-90deg);
}

.dash-legend-list {
    width: 100%;
    margin-top: 11px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.dash-legend-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11.5px;
    color: var(--dash-ink-2);
}

.dash-legend-row b {
    margin-left: auto;
    font-weight: 600;
    color: var(--dash-ink);
}

.dash-legend-row .pct {
    color: var(--dash-ink-3);
    width: 36px;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.dash-sw {
    width: 7px;
    height: 7px;
    border-radius: 2px;
    flex-shrink: 0;
}

/* 三栏 */
.dash-cols {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}

/* 排行榜 */
.dash-rank {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.dash-rank-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 6px;
    border-radius: 8px;
    transition: .15s;
}

.dash-rank-item:hover {
    background: #f8f9fd;
}

.dash-rank-no {
    width: 17px;
    height: 17px;
    border-radius: 5px;
    background: #f1f3f9;
    color: var(--dash-ink-3);
    font-size: 10.5px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.dash-rank-item:nth-child(1) .dash-rank-no {
    background: linear-gradient(135deg, #4f6ef7, #7c3aed);
    color: #fff;
}

.dash-rank-item:nth-child(2) .dash-rank-no {
    background: #e8ecfa;
    color: #4f6ef7;
}

.dash-rank-item:nth-child(3) .dash-rank-no {
    background: #eef0f8;
    color: #6b7690;
}

.dash-rank-main {
    flex: 1;
    min-width: 0;
}

.dash-rank-name {
    font-size: 12px;
    color: var(--dash-ink);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 5px;
}

.dash-rank-sub {
    font-size: 10px;
    color: var(--dash-ink-3);
    margin-left: 5px;
}

.dash-rank-bar {
    height: 3px;
    border-radius: 2px;
    background: #f0f2f8;
    overflow: hidden;
}

.dash-rank-bar i {
    display: block;
    height: 100%;
    border-radius: 2px;
    width: 0;
    transition: width .8s cubic-bezier(.2, .8, .2, 1);
}

.dash-rank-bar i.music {
    background: linear-gradient(90deg, #a78bfa, #7c3aed);
}

.dash-rank-bar i.video {
    background: linear-gradient(90deg, #8ba3fb, #4f6ef7);
}

.dash-rank-val {
    font-size: 11.5px;
    color: var(--dash-ink-2);
    font-variant-numeric: tabular-nums;
    flex-shrink: 0;
    padding-left: 2px;
}

/* 最新动态 */
.dash-feed {
    display: flex;
    flex-direction: column;
    position: relative;
    padding-left: 2px;
}

.dash-feed-item {
    display: flex;
    gap: 10px;
    padding: 7px 4px;
    position: relative;
}

.dash-feed-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    margin-top: 5px;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
    box-shadow: 0 0 0 3px #fff;
}

.dash-feed-item:not(:last-child)::before {
    content: "";
    position: absolute;
    left: 7px;
    top: 19px;
    bottom: -4px;
    width: 1px;
    background: #eef0f6;
}

.dash-feed-main {
    min-width: 0;
    flex: 1;
}

.dash-feed-text {
    font-size: 12px;
    color: var(--dash-ink-2);
    line-height: 1.5;
    word-break: break-word;
}

.dash-feed-text b {
    color: var(--dash-ink);
    font-weight: 500;
}

.dash-feed-time {
    font-size: 10.5px;
    color: var(--dash-ink-3);
    margin-top: 2px;
}

.dash-empty {
    text-align: center;
    color: var(--dash-ink-3);
    font-size: 12px;
    padding: 22px 0;
}

@media (max-width: 1200px) {
    .dash-kpis {
        grid-template-columns: repeat(2, 1fr);
    }

    .dash-analysis {
        grid-template-columns: 1fr;
    }

    .dash-cols {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 720px) {
    .dash-kpis {
        grid-template-columns: 1fr;
    }

    .dash-status {
        align-items: flex-start;
        flex-direction: column;
    }
}

/* ================= 右下角客服悬浮入口 ================= */
.cs-fab {
    position: fixed;
    left: 0;
    top: 0;
    z-index: 9998;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    will-change: transform;
}

.cs-avatar {
    width: 54px;
    height: 54px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    border-radius: 50%;
    color: #fff;
    cursor: pointer;
    background: linear-gradient(135deg, #4f6ef7 0%, #7c3aed 100%);
    box-shadow: 0 12px 26px -8px rgba(79, 110, 247, .65), 0 0 0 6px rgba(79, 110, 247, .12);
    transition: transform .18s ease, box-shadow .18s ease;
}

.cs-avatar svg {
    width: 26px;
    height: 26px;
    fill: none;
    stroke: #fff;
    stroke-width: 1.8;
    stroke-linecap: round;
}

.cs-fab:hover .cs-avatar,
.cs-fab:focus-within .cs-avatar {
    transform: translateY(-2px) scale(1.06);
    box-shadow: 0 16px 32px -8px rgba(79, 110, 247, .75), 0 0 0 6px rgba(79, 110, 247, .16);
}

.cs-card {
    position: absolute;
    right: 0;
    bottom: 66px;
    width: 240px;
    padding: 14px;
    border: 1px solid #e9edf6;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 20px 46px -16px rgba(15, 23, 42, .35);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px) scale(.97);
    transform-origin: bottom right;
    transition: opacity .2s ease, transform .2s ease, visibility .2s;
}

.cs-card::after {
    content: "";
    position: absolute;
    right: 22px;
    bottom: -6px;
    width: 12px;
    height: 12px;
    background: #fff;
    border-right: 1px solid #e9edf6;
    border-bottom: 1px solid #e9edf6;
    transform: rotate(45deg);
}

.cs-fab:hover .cs-card,
.cs-fab:focus-within .cs-card {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.cs-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13.5px;
    font-weight: 600;
    color: #141a26;
}

.cs-title i {
    width: 4px;
    height: 13px;
    border-radius: 2px;
    background: linear-gradient(180deg, #4f6ef7, #7c3aed);
}

.cs-phone {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    padding: 8px 10px;
    border-radius: 10px;
    background: #f3f6fe;
    font-size: 11px;
    color: #6b7690;
}

.cs-phone b {
    font-size: 14px;
    font-weight: 700;
    color: #3b54d8;
    letter-spacing: .5px;
    font-variant-numeric: tabular-nums;
}

.cs-qrs {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.cs-qrs figure {
    flex: 1;
    margin: 0;
    padding: 6px;
    border: 1px solid #e9edf6;
    border-radius: 10px;
    background: #fff;
    text-align: center;
}

.cs-qrs img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 6px;
}

.cs-qrs figcaption {
    margin-top: 4px;
    font-size: 11px;
    color: #6b7690;
}

@media (max-width: 720px) {
    .cs-avatar {
        width: 46px;
        height: 46px;
    }
}

/* ================= 多设备 / 多分辨率适配 ================= */
/* 统一文本缩放基准，避免 iPadOS 自动放大小字号 */
html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    -webkit-tap-highlight-color: transparent;
}

/* iPad / iOS Safari：使用动态视口高度，避免底部工具栏把布局顶出屏幕 */
.layout {
    height: 100vh;
    height: 100dvh;
}

/* 1920 × 1080 等大屏：侧栏与内容留白略放大，视觉更舒展 */
@media (min-width: 1680px) {
    .sidebar {
        width: 236px;
    }

    .content {
        padding: 6px 24px 22px;
    }

    .page-tabs {
        padding: 8px 24px 0;
    }

    .topbar {
        padding: 0 28px;
    }
}

/* 1440 × 1080 / 1360 × 768 笔记本：侧栏与左右留白收紧，给内容更多宽度 */
@media (max-width: 1440px) {
    .sidebar {
        width: 204px;
    }

    .sidebar-header {
        font-size: 14px;
        letter-spacing: .5px;
    }

    .content {
        padding: 6px 14px 14px;
    }

    .page-tabs {
        padding: 8px 14px 0;
    }
}

/* 小高度屏幕（1360 × 768、1024 × 768）：压缩纵向留白 */
@media (max-height: 820px) {
    .topbar,
    .sidebar-header {
        height: 54px;
    }

    .modal.project-modal,
    .modal.blog-form-modal {
        min-height: 74vh;
    }

    .login-page {
        padding: 18px;
    }

    .login-card {
        padding: 30px 34px 26px;
    }
}

/* 1024 × 768 及以下：侧栏收窄、表格与表单紧凑排布 */
@media (max-width: 1100px) {
    .sidebar {
        width: 180px;
    }

    .sidebar-header {
        font-size: 13px;
        letter-spacing: 0;
        padding: 0 12px;
    }

    .menu-item {
        padding: 10px 14px;
        font-size: 13px;
    }

    .menu-group-head {
        padding: 12px 14px 10px;
    }

    .menu-group .menu-item {
        padding-left: 26px;
    }

    .topbar {
        padding: 0 14px;
    }

    .topbar-title {
        font-size: 15px;
    }

    .content {
        padding: 6px 12px 12px;
    }

    .page-tabs {
        padding: 6px 12px 0;
    }

    .form-row {
        flex-wrap: wrap;
    }

    .form-row > .form-item {
        min-width: 150px;
    }

    table.data-table th,
    table.data-table td {
        padding: 9px 10px;
    }

    .modal-mask {
        padding: 12px;
    }

    .modal.wide,
    .modal.project-modal,
    .modal.blog-form-modal {
        width: min(100%, 96vw);
    }
}

/* iPad 竖屏 / 窄窗口：侧栏最窄，顶栏只保留头像与操作按钮 */
@media (max-width: 900px) {
    .sidebar {
        width: 150px;
    }

    .sidebar-header {
        font-size: 12px;
        padding: 0 8px;
        letter-spacing: 0;
    }

    .menu-item {
        font-size: 12.5px;
        padding: 9px 10px;
    }

    .menu-group-head {
        font-size: 11.5px;
        padding: 10px 10px 8px;
    }

    .menu-group .menu-item {
        padding-left: 20px;
    }

    .topbar-user {
        gap: 8px;
    }

    #userInfo {
        display: none;
    }

    .share-btn span {
        display: none;
    }

    .share-btn {
        padding: 0 9px;
    }

    .content {
        padding: 6px 10px 10px;
    }

    .page-tabs {
        padding: 6px 10px 0;
        gap: 4px;
    }

    .page-tab {
        padding: 6px 10px;
        font-size: 12.5px;
    }

    .modal.blog-form-modal {
        transform: none;
        animation: modalIn .22s cubic-bezier(.2, .8, .2, 1);
    }

    .login-card {
        padding: 24px 20px 20px;
    }

    .cs-card {
        width: min(260px, calc(100vw - 32px));
    }
}

/* ================= 媒体备注（病例本图片/视频单条备注） ================= */
/* 横向布局：图片/视频在左，备注在右，共占一行 */
.pm-cell {
    width: 100%;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 8px;
    background: #fafbff;
    border: 1px solid var(--border);
    border-radius: 10px;
    margin-bottom: 8px;
}

.pm-cell .pm-tile {
    flex: 0 0 120px;
    width: 120px;
    height: 90px;
}

.pm-row-wrap {
    width: 100%;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 8px;
    background: #fafbff;
    border: 1px solid var(--border);
    border-radius: 10px;
    margin-bottom: 8px;
}

.pm-row-wrap .pm-row {
    flex: 1 1 auto;
    min-width: 0;
}

.pm-remark {
    flex: 1 1 50%;
    min-width: 160px;
    margin-top: 0;
    padding: 6px 9px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 12.5px;
    color: var(--text);
    background: #fff;
    outline: none;
    box-sizing: border-box;
    resize: none;
    height: 90px;
}

.pm-remark:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(79, 110, 247, .12);
}

.pm-remark:disabled {
    background: #f5f7fc;
    color: var(--text-sub);
    cursor: default;
}

/* 查看模式下的视频链接样式 */
.pm-vlink {
    color: var(--primary);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    display: inline-block;
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pm-vlink:hover {
    text-decoration: underline;
}

/* 富文本源码按钮激活态 */
.rt-toolbar .rt-btn.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

/* ================= 病例图片分组上传 ================= */
/* 紧跟「图片」标签的新增分组按钮 */
.pig-add-btn {
    margin-left: 10px;
    padding: 3px 10px;
    font-size: 12px;
    font-weight: 400;
    color: var(--primary);
    background: var(--primary-light);
    border: 1px dashed var(--primary);
    border-radius: 8px;
    cursor: pointer;
    vertical-align: middle;
    transition: background .15s, color .15s;
}

.pig-add-btn:hover {
    color: #fff;
    background: var(--primary);
}

.pig-box {
    width: 100%;
}

.pig-group {
    padding: 10px 12px;
    margin-bottom: 10px;
    background: #fafbff;
    border: 1px solid var(--border);
    border-radius: 10px;
}

.pig-head {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 9px;
}

.pig-idx {
    flex: 0 0 auto;
    padding: 2px 8px;
    font-size: 12px;
    color: var(--primary);
    background: var(--primary-light);
    border-radius: 6px;
}

.pig-name {
    flex: 1 1 auto;
    min-width: 0;
    height: 32px;
    padding: 0 10px;
    font-size: 13px;
    color: var(--text);
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 8px;
    outline: none;
    box-sizing: border-box;
}

.pig-name:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(79, 110, 247, .12);
}

.pig-name-text {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 13px;
    color: var(--text);
    word-break: break-word;
}

.pig-op {
    flex: 0 0 auto;
    width: 24px;
    height: 24px;
    padding: 0;
    font-size: 14px;
    line-height: 1;
    color: var(--text-sub);
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 6px;
    cursor: pointer;
}

.pig-op:hover {
    color: #fff;
    background: var(--danger);
    border-color: var(--danger);
}

.pig-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.pig-tile {
    position: relative;
    width: 110px;
    height: 82px;
    overflow: hidden;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 8px;
}

.pig-tile img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 视频格子更大一些，避免控件过于拥挤 */
.pig-tile-video {
    width: 190px;
    height: 118px;
}

.pig-tile video {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #000;
}

.pig-del {
    position: absolute;
    top: 3px;
    right: 3px;
    width: 18px;
    height: 18px;
    padding: 0;
    font-size: 12px;
    line-height: 1;
    color: #fff;
    background: rgba(15, 23, 42, .65);
    border: 0;
    border-radius: 4px;
    cursor: pointer;
}

.pig-del:hover {
    background: var(--danger);
}

.pig-add-img {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    width: 110px;
    height: 82px;
    font-size: 11px;
    color: var(--text-sub);
    background: #fff;
    border: 1px dashed var(--border);
    border-radius: 8px;
    cursor: pointer;
    transition: border-color .15s, color .15s;
}

.pig-add-img:hover {
    color: var(--primary);
    border-color: var(--primary);
}

.pig-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    font-size: 12px;
    color: var(--text-sub);
    background: #f5f7fc;
}

.pig-empty {
    padding: 10px 12px;
    font-size: 12.5px;
    color: var(--text-sub);
    background: #fff;
    border: 1px dashed var(--border);
    border-radius: 8px;
}

.pd-media-cell {
    width: 150px;
}

.pd-media-cell a {
    display: block;
    width: 150px;
    height: 120px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border);
}

.pd-media-cell img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .2s;
}

.pd-media-cell a:hover img {
    transform: scale(1.06);
}

.pd-media-remark {
    margin-top: 6px;
    font-size: 12.5px;
    color: var(--text-sub);
    line-height: 1.5;
    word-break: break-all;
}

.pd-video-remark {
    font-size: 13px;
    color: var(--text);
    margin-bottom: 6px;
    padding: 6px 10px;
    background: #fafbff;
    border: 1px solid var(--border);
    border-radius: 8px;
}

/* ================= 全站页脚（备案号 / 版本 / 浏览器建议） ================= */
/* 固定在窗口底部，不随页面内容滚动 */
.site-footer {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 30;
    padding: 8px 16px;
    text-align: center;
    font-size: 12px;
    line-height: 1.9;
    color: #8b93a7;
    background: rgba(255, 255, 255, .95);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    border-top: 1px solid var(--border);
}

/* 固定页脚占位，避免遮挡页面底部内容 */
body.has-site-footer {
    padding-bottom: 48px;
}

.site-footer-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
}

.site-footer a {
    color: inherit;
}

.site-footer a:hover {
    color: var(--primary);
    text-decoration: underline;
}

.site-footer .sf-sep {
    margin: 0 8px;
    color: #ccd2de;
}

/* 主框架内页脚：作为 .main 的最后一个子元素固定在窗口底部 */
.site-footer.site-footer-shell {
    position: static;
    flex: 0 0 auto;
    padding: 8px 16px;
    background: #fff;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
}

/* 登录页：深色背景，页脚透明覆盖 */
.site-footer.site-footer-fixed {
    background: transparent;
    border-top: 0;
    color: rgba(255, 255, 255, .62);
}

.site-footer.site-footer-fixed a:hover {
    color: #fff;
}

