/* ========== [01] 样式总览 ========== */
/* 覆盖：全局变量、布局结构、导航交互、表单区、笔记卡片与登录注册页面 */

:root {
    --theme-primary: #5b67ca;
    --bg-light: rgba(255, 255, 255, 0.95);
    --border-color: rgba(255, 255, 255, 0.2);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.12);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.16);
}

/* ========== [02] 基础重置（margin/padding/box-sizing） ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ========== [03] 页面背景与字体排版 ========== */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: transparent;
    background-image: url('assets/bg.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    min-height: 100vh;
    padding: 0;
    color: #333;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 16px;
}

header {
    text-align: center;
    color: white;
    margin-bottom: 20px;
    padding: 20px 18px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}

/* ========== [04] 页头与用户信息区 ========== */

header h1 {
    font-size: 2.2em;
    margin-bottom: 6px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
    font-weight: 700;
    letter-spacing: -0.5px;
}

.subtitle {
    font-size: 1em;
    opacity: 0.8;
    color: rgba(255, 255, 255, 0.8);
}

.user-info {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.welcome {
    font-size: 0.95em;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
}

.user-actions {
    display: flex;
    gap: 8px;
}

/* ========== [05] 用户操作按钮（个人入口/退出） ========== */

.btn-user {
    padding: 8px 14px;
    background: var(--theme-primary);
    color: white;
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.3s ease;
    font-size: 0.9em;
    border: 1px solid var(--theme-primary);
    font-weight: 600;
    box-shadow: 0 2px 6px rgba(91, 103, 202, 0.2);
}

.btn-user:hover {
    background: var(--theme-primary);
    box-shadow: 0 4px 12px rgba(91, 103, 202, 0.3);
    transform: translateY(-1px);
}

.btn-logout {
    padding: 8px 14px;
    background: linear-gradient(135deg, rgba(255, 99, 71, 0.6), rgba(255, 71, 87, 0.5));
    color: white;
    border: 1px solid rgba(255, 71, 87, 0.4);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9em;
    font-weight: 600;
    box-shadow: 0 2px 6px rgba(255, 71, 87, 0.2);
}

.btn-logout:hover {
    background: linear-gradient(135deg, rgba(255, 99, 71, 0.8), rgba(255, 71, 87, 0.7));
    box-shadow: 0 4px 12px rgba(255, 71, 87, 0.3);
    transform: translateY(-1px);
}

.message {
    padding: 14px 18px;
    margin-bottom: 18px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(12px);
    animation: slideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    font-weight: 500;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.message.success {
    background: linear-gradient(135deg, rgba(212, 237, 218, 0.85), rgba(223, 246, 227, 0.8));
    color: #0d3818;
    border: 1px solid rgba(195, 230, 203, 0.6);
    box-shadow: 0 4px 16px rgba(76, 175, 80, 0.15);
}

.message.error {
    background: linear-gradient(135deg, rgba(248, 215, 218, 0.85), rgba(255, 235, 238, 0.8));
    color: #5f0009;
    border: 1px solid rgba(245, 198, 203, 0.6);
    box-shadow: 0 4px 16px rgba(244, 67, 54, 0.15);
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 说明：slideIn 用于消息条与导航区的轻量入场动画（上移 + 淡入） */

.navigation {
    margin: 0;
    animation: slideIn 0.3s ease-out;
    width: 100%;
}

/* ========== [06] 导航栏主结构 ========== */

/* 导航容器：包含品牌名、功能入口与登出表单，默认横向排列 */

.nav-container {
    display: flex;
    gap: 6px;
    justify-content: flex-start;
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    padding: 6px 10px;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08), inset 0 1px 0 rgba(255,255,255,0.06);
    flex-wrap: nowrap;
    border: 1px solid rgba(255, 255, 255, 0.1);
    align-items: center;
    transition: all 0.35s ease;
    position: relative;
}

/* 隐藏菜单切换复选框 */
.menu-toggle {
    display: none;
}

/* 汉堡按钮（桌面端隐藏） */
.hamburger-btn {
    display: none;
    flex-direction: column;
    cursor: pointer;
    gap: 5px;
    padding: 6px 8px;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.hamburger-btn span {
    display: block;
    width: 24px;
    height: 2.5px;
    background: white;
    border-radius: 2px;
    transition: all 0.3s ease;
    box-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.hamburger-btn:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* 菜单项容器 */
.nav-links {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    justify-content: flex-end;
}

.nav-container:hover {
    background: rgba(255, 255, 255, 0.09);
    border-color: rgba(255, 255, 255, 0.22);
    box-shadow: 0 6px 28px rgba(0,0,0,0.15), inset 0 1px 0 rgba(255,255,255,0.12);
}

.nav-brand {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: white;
    text-decoration: none;
    font-size: 1.05em;
    font-weight: 700;
    letter-spacing: 0.3px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
    white-space: nowrap;
    transition: all 0.25s ease;
    padding: 4px 8px 4px 4px;
    border-radius: 10px;
}

.nav-emoji {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3em;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: transparent;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.nav-brand:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.06);
}

.nav-brand:hover .nav-emoji {
    transform: scale(1.08) rotate(-4deg);
}



.nav-logout-form {
    display: inline;
}

/* ========== [07] 导航链接与搜索区交互 ========== */

.nav-link {
    min-width: 0;
    padding: 7px 14px;
    text-align: center;
    text-decoration: none;
    color: rgba(255, 255, 255, 0.85);
    background: transparent;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.9em;
    transition: all 0.25s ease;
    border: 1px solid transparent;
    text-shadow: 0 1px 2px rgba(0,0,0,0.15);
    cursor: pointer;
    letter-spacing: 0.2px;
}

.nav-link:hover {
    color: white;
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.18);
    transform: translateY(-1px);
}

.nav-link.active {
    color: white;
    background: linear-gradient(135deg, rgba(255,255,255,0.15), rgba(255,255,255,0.08));
    border-color: rgba(255, 255, 255, 0.25);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1), inset 0 1px 0 rgba(255,255,255,0.1);
}

.btn-logout-nav {
    padding: 7px 14px;
    background: transparent;
    color: rgba(255, 255, 255, 0.75);
    border: 1px solid transparent;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.25s ease;
    text-shadow: 0 1px 2px rgba(0,0,0,0.15);
    font-size: 0.9em;
    min-width: auto;
}

.btn-logout-nav:hover {
    color: white;
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.3);
    transform: translateY(-1px);
}

.search-bar {
    margin-bottom: 20px;
}

/* ========== [08] 搜索栏与筛选控件 ========== */

.search-bar form {
    display: flex;
    gap: 8px;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(20px);
    padding: 10px;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
}

.search-bar form:focus-within {
    background: rgba(255, 255, 255, 0.12);
    box-shadow: 0 8px 32px rgba(0,0,0,0.15);
    border-color: rgba(255, 255, 255, 0.5);
}

.search-bar input[type="text"] {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 8px;
    font-size: 0.95em;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(8px);
    color: white;
}

.search-bar input[type="text"]::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.search-bar input[type="text"]:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.2);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.1);
}

.search-controls-row {
    display: flex;
    gap: 8px;
}

.search-bar button {
    padding: 10px 18px;
    background: var(--theme-primary);
    color: white;
    border: 1px solid var(--theme-primary);
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.95em;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(91, 103, 202, 0.25);
}

.search-bar button:hover {
    background: var(--theme-primary);
    box-shadow: 0 4px 16px rgba(91, 103, 202, 0.35);
    transform: translateY(-1px);
}

.btn-clear {
    padding: 10px 18px;
    background: linear-gradient(135deg, rgba(100, 100, 120, 0.7), rgba(80, 80, 100, 0.6));
    color: white;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s ease;
    display: inline-block;
    border: 1px solid rgba(255, 255, 255, 0.2);
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.btn-clear:hover {
    background: linear-gradient(135deg, rgba(120, 120, 140, 0.9), rgba(100, 100, 120, 0.8));
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    transform: translateY(-1px);
}

/* 每页条数选择器 */
.per-page-select {
    padding: 10px 12px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 20px;
    background: transparent;
    color: white;
    font-size: 0.92em;
    font-weight: 600;
    cursor: pointer;
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
    flex-shrink: 0;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='rgba(255,255,255,0.7)' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 30px;
    text-align: center;
}
.per-page-select:hover {
    border-color: rgba(255, 255, 255, 0.5);
}
.per-page-select:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.6);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.1);
}
.per-page-select option {
    background: #1e2230;
    color: white;
    padding: 8px 12px;
    text-align: left;
}
.per-page-select option:checked {
    background: var(--theme-primary);
    color: white;
}

/* 分页导航条 */
.pagination {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    margin-top: 24px;
    padding: 10px 12px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.14);
    backdrop-filter: blur(12px);
    box-shadow: 0 6px 18px rgba(8, 15, 35, 0.08);
}

.pagination-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    flex-wrap: wrap;
}

.page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0;
    border-radius: 999px;
    font-size: 0.85em;
    font-weight: 600;
    line-height: 1;
    text-decoration: none;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.84);
    backdrop-filter: blur(8px);
    cursor: pointer;
    transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
    user-select: none;
    white-space: nowrap;
}

.page-btn-step {
    min-width: 34px;
    height: 34px;
    font-size: 1.1em;
    color: rgba(255, 255, 255, 0.65);
    background: transparent;
    border-color: transparent;
    border-radius: 999px;
}

.page-btn-step:active {
    background: rgba(255, 255, 255, 0.10);
    border-color: rgba(255, 255, 255, 0.18);
}

.page-btn-current {
    min-width: 48px;
    height: 34px;
    padding: 0 14px;
    cursor: default;
    gap: 3px;
    border-radius: 999px;
}

.page-btn-total {
    font-weight: 400;
    opacity: 0.62;
    font-size: 0.85em;
}

a.page-btn:hover {
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(255, 255, 255, 0.38);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

a.page-btn-step:hover {
    background: rgba(255, 255, 255, 0.10);
    border-color: rgba(255, 255, 255, 0.22);
    box-shadow: 0 3px 10px rgba(0,0,0,0.10);
    color: rgba(255, 255, 255, 0.92);
}

a.page-btn:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.85);
    outline-offset: 2px;
}

.page-btn.active {
    background: var(--theme-primary);
    border-color: var(--theme-primary);
    color: white;
    box-shadow: 0 6px 16px rgba(91, 103, 202, 0.34);
    cursor: default;
    transform: translateY(-1px);
}

.page-btn.disabled {
    opacity: 0.28;
    cursor: not-allowed;
    pointer-events: none;
}


.add-note-btn {
    text-align: center;
    margin-bottom: 30px;
}

/* ========== [09] 主操作按钮（新增/提交等核心动作） ========== */
.btn-primary {
    display: inline-block;
    padding: 12px 24px;
    background: var(--theme-primary);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-size: 0.95em;
    font-weight: 600;
    box-shadow: 0 4px 16px rgba(91, 103, 202, 0.3);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    cursor: pointer;
}

.btn-primary:hover {
    background: var(--theme-primary);
    box-shadow: 0 8px 24px rgba(91, 103, 202, 0.4);
    transform: translateY(-2px);
}

.btn-secondary {
    display: inline-block;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.12);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-size: 0.95em;
    font-weight: 600;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.18);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    transform: translateY(-1px);
}

.note-form {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(16px);
    padding: 24px;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
    margin-bottom: 20px;
    animation: none;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

/* ========== [10] 笔记表单（输入区、焦点态、操作区） ========== */

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.98);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.note-form h2 {
    margin-bottom: 18px;
    color: white;
    font-size: 1.45em;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
    font-weight: 700;
    letter-spacing: -0.3px;
}

.form-group {
    margin-bottom: 14px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.95);
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
    font-size: 0.95em;
}

.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="number"],
.form-group textarea {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 8px;
    font-size: 0.95em;
    font-family: inherit;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(8px);
    color: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.08);
}

.form-group input[type="text"]::placeholder,
.form-group input[type="password"]::placeholder,
.form-group textarea::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.form-group input[type="text"]:focus,
.form-group input[type="password"]:focus,
.form-group input[type="number"]:focus,
.form-group textarea:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.2);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.1), inset 0 1px 2px rgba(0,0,0,0.05);
}

.form-group textarea {
    resize: vertical;
    min-height: 150px;
}

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
    padding-top: 18px;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
}

.notes-count {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(12px);
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 12px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.95);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
    font-size: 0.95em;
}

.notes-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* ========== [11] 笔记列表与卡片展示 ========== */

.note-card {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(20px);
    padding: 22px;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    animation: slideUp 0.4s ease-out;
    border: 1px solid rgba(255, 255, 255, 0.3);
    cursor: pointer;
}

/* ========== [12] 卡片动画（slideUp：上浮淡入） ========== */
@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.note-card:hover {
    transform: translateY(-4px) scale(1.01);
    box-shadow: 0 16px 48px rgba(0,0,0,0.15);
    border-color: rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.12);
}

.note-header {
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    flex-wrap: wrap;
    width: 100%;
}

.note-header h3 {
    color: white;
    margin-bottom: 8px;
    font-size: 1.35em;
    font-weight: 600;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
    letter-spacing: -0.3px;
    flex: 1;
}

.note-views-badge {
    background: var(--theme-primary);
    color: white;
    padding: 6px 12px;
    border-radius: 16px;
    font-size: 0.85em;
    font-weight: 600;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.note-meta {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 14px;
    font-size: 0.9em;
    color: rgba(255, 255, 255, 0.85);
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
    width: 100%;
    order: 3;
}

.note-content {
    margin: 14px 0;
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.95);
    padding: 12px 14px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 6px;
    border-left: 3px solid var(--theme-primary);
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.note-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: stretch;
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.18);
}

.note-actions > .note-action-btn,
.note-actions > form {
    flex: 1 1 0;
}

.note-actions > form {
    display: flex !important;
}

.note-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 122px;
    padding: 9px 14px;
    border-radius: 8px;
    font-size: 0.92em;
    font-weight: 600;
    line-height: 1.2;
    transition: all 0.25s ease;
    cursor: pointer;
    text-align: center;
}

.btn-edit {
    background: var(--theme-primary);
    color: white;
    text-decoration: none;
    border: 1px solid rgba(255, 255, 255, 0.35);
    box-shadow: 0 2px 8px rgba(91, 103, 202, 0.25);
}

.btn-edit:hover {
    background: var(--theme-primary);
    box-shadow: 0 4px 16px rgba(91, 103, 202, 0.35);
    transform: translateY(-1px);
}

.btn-delete {
    display: inline-block;
    padding: 10px 20px;
    background: linear-gradient(135deg, rgba(255, 99, 71, 0.7), rgba(255, 71, 87, 0.6));
    color: white;
    border: 1px solid rgba(255, 71, 87, 0.4);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(255, 71, 87, 0.25);
    font-size: 0.95em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-delete:hover {
    background: linear-gradient(135deg, rgba(255, 99, 71, 0.9), rgba(255, 71, 87, 0.8));
    box-shadow: 0 4px 16px rgba(255, 71, 87, 0.35);
    transform: translateY(-1px);
}

.btn-reset-views {
    background: linear-gradient(135deg, rgba(255, 179, 71, 0.78), rgba(251, 146, 60, 0.68));
    color: #fff;
    border: 1px solid rgba(255, 196, 112, 0.55);
    box-shadow: 0 2px 8px rgba(251, 146, 60, 0.24);
}

.btn-reset-views:hover {
    background: linear-gradient(135deg, rgba(255, 186, 92, 0.94), rgba(245, 158, 11, 0.86));
    box-shadow: 0 4px 16px rgba(245, 158, 11, 0.34);
    transform: translateY(-1px);
}

.note-actions .note-action-btn {
    width: 100%;
    min-height: 40px;
    padding: 9px 14px;
    font-size: 0.92em;
    line-height: 1.2;
}

/* ========== [13] 空状态提示（列表为空时） ========== */
.empty-state {
    text-align: center;
    padding: 48px 20px;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(16px);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
}

.empty-state:hover {
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 12px 40px rgba(0,0,0,0.15);
}

.empty-state p {
    font-size: 1.65em;
    color: rgba(255, 255, 255, 0.95);
    margin-bottom: 12px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
    font-weight: 600;
}

.empty-hint {
    font-size: 1em !important;
    color: rgba(255, 255, 255, 0.75) !important;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
    line-height: 1.6;
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes toastOut {
    from {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    to {
        opacity: 0;
        transform: translateY(10px) scale(0.96);
    }
}

.ne-toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 100000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
    max-width: 380px;
}

.ne-toast {
    pointer-events: auto;
    padding: 13px 18px;
    border-radius: 12px;
    font-size: 0.92em;
    font-weight: 600;
    line-height: 1.5;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.22), 0 2px 8px rgba(0, 0, 0, 0.10);
    animation: toastIn 0.32s cubic-bezier(0.2, 0.9, 0.4, 1) both;
    border: 1px solid rgba(255, 255, 255, 0.45);
    cursor: pointer;
    user-select: none;
    transition: opacity 0.2s ease;
}

.ne-toast.ne-toast--out {
    animation: toastOut 0.22s ease both;
}

.ne-toast.ne-toast--success {
    background: linear-gradient(135deg, rgba(212, 237, 218, 0.88), rgba(223, 246, 227, 0.82));
    color: #0d3818;
    border-color: rgba(195, 230, 203, 0.6);
}

.ne-toast.ne-toast--error {
    background: linear-gradient(135deg, rgba(248, 215, 218, 0.88), rgba(255, 235, 238, 0.82));
    color: #5f0009;
    border-color: rgba(245, 198, 203, 0.6);
}

/* ========== [14] 页脚信息（版权/辅助说明） ========== */
footer {
    text-align: center;
    margin-top: 40px;
    padding: 18px 24px;
    font-size: 0.85em;
    color: rgba(255, 255, 255, 0.45);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    letter-spacing: 0.5px;
    user-select: none;
}

footer p {
    margin: 0;
}

.color-picker-group {
    display: flex;
    gap: 12px;
    align-items: stretch;
    flex-wrap: wrap;
}

@keyframes ctx-in {
    from {
        opacity: 0;
        transform: scale(0.92) translateY(-5px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.custom-context-menu {
    position: fixed;
    z-index: 99999;
    width: max-content;
    min-width: 0;
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 10px;
    background: rgba(235, 243, 255, 0.3);
    box-shadow: 0 8px 28px rgba(15, 23, 42, 0.2), 0 2px 6px rgba(0, 0, 0, 0.07);
    backdrop-filter: blur(20px) saturate(160%);
    -webkit-backdrop-filter: blur(20px) saturate(160%);
    padding: 4px 0;
    display: none;
    transform-origin: top left;
    overflow: hidden;
}

.custom-context-menu.ctx-visible {
    display: block;
    animation: ctx-in 0.15s cubic-bezier(0.2, 0.9, 0.4, 1) both;
}

.custom-context-menu__action {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 7px;
    border: 0;
    outline: none;
    background: transparent;
    border-radius: 6px;
    margin: 0 4px;
    width: calc(100% - 8px);
    padding: 6px 12px 6px 10px;
    font-size: 13px;
    font-weight: 500;
    color: #1e293b;
    text-align: left;
    line-height: 1.4;
    cursor: pointer;
    white-space: nowrap;
    transition: background-color 0.12s ease, box-shadow 0.12s ease, color 0.12s ease;
    -webkit-tap-highlight-color: transparent;
}

.custom-context-menu__action:hover,
.custom-context-menu__action:focus {
    background: rgba(148, 182, 233, 0.22);
    box-shadow: inset 0 0 0 1px rgba(148, 182, 233, 0.3);
    color: #0f172a;
}

.custom-context-menu__action:active {
    background: rgba(148, 182, 233, 0.32);
    box-shadow: inset 0 0 0 1px rgba(148, 182, 233, 0.4);
    color: #0f172a;
}

/* ========== [15] 颜色选择与主题预览 ========== */
.color-picker {
    width: 60px;
    height: 45px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.color-picker:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    border-color: rgba(255, 255, 255, 0.6);
}

.color-input {
    flex: 1;
    padding: 12px 15px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    font-size: 1em;
    background: rgba(255, 255, 255, 0.9);
    font-family: 'Courier New', monospace;
}

.form-hint {
    display: block;
    margin-top: 5px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.85em;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}

.color-preview {
    display: inline-block;
    width: 20px;
    height: 20px;
    border-radius: 4px;
    border: 2px solid rgba(255, 255, 255, 0.5);
    vertical-align: middle;
    margin-right: 8px;
}

.settings-preview {
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(15px);
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.25);
    margin-top: 30px;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.settings-preview h3 {
    color: white;
    margin-bottom: 20px;
    font-size: 1.5em;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.preview-buttons {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    align-items: center;
}

.preview-buttons .theme-preset {
    min-width: 108px;
    padding: 9px 14px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.55);
    font-weight: 700;
    letter-spacing: 0.2px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.18);
    transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.preview-buttons .theme-preset:hover {
    transform: translateY(-1px) scale(1.02);
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.22);
    filter: saturate(1.08);
}

.btn-preview-primary {
    padding: 15px 40px;
    color: white;
    text-decoration: none;
    border-radius: 50px;
    font-size: 1.1em;
    font-weight: bold;
    border: none;
    cursor: default;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.btn-preview-link {
    padding: 10px 20px;
    text-decoration: none;
    font-weight: bold;
    font-size: 1em;
    cursor: default;
}

/* ========== [16] 主界面响应式（<=768px） ========== */
/* 调整方向：按钮改为纵向、导航改为堆叠、搜索区改为单列 */
@media (max-width: 768px) {
    header h1 {
        font-size: 2em;
    }
    
    .subtitle {
        font-size: 1em;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .btn-primary,
    .btn-secondary {
        width: 100%;
        text-align: center;
    }
    
    .note-meta {
        flex-direction: column;
        gap: 5px;
    }
    
    .note-actions {
        flex-direction: column;
    }
    
    .btn-edit,
    .btn-delete,
    .btn-reset-views,
    .note-action-btn {
        width: 100%;
        text-align: center;
    }
    
    .search-bar form {
        flex-direction: column;
    }

    .search-bar form > input[type="text"] {
        width: 100%;
    }

    .search-controls-row {
        flex-wrap: nowrap;
        flex: 1;
        display: flex;
    }

    .search-controls-row .per-page-select,
    .search-controls-row button,
    .search-controls-row .btn-clear {
        flex: 1;
        min-width: 0;
        width: 0;
    }

    .search-controls-row .per-page-select {
        padding-right: 22px;
        background-position: right 6px center;
    }

    .pagination {
        gap: 0;
        padding: 10px;
    }

    .pagination-controls {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        max-width: 100%;
        gap: 4px;
    }

    .page-btn {
        min-width: 32px;
        height: 32px;
        font-size: 0.82em;
    }

    .page-btn-step {
        min-width: 30px;
        height: 30px;
        font-size: 1em;
    }

    .page-btn-current {
        min-width: 42px;
        height: 32px;
        padding: 0 11px;
    }
    
    .user-info {
        flex-direction: column;
        align-items: center;
    }
    
    .user-actions {
        width: 100%;
        justify-content: center;
    }
    
    .nav-container {
        flex-direction: row;
        align-items: center;
        gap: 8px;
        flex-wrap: nowrap;
    }

    .nav-brand {
        text-align: left;
        flex: 1;
        min-width: 0;
        font-size: 0.95em;
    }

    /* 手机端简化导航：只保留登录/登出按钮 */
    .nav-links {
        width: auto;
        flex: 0 0 auto;
        flex-direction: row;
        gap: 6px;
        opacity: 0;
        opacity: 1;
    }

    .nav-logout-form {
        width: auto;
    }

    .nav-item-main {
        display: none;
    }

    .nav-item-auth,
    .nav-item-auth.nav-link,
    .nav-item-auth .btn-logout-nav {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
    
    .nav-link,
    .btn-logout-nav {
        min-width: auto;
        width: auto;
        padding: 8px 12px;
        font-size: 0.9em;
        text-align: center;
    }
    
    .register-box {
        padding: 22px 16px;
        margin: 0 8px;
    }
    
    .register-box h2 {
        font-size: 1.5em;
    }
}

/* ========== [17] 登录页布局（全屏居中与消息宽度） ========== */

.login-page .container {
    max-width: none;
    width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 24px 16px;
}

.login-page .message {
    width: 100%;
    max-width: 430px;
    margin-bottom: 0;
}

.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    min-height: calc(100vh - 32px);
    padding: 0;
}

.login-page .register-container {
    width: 100%;
    min-height: auto;
    display: flex;
    justify-content: center;
    align-items: center;
}

.login-box {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(20px);
    padding: 32px;
    border-radius: 16px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.2);
    max-width: 430px;
    width: 100%;
    animation: none;
    border: 1px solid rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
}

.login-box:hover {
    box-shadow: 0 16px 48px rgba(0,0,0,0.25);
    background: rgba(255, 255, 255, 0.1);
}

.login-box h2 {
    text-align: center;
    color: white;
    margin-bottom: 24px;
    font-size: 1.95em;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
    font-weight: 700;
    letter-spacing: -0.3px;
}

.login-hint {
    background: linear-gradient(135deg, rgba(255, 243, 205, 0.95), rgba(255, 253, 235, 0.9));
    border: 1px solid rgba(255, 193, 7, 0.5);
    color: #333;
    padding: 16px;
    border-radius: 10px;
    margin-bottom: 24px;
    text-align: center;
    line-height: 1.7;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 12px rgba(255, 193, 7, 0.1);
    font-size: 0.95em;
}

.login-hint code {
    background: rgba(0,0,0,0.08);
    padding: 4px 10px;
    border-radius: 6px;
    font-weight: 600;
    color: #c00;
}

.btn-login {
    width: 100%;
    padding: 14px;
    font-size: 1.1em;
    margin-top: 12px;
    font-weight: 600;
    border-radius: 8px;
}

.login-page .form-group input[type="text"]:-webkit-autofill,
.login-page .form-group input[type="text"]:-webkit-autofill:hover,
.login-page .form-group input[type="text"]:-webkit-autofill:focus,
.login-page .form-group input[type="password"]:-webkit-autofill,
.login-page .form-group input[type="password"]:-webkit-autofill:hover,
.login-page .form-group input[type="password"]:-webkit-autofill:focus {
    -webkit-text-fill-color: white;
    box-shadow: 0 0 0 1000px rgba(255, 255, 255, 0.15) inset;
    -webkit-box-shadow: 0 0 0 1000px rgba(255, 255, 255, 0.15) inset;
    border: 1px solid rgba(255, 255, 255, 0.25);
    transition: background-color 9999s ease-out 0s;
}

.login-page .form-group input[type="text"]:-moz-autofill,
.login-page .form-group input[type="password"]:-moz-autofill {
    box-shadow: 0 0 0 1000px rgba(255, 255, 255, 0.15) inset;
    color: white;
}

/* ========== [18] 注册页布局（注册卡片与引导文案） ========== */

.register-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 65vh;
}

.register-box {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(20px);
    padding: 32px;
    border-radius: 16px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.2);
    max-width: 480px;
    width: 100%;
    animation: none;
    border: 1px solid rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
}

.register-box h2 {
    text-align: center;
    color: white;
    margin-bottom: 16px;
    font-size: 1.95em;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
    font-weight: 700;
    letter-spacing: -0.3px;
}

.register-intro {
    text-align: center;
    color: white;
    margin-bottom: 18px;
    padding: 12px;
    background: rgba(231, 243, 255, 0.2);
    backdrop-filter: blur(8px);
    border-radius: 4px;
    border-left: 3px solid rgba(255, 255, 255, 0.28);
    text-shadow: 1px 1px 2px rgba(0,0,0,0.25);
}

.btn-register {
    width: 100%;
    padding: 15px;
    font-size: 1.2em;
    margin-top: 10px;
}

/* ========== [19] 用户管理页（返回入口与信息卡片） ========== */

.user-management {
    animation: fadeIn 0.4s ease-out;
}

.manage-users-page {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.manage-users-page .mu-overview {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.manage-users-page .mu-stat-card {
    background: rgba(255, 255, 255, 0.11);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 14px 16px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
    backdrop-filter: blur(8px);
}

.manage-users-page .mu-stat-label {
    margin: 0;
    color: rgba(255, 255, 255, 0.75);
    font-size: 0.84em;
}

.manage-users-page .mu-stat-value {
    margin: 6px 0 0;
    color: #fff;
    font-size: 1.08em;
    font-weight: 700;
}

.manage-users-page .mu-main-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
    gap: 18px;
}

.manage-users-page .mu-stack {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.manage-users-page .mu-panel {
    margin-top: 0;
    border-radius: 12px;
}

.manage-users-page .mu-form-tip {
    color: rgba(255, 255, 255, 0.74);
    font-size: 0.84em;
    margin-top: 5px;
    display: block;
}

.manage-users-page .mu-nickname-chip {
    background: var(--theme-primary, #5B67CA);
    padding: 4px 12px;
    border-radius: 12px;
    display: inline-block;
    font-weight: 600;
}

.manage-users-page .mu-add-admin-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.manage-users-page .mu-admin-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.manage-users-page .mu-admin-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.16);
}

.manage-users-page .mu-admin-meta {
    min-width: 0;
}

.manage-users-page .mu-admin-name {
    margin: 0;
    color: #fff;
    font-weight: 700;
}

.manage-users-page .mu-admin-nickname {
    margin: 4px 0 0;
    color: rgba(255, 255, 255, 0.78);
    font-size: 0.9em;
}

.manage-users-page .mu-current-tag {
    margin-left: auto;
    font-size: 0.78em;
    color: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(255, 255, 255, 0.26);
    border-radius: 999px;
    padding: 4px 10px;
    white-space: nowrap;
}

.manage-users-page .mu-admin-action {
    margin-left: auto;
}

.manage-users-page .mu-admin-action .btn-delete {
    padding: 8px 14px;
    font-size: 0.88em;
}

.back-btn {
    margin-bottom: 20px;
}

.back-btn a {
    display: inline-block;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(6px);
    color: white;
    text-decoration: none;
    border-radius: 4px;
    transition: background 0.1s;
    font-weight: 600;
    border: 1px solid rgba(255, 255, 255, 0.15);
    text-shadow: 1px 1px 2px rgba(0,0,0,0.25);
}

.back-btn a:hover {
    background: rgba(255, 255, 255, 0.12);
}

.user-info-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(6px);
    padding: 18px;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    margin-top: 16px;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.user-info-card h3 {
    color: white;
    margin-bottom: 20px;
    font-size: 1.5em;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.info-item {
    display: flex;
    padding: 15px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.info-item:last-child {
    border-bottom: none;
}

.info-item .label {
    font-weight: bold;
    color: rgba(255, 255, 255, 0.9);
    min-width: 100px;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}

.info-item .value {
    color: white;
    font-size: 1.1em;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}

@media (max-width: 980px) {
    .manage-users-page .mu-overview {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .manage-users-page .mu-main-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .manage-users-page .mu-overview {
        grid-template-columns: 1fr;
    }

    .manage-users-page .mu-add-admin-grid {
        grid-template-columns: 1fr;
    }

    .manage-users-page .mu-admin-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .manage-users-page .mu-current-tag,
    .manage-users-page .mu-admin-action {
        margin-left: 0;
    }
}

/* ========== [20] 登录/注册区域响应式（<=768px） ========== */

@media (max-width: 768px) {
    .login-container {
        min-height: calc(100svh - 20px);
    }

    .login-page .register-container {
        min-height: auto;
    }

    .login-page .container {
        min-height: 100svh;
        justify-content: center;
        padding: 16px 10px;
    }

    .login-box {
        padding: 30px 20px;
        margin: 0;
    }
    
    .login-box h2 {
        font-size: 1.5em;
    }
}


