/* ============ Apple 毛玻璃 / ColorOS 轻桌面 ============ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC",
        "HarmonyOS Sans SC", "Segoe UI", Roboto, sans-serif;
    line-height: 1.6;
    min-height: 100vh;
    color: var(--text-color);
    background: var(--bg-color);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

/* ---- 极光流动背景 ---- */
body::before {
    content: "";
    position: fixed;
    inset: -10%;
    z-index: -1;
    background:
        radial-gradient(circle at 15% 20%, var(--blob-1), transparent 45%),
        radial-gradient(circle at 85% 15%, var(--blob-2), transparent 42%),
        radial-gradient(circle at 75% 85%, var(--blob-3), transparent 45%),
        radial-gradient(circle at 20% 90%, var(--blob-2), transparent 40%);
    filter: blur(70px) saturate(160%);
    animation: aurora 20s ease-in-out infinite alternate;
}

@keyframes aurora {
    0% {
        transform: translate3d(0, 0, 0) scale(1);
    }

    50% {
        transform: translate3d(-2%, 2%, 0) scale(1.06);
    }

    100% {
        transform: translate3d(2%, -2%, 0) scale(1);
    }
}

/* ---- 滚动条 ---- */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-thumb {
    background: var(--scrollbar);
    border-radius: 4px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

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

img {
    max-width: 100%;
    height: auto;
}

.container {
    max-width: 1080px;
    margin: 0 auto;
    padding: 24px;
}

/* ============ 头部 ============ */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 4px;
    margin-bottom: 20px;
}

.header h1 {
    font-size: 2.1rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.header h1 .grad,
.header h1 {
    background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
    -webkit-background-clip: text;
    background-clip: text;
}

.header-actions {
    display: flex;
    gap: 10px;
}

/* ============ 按钮 ============ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 22px;
    border-radius: 999px;
    border: 1px solid transparent;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    transition: all .25s cubic-bezier(.4, 0, .2, 1);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    white-space: nowrap;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
    color: #fff;
    box-shadow: 0 4px 18px var(--glow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 26px var(--glow);
    filter: brightness(1.06);
}

.btn-outline {
    background: var(--glass-bg);
    border-color: var(--glass-border);
    color: var(--text-color);
    box-shadow: var(--glass-shadow);
}

.btn-outline:hover {
    transform: translateY(-2px);
    background: var(--glass-bg-hover);
}

.btn-danger {
    background: linear-gradient(135deg, #ff3b30, #ff9500);
    color: #fff;
    box-shadow: 0 4px 14px rgba(255, 59, 48, .35);
}

.btn-sm {
    padding: 5px 14px;
    font-size: 12px;
}

.btn-lg {
    padding: 14px 32px;
    font-size: 16px;
}

.btn-block {
    width: 100%;
}

/* ============ 工具栏（悬浮玻璃条） ============ */
.toolbar {
    position: sticky;
    top: 14px;
    z-index: 50;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px;
    margin-bottom: 28px;
    padding: 14px 22px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 22px;
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    box-shadow: var(--glass-shadow);
}

.filter-form {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
}

.filter-form input[type="date"],
.search-form input,
.form-group input[type="text"],
.form-group input[type="date"],
.form-group input[type="password"],
.form-group textarea,
.form-group select {
    padding: 9px 14px;
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    background: var(--input-bg);
    color: var(--text-color);
    font-size: 14px;
    font-family: inherit;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: all .2s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus,
.search-form input:focus {
    outline: none;
    border-color: var(--accent-1);
    box-shadow: 0 0 0 4px var(--focus-ring);
}

.theme-switcher {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 500;
}

.theme-btn {
    padding: 6px 16px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 500;
    border: 1px solid var(--glass-border);
    background: var(--input-bg);
    transition: all .25s;
}

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

.theme-btn.active {
    background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
    color: #fff;
    border-color: transparent;
    box-shadow: 0 4px 14px var(--glow);
}

/* ============ 笔记卡片 ============ */
.notes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
    gap: 22px;
}

.note-card {
    position: relative;
    overflow: hidden;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 26px;
    padding: 26px;
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    box-shadow: var(--glass-shadow);
    transition: transform .35s cubic-bezier(.4, 0, .2, 1), box-shadow .35s;
    animation: fadeUp .55s ease both;
}

.note-card:nth-child(2) {
    animation-delay: .06s;
}

.note-card:nth-child(3) {
    animation-delay: .12s;
}

.note-card:nth-child(4) {
    animation-delay: .18s;
}

.note-card:nth-child(5) {
    animation-delay: .24s;
}

.note-card:nth-child(6) {
    animation-delay: .30s;
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(18px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 卡片顶部高光 */
.note-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(120deg, var(--sheen), transparent 45%);
    pointer-events: none;
}

.note-card:hover {
    transform: translateY(-6px) scale(1.012);
    box-shadow: var(--glass-shadow-hover);
}

.note-card.pinned {
    border-color: var(--accent-1);
}

.pin-badge {
    position: absolute;
    top: 14px;
    right: 14px;
    font-size: 11px;
    font-weight: 600;
    background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
    color: #fff;
    padding: 3px 12px;
    border-radius: 999px;
    box-shadow: 0 3px 10px var(--glow);
}

.note-date {
    display: inline-flex;
    align-items: center;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
    background: var(--chip-bg);
    padding: 4px 12px;
    border-radius: 999px;
    margin-bottom: 12px;
}

.note-title {
    font-size: 1.18rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    margin-bottom: 10px;
}

.note-title a {
    transition: color .2s;
}

.note-title a:hover {
    color: var(--accent-1);
}

.note-excerpt {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.65;
    margin-bottom: 14px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.note-images-preview {
    display: flex;
    gap: 8px;
    align-items: center;
}

.note-images-preview .thumb {
    width: 52px;
    height: 52px;
    object-fit: cover;
    border-radius: 14px;
    border: 1px solid var(--glass-border);
}

.more-images {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 600;
}

/* ============ 空状态 ============ */
.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 80px 24px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 28px;
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
}

.empty-state p {
    font-size: 1.25rem;
    margin-bottom: 18px;
    color: var(--text-muted);
}

/* ============ 笔记详情 ============ */
.note-detail {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 30px;
    padding: 40px;
    backdrop-filter: blur(28px) saturate(180%);
    -webkit-backdrop-filter: blur(28px) saturate(180%);
    box-shadow: var(--glass-shadow);
    animation: fadeUp .5s ease both;
}

.note-meta {
    display: flex;
    gap: 18px;
    margin-bottom: 16px;
    font-size: 13px;
    color: var(--text-muted);
}

.note-detail .note-title {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 22px;
}

.note-content {
    font-size: 16px;
    line-height: 1.95;
    white-space: pre-wrap;
}

.note-images {
    margin-top: 34px;
    padding-top: 24px;
    border-top: 1px solid var(--glass-border);
}

.images-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 14px;
    margin-top: 16px;
}

.image-item img {
    width: 100%;
    height: 190px;
    object-fit: cover;
    border-radius: 18px;
    border: 1px solid var(--glass-border);
    transition: transform .3s;
}

.image-item:hover img {
    transform: scale(1.03);
}

/* ============ 表单 ============ */
.note-form,
.settings-form {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 28px;
    padding: 34px;
    backdrop-filter: blur(26px) saturate(180%);
    -webkit-backdrop-filter: blur(26px) saturate(180%);
    box-shadow: var(--glass-shadow);
    animation: fadeUp .5s ease both;
}

.form-group {
    margin-bottom: 22px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 14px;
}

.form-group input[type="text"],
.form-group input[type="date"],
.form-group input[type="password"],
.form-group textarea,
.form-group select {
    width: 100%;
}

.form-group textarea {
    resize: vertical;
    min-height: 220px;
    line-height: 1.8;
}

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

.form-row .form-group {
    flex: 1;
}

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

/* ============ 上传区 ============ */
.upload-area {
    border: 2px dashed var(--glass-border);
    border-radius: 20px;
    padding: 36px;
    text-align: center;
    cursor: pointer;
    color: var(--text-muted);
    background: var(--input-bg);
    transition: all .25s;
}

.upload-area:hover,
.upload-area.dragover {
    border-color: var(--accent-1);
    background: var(--focus-ring);
    transform: scale(1.01);
}

.image-previews {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 14px;
}

.preview-item {
    position: relative;
    width: 104px;
    height: 104px;
}

.preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 16px;
    border: 1px solid var(--glass-border);
}

.preview-item .remove-img {
    position: absolute;
    top: -7px;
    right: -7px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ff3b30, #ff9500);
    color: #fff;
    border: none;
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 3px 8px rgba(255, 59, 48, .4);
}

/* ============ 分页 ============ */
.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 34px;
}

.page-link {
    padding: 8px 16px;
    border-radius: 999px;
    border: 1px solid var(--glass-border);
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    font-size: 14px;
    font-weight: 500;
    transition: all .2s;
}

.page-link:hover {
    transform: translateY(-2px);
}

.page-link.active {
    background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
    color: #fff;
    border-color: transparent;
    box-shadow: 0 4px 14px var(--glow);
}

/* ============ 提示 ============ */
.alert {
    padding: 14px 18px;
    border-radius: 16px;
    margin-bottom: 20px;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    font-size: 14px;
}

.alert-error {
    background: rgba(255, 59, 48, .12);
    color: #d70015;
    border: 1px solid rgba(255, 59, 48, .3);
}

.alert-success {
    background: rgba(52, 199, 89, .14);
    color: #1d7a3d;
    border: 1px solid rgba(52, 199, 89, .35);
}

/* ============ 登录页 ============ */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 24px;
}

.login-box {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    padding: 44px;
    border-radius: 30px;
    width: 100%;
    max-width: 420px;
    backdrop-filter: blur(30px) saturate(180%);
    -webkit-backdrop-filter: blur(30px) saturate(180%);
    box-shadow: var(--glass-shadow-hover);
    animation: fadeUp .5s ease both;
}

.login-box h2 {
    text-align: center;
    margin-bottom: 28px;
    font-weight: 800;
    letter-spacing: -0.01em;
}

.login-footer {
    text-align: center;
    margin-top: 22px;
    font-size: 14px;
}

.login-footer a {
    color: var(--accent-1);
    font-weight: 600;
}

/* ============ 后台 ============ */
.admin-layout {
    display: flex;
    min-height: 100vh;
}

.admin-sidebar {
    width: 230px;
    padding: 24px 16px;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    background: var(--glass-bg);
    border-right: 1px solid var(--glass-border);
    backdrop-filter: blur(28px) saturate(180%);
    -webkit-backdrop-filter: blur(28px) saturate(180%);
}

.admin-sidebar h2 {
    font-size: 1.05rem;
    margin-bottom: 26px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--glass-border);
}

.admin-sidebar nav a {
    display: block;
    padding: 11px 16px;
    margin-bottom: 6px;
    border-radius: 14px;
    font-size: 14px;
    font-weight: 500;
    transition: all .2s;
}

.admin-sidebar nav a:hover {
    background: var(--chip-bg);
}

.admin-sidebar nav a.active {
    background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
    color: #fff;
    box-shadow: 0 4px 14px var(--glow);
}

.admin-main {
    flex: 1;
    margin-left: 230px;
    padding: 34px;
}

.admin-main h1 {
    margin-bottom: 26px;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.admin-main h2 {
    margin: 26px 0 14px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    padding: 28px;
    border-radius: 24px;
    text-align: center;
    backdrop-filter: blur(22px);
    -webkit-backdrop-filter: blur(22px);
    box-shadow: var(--glass-shadow);
}

.stat-number {
    font-size: 2.6rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.stat-label {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 6px;
    font-weight: 500;
}

.admin-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    overflow: hidden;
    backdrop-filter: blur(22px);
    -webkit-backdrop-filter: blur(22px);
}

.admin-table th,
.admin-table td {
    padding: 13px 16px;
    text-align: left;
    border-bottom: 1px solid var(--glass-border);
    font-size: 14px;
}

.admin-table th {
    background: var(--chip-bg);
    font-weight: 700;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.admin-table tr:last-child td {
    border-bottom: none;
}

.admin-table tbody tr {
    transition: background .2s;
}

.admin-table tbody tr:hover {
    background: var(--chip-bg);
}

.search-form {
    display: flex;
    gap: 10px;
    margin-bottom: 22px;
}

.search-form input {
    flex: 1;
    max-width: 320px;
}

/* ============ 响应式 ============ */
@media (max-width: 768px) {
    .notes-grid {
        grid-template-columns: 1fr;
    }

    .toolbar {
        position: static;
        flex-direction: column;
        align-items: stretch;
    }

    .form-row {
        flex-direction: column;
        gap: 0;
    }

    .admin-sidebar {
        display: none;
    }

    .admin-main {
        margin-left: 0;
        padding: 20px;
    }

    .header {
        flex-direction: column;
        gap: 12px;
    }

    .note-detail,
    .note-form {
        padding: 24px;
    }
}

/* ============ v2：单列 + 60/40 + 分类 + 代码编辑器 ============ */
.cat-tabs {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 20px;
    width: 85%;
}

.cat-tab {
    padding: 10px 24px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 600;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    transition: all .25s;
}

.cat-tab:hover {
    transform: translateY(-2px);
}

.cat-tab.active {
    background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
    color: #fff;
    border-color: transparent;
    box-shadow: 0 4px 16px var(--glow);
}

.count-chip {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 600;
}

/* 单列列表 */
.notes-list {
    display: flex;
    flex-direction: column;
    gap: 22px;
}

/* 卡片 60/40 */
.note-card {
    display: flex;
    overflow: hidden;
    padding: 0;
    cursor: pointer;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 26px;
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    box-shadow: var(--glass-shadow);
    transition: transform .3s, box-shadow .3s;
    animation: fadeUp .5s ease both;
}

.note-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--glass-shadow-hover);
}

.note-left {
    flex: 0 0 60%;
    max-width: 60%;
    padding: 26px 30px;
    min-width: 0;
}

.note-right {
    flex: 0 0 40%;
    max-width: 40%;
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--chip-bg);
    border-left: 1px solid var(--glass-border);
}

.note-meta-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.style-chip {
    font-size: 12px;
    font-weight: 600;
    color: var(--accent-1);
    background: var(--focus-ring);
    padding: 4px 12px;
    border-radius: 999px;
}

.pin-badge-inline {
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
    padding: 3px 10px;
    border-radius: 999px;
}

.cat-chip {
    font-size: 12px;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
    padding: 3px 12px;
    border-radius: 999px;
}

.right-images {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    width: 100%;
    position: relative;
}

.right-images img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: 16px;
    border: 1px solid var(--glass-border);
}

.right-images .more-images {
    position: absolute;
    right: 8px;
    bottom: 8px;
    background: rgba(0, 0, 0, .55);
    color: #fff;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 12px;
}

.no-image {
    font-size: 42px;
    opacity: .35;
}

.no-image.big {
    font-size: 16px;
    opacity: .5;
    padding: 40px 0;
}

/* 列表中的代码预览 */
.code-preview {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 12.5px;
    line-height: 1.7;
    color: var(--text-muted);
    background: var(--chip-bg);
    border: 1px solid var(--glass-border);
    border-radius: 14px;
    padding: 12px 16px;
    white-space: pre-wrap;
    max-height: 110px;
    overflow: hidden;
}

/* 详情页 60/40 */
.detail-split {
    display: flex;
    gap: 28px;
    margin-top: 10px;
}

.detail-left {
    flex: 0 0 60%;
    max-width: 60%;
    min-width: 0;
}

.detail-right {
    flex: 0 0 40%;
    max-width: 40%;
}

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

.detail-right .image-item img {
    height: 220px;
}

/* 代码编辑器视图 */
.code-wrap {
    position: relative;
}

.code-copy {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 2;
    padding: 4px 14px;
    font-size: 12px;
    border-radius: 8px;
    cursor: pointer;
    background: rgba(255, 255, 255, .10);
    color: #e6edf3;
    border: 1px solid rgba(255, 255, 255, .18);
}

.code-copy:hover {
    background: rgba(255, 255, 255, .2);
}

.code-view {
    background: #0d1117;
    border-radius: 16px;
    overflow: auto;
    max-height: 70vh;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 13.5px;
    line-height: 1.75;
    border: 1px solid rgba(255, 255, 255, .08);
}

.code-view table {
    border-collapse: collapse;
    width: 100%;
}

.code-view td.ln {
    padding: 0 14px;
    text-align: right;
    color: #6e7681;
    width: 1%;
    white-space: nowrap;
    user-select: none;
    border-right: 1px solid #21262d;
}

.code-view td.cl {
    padding: 0 18px;
    color: #e6edf3;
    white-space: pre;
}

/* 代码类 textarea */
.textarea-code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace !important;
    font-size: 14px;
    line-height: 1.7;
}

/* 响应式 */
/* ============ v3：右侧图片铺满容器 ============ */
.note-card {
    min-height: 220px;
}

.note-right {
    padding: 0;
    /* 去掉内边距，图片才能顶到边 */
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
}

.right-images {
    position: absolute;
    /* 绝对定位铺满整个右侧区域 */
    inset: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 2px;
    /* 想要完全无缝改成 0 */
    width: auto;
}

.right-images img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* 裁切铺满，不变形 */
    border-radius: 0;
    border: none;
    display: block;
}

/* 1 张图：独占整块 */
.right-images img:only-child {
    grid-column: 1 / -1;
    grid-row: 1 / -1;
}

/* 2 张图：左右各半、通高 */
.right-images img:first-child:nth-last-child(2),
.right-images img:first-child:nth-last-child(2)~img {
    grid-row: 1 / -1;
}

/* 3 张图：上一整条 + 下两张 */
.right-images img:first-child:nth-last-child(3) {
    grid-column: 1 / -1;
}

/* 4 张及以上：2×2 铺满，多余数量角标 */
.right-images .more-images {
    position: absolute;
    right: 10px;
    bottom: 10px;
    background: rgba(0, 0, 0, .55);
    color: #fff;
    padding: 3px 12px;
    border-radius: 999px;
    font-size: 12px;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

/* 手机端：右侧改为固定高度的横条 */
@media (max-width: 768px) {
    .note-right {
        min-height: 0;
        height: 240px;
        border-left: none;
        border-top: 1px solid var(--glass-border);
    }
}


/* ============ v4：VSCode 风格编辑器 ============ */
.code-editor {
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid #333;
    background: #1e1e1e;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .35);
}

.ce-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #252526;
    padding: 8px 14px;
    font-size: 12px;
    color: #cccccc;
    border-bottom: 1px solid #333;
}

.ce-lang {
    font-weight: 700;
    letter-spacing: .05em;
    color: #4fc1ff;
}

.ce-head button {
    background: #333;
    color: #ddd;
    border: 1px solid #444;
    border-radius: 6px;
    padding: 3px 12px;
    font-size: 12px;
    cursor: pointer;
}

.ce-head button:hover {
    background: #444;
}

.ce-body {
    display: flex;
    height: 460px;
}

.ce-gutter {
    flex: 0 0 52px;
    overflow: hidden;
    background: #1e1e1e;
    color: #858585;
    text-align: right;
    padding: 12px 10px 12px 0;
    border-right: 1px solid #333;
    font: 14px/1.7 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    white-space: pre;
    user-select: none;
}

.ce-scroll {
    position: relative;
    flex: 1;
    min-width: 0;
}

.ce-highlight,
.ce-input {
    position: absolute;
    inset: 0;
    margin: 0;
    padding: 12px 16px;
    font: 14px/1.7 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    tab-size: 4;
    white-space: pre;
    word-wrap: normal;
}

.ce-highlight {
    overflow: hidden;
    color: #d4d4d4;
    pointer-events: none;
}

.ce-input {
    background: transparent;
    color: transparent;
    /* 文字透明，只显示光标 */
    caret-color: #ffffff;
    border: none;
    outline: none;
    resize: none;
    overflow: auto;
}

.ce-input::selection {
    background: rgba(38, 79, 120, .8);
    color: transparent;
}

/* VSCode Dark+ 配色 */
.tok-com {
    color: #6a9955;
    font-style: italic;
}

.tok-str {
    color: #ce9178;
}

.tok-var {
    color: #9cdcfe;
}

.tok-kw {
    color: #569cd6;
}

.tok-ctrl {
    color: #c586c0;
}

.tok-num {
    color: #b5cea8;
}

.tok-func {
    color: #dcdcaa;
}

.tok-tag {
    color: #569cd6;
}

.tok-const {
    color: #4fc1ff;
}

.tok-ident {
    color: #d4d4d4;
}

/* 只读高亮块（详情页/列表预览共用）*/
[data-highlight] .tok-com {
    color: #6a9955;
    font-style: italic;
}

[data-highlight] .tok-str {
    color: #ce9178;
}

[data-highlight] .tok-var {
    color: #9cdcfe;
}

[data-highlight] .tok-kw {
    color: #569cd6;
}

[data-highlight] .tok-ctrl {
    color: #c586c0;
}

[data-highlight] .tok-num {
    color: #b5cea8;
}

[data-highlight] .tok-func {
    color: #dcdcaa;
}

[data-highlight] .tok-tag {
    color: #569cd6;
}

[data-highlight] .tok-const {
    color: #4fc1ff;
}

[data-highlight] .tok-ident {
    color: #d4d4d4;
}

@media (max-width: 768px) {
    .ce-body {
        height: 340px;
    }

    .ce-gutter {
        flex-basis: 40px;
    }
}


.code-view {
    display: flex;
    background: #1e1e1e;
    border: 1px solid #333;
    border-radius: 16px;
    overflow: auto;
    max-height: 70vh;
    font: 13.5px/1.75 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .30);
}

.cv-gutter {
    flex: 0 0 52px;
    margin: 0;
    padding: 14px 10px 14px 0;
    text-align: right;
    color: #858585;
    background: #1e1e1e;
    border-right: 1px solid #333;
    white-space: pre;
    user-select: none;
}

.cv-code {
    flex: 1;
    margin: 0;
    min-width: 0;
    padding: 14px 18px;
    color: #d4d4d4;
    /* ★ 关键：代码文字浅色，杜绝黑杠 */
    white-space: pre;
}

/* --- 列表页迷你编辑器 --- */
.code-preview {
    background: #1e1e1e;
    border: 1px solid #333;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 6px 18px rgba(0, 0, 0, .25);
}

.cp-head {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #252526;
    padding: 7px 14px;
    border-bottom: 1px solid #333;
}

.cp-dots {
    display: flex;
    gap: 6px;
}

.cp-dots i {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.cp-dots i:nth-child(1) {
    background: #ff5f57;
}

.cp-dots i:nth-child(2) {
    background: #febc2e;
}

.cp-dots i:nth-child(3) {
    background: #28c840;
}

.cp-lang {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .08em;
    color: #4fc1ff;
}

.cp-code {
    margin: 0;
    padding: 12px 16px;
    max-height: 150px;
    overflow: hidden;
    color: #d4d4d4;
    /* ★ 关键：浅色代码文字 */
    font: 12.5px/1.7 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    white-space: pre-wrap;
    word-break: break-all;
}

/* ============ v6：LOGO + 搜索框 + 条数居中 ============ */

/* LOGO */
.site-logo {
    display: inline-flex;
    align-items: center;
}

.site-logo img {
    height: 46px;
    width: auto;
    display: block;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, .12));
    transition: transform .25s;
}

.site-logo:hover img {
    transform: scale(1.05);
}

.site-logo img.logo-missing {
    display: none;
}

.logo-fallback {
    display: none;
    font-size: 2.1rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.site-logo img.logo-missing+.logo-fallback {
    display: inline;
}

/* 分类行：Tab 靠左 / 条数水平居中 / 右侧占位保持平衡 */
.cat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 80px;
}

.cat-row .cat-tabs {
    margin-bottom: 0;
    justify-self: start;
}

.cat-row .count-chip {
    justify-self: center;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    padding: 6px 18px;
    border-radius: 999px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
}

.cat-row-spacer {
    justify-self: end;
}

/* 前台搜索框 */
.search-form-front {
    display: flex;
    gap: 8px;
    align-items: center;
}

.search-form-front input[type="text"] {
    width: 240px;
    padding: 9px 16px;
    border: 1px solid var(--glass-border);
    border-radius: 999px;
    background: var(--input-bg);
    color: var(--text-color);
    font-size: 14px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: all .2s;
}

.search-form-front input[type="text"]:focus {
    outline: none;
    border-color: var(--accent-1);
    box-shadow: 0 0 0 4px var(--focus-ring);
    width: 280px;
}

@media (max-width: 768px) {
    .cat-row {
        grid-template-columns: 1fr;
        justify-items: center;
    }

    .cat-row .cat-tabs {
        justify-self: center;
    }

    .cat-row-spacer {
        display: none;
    }

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

    .search-form-front input[type="text"] {
        width: 100%;
        flex: 1;
    }

    .search-form-front input[type="text"]:focus {
        width: 100%;
    }
}


/* ============ v9：客户资料模块 ============ */
.container-wide {
    max-width: 1500px;
}

/* 验证门 */
.gate-box {
    max-width: 460px;
    margin: 60px auto;
    text-align: center;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 30px;
    padding: 48px 36px;
    backdrop-filter: blur(28px) saturate(180%);
    -webkit-backdrop-filter: blur(28px) saturate(180%);
    box-shadow: var(--glass-shadow-hover);
    animation: fadeUp .5s ease both;
}

.gate-icon {
    font-size: 56px;
    margin-bottom: 12px;
}

.gate-box h2 {
    margin-bottom: 10px;
    font-weight: 800;
}

.gate-box p {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 22px;
}

.gate-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.gate-form input {
    padding: 12px;
    text-align: center;
    font-size: 20px;
    letter-spacing: 8px;
    border: 1px solid var(--glass-border);
    border-radius: 14px;
    background: var(--input-bg);
    color: var(--text-color);
}

/* 图例 */
.cust-legend {
    display: flex;
    gap: 18px;
    margin-bottom: 14px;
    font-size: 13px;
    color: var(--text-muted);
}

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

.dot-yellow {
    background: #fff3cd;
    border: 1px solid #e0c867;
}

.dot-orange {
    background: #ffd8a8;
    border: 1px solid #e8973a;
}

.dot-red {
    background: #ffb4b4;
    border: 1px solid #e05252;
}

/* 表格 */
.cust-table-wrap {
    overflow-x: auto;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    backdrop-filter: blur(22px);
    -webkit-backdrop-filter: blur(22px);
    box-shadow: var(--glass-shadow);
}

.cust-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 1200px;
}

.cust-table th,
.cust-table td {
    padding: 12px 14px;
    font-size: 13.5px;
    text-align: left;
    border-bottom: 1px solid var(--glass-border);
    vertical-align: top;
}

.cust-table th {
    background: var(--chip-bg);
    font-weight: 700;
    white-space: nowrap;
}

.cust-table tbody tr:last-child td {
    border-bottom: none;
}

.cust-table .strong {
    font-weight: 700;
    white-space: nowrap;
}

.cust-table .remark {
    max-width: 220px;
    color: var(--text-muted);
}

/* 到期行变色 */
.cust-table tr.row-yellow td {
    background: #fff8dd;
}

.cust-table tr.row-orange td {
    background: #ffe8cc;
}

.cust-table tr.row-red td {
    background: #ffd6d6;
}

/* 倒计时徽章 */
.days-badge {
    display: inline-block;
    margin-left: 6px;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    background: var(--chip-bg);
    color: var(--text-muted);
}

.days-badge.row-yellow {
    background: #fff3cd;
    color: #8a6d1a;
}

.days-badge.row-orange {
    background: #ffd8a8;
    color: #9a5b13;
}

.days-badge.row-red {
    background: #ffb4b4;
    color: #8f1d1d;
}

/* 密文眼睛 */
.secret {
    white-space: pre-wrap;
    word-break: break-all;
    font-family: ui-monospace, Menlo, Consolas, monospace;
    font-size: 12.5px;
}

.eye {
    border: none;
    background: none;
    cursor: pointer;
    font-size: 13px;
    padding: 0 2px;
}

/* ============ v10：微信绑定步骤卡片 ============ */
.wx-bind-steps {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 16px;
}

.wx-step {
    display: flex;
    gap: 14px;
    align-items: flex-start;
}

.wx-step-num {
    flex: 0 0 30px;
    height: 30px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
    color: #fff;
    font-weight: 800;
    font-size: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px var(--glow);
}

.wx-step-body {
    flex: 1;
}

.wx-step-body b {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
}

.wx-step-body p {
    color: var(--text-muted);
    font-size: 13px;
    margin-bottom: 10px;
    line-height: 1.7;
}

.wx-step-body code {
    background: var(--chip-bg);
    padding: 1px 6px;
    border-radius: 6px;
    font-size: 12px;
}

.wx-step-body input[type="text"] {
    width: 100%;
    padding: 9px 14px;
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    background: var(--input-bg);
    color: var(--text-color);
    font-size: 14px;
}