/* =========================
   手记（notes / note）
   配色全部取自 style.css 的主题变量，
   夜 / 樱 / nyaneko / 海 四套主题会自动跟着变。
========================= */

.notes-page {
    width: min(880px, calc(100% - 32px));
    margin: 0 auto;

    /* 底下这一大段留白是给右下角那个固定定位的音乐播放器让位的：
       它高约 230px、离底 20px，页面滚到底时正好会盖住最后一行按钮
       （发留言、删除这一篇都吃过这个亏）。留够 260px，最后一行就翻到它上面去了。 */
    padding: 36px 0 260px;

    position: relative;
    z-index: 1;
    display: grid;
    gap: 20px;
    align-content: start;
}

/* ---------- 通用面板 ---------- */

.notes-head,
.notes-editor,
.notes-empty,
.notes-flash,
.note-article,
.note-pager a,
.note-pager-empty {
    border-radius: 24px;
    background: var(--card);
    border: 1px solid var(--border);
    backdrop-filter: blur(16px);
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.2);
}

.notes-head,
.notes-editor,
.notes-empty,
.notes-flash,
.note-article {
    padding: 28px;
}

/* ---------- 顶部标题 ---------- */

.notes-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
}

.notes-head-copy {
    min-width: 0;
}

.notes-head small,
.note-article-head small,
.notes-editor-head small,
.notes-empty small {
    color: rgba(255, 255, 255, 0.36);
    letter-spacing: 4px;
    font-size: 12px;
}

.notes-head h1 {
    margin: 12px 0 0;
    font-size: 32px;
}

.notes-head p {
    margin: 10px 0 0;
    color: var(--text-sub);
    line-height: 1.8;
}

.notes-head-actions {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.notes-draft-note {
    color: var(--text-sub);
    font-size: 12px;
}

/* ---------- 按钮 ---------- */
/* style.css 里那条全局 button 是「撑满整行、自动加外边距」的，
   手记这边按钮是零散排的，所以整组覆盖掉。 */

.notes-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: auto;
    min-height: 40px;
    margin: 0;
    padding: 0 18px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text);
    font: inherit;
    font-size: 13px;
    line-height: 1;
    text-align: center;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.notes-btn:hover {
    opacity: 1;
    transform: none;
    box-shadow: none;
    background: rgba(255, 255, 255, 0.09);
    border-color: rgba(216, 154, 199, 0.36);
}

.notes-btn-main {
    background: linear-gradient(135deg, rgba(139, 127, 209, 0.34), rgba(216, 154, 199, 0.26));
    border-color: rgba(216, 154, 199, 0.34);
    color: #fff;
    font-weight: 700;
}

.notes-btn-main:hover {
    background: linear-gradient(135deg, rgba(139, 127, 209, 0.46), rgba(216, 154, 199, 0.36));
    border-color: rgba(216, 154, 199, 0.52);
    box-shadow: 0 0 18px rgba(216, 154, 199, 0.16);
}

.notes-btn-ghost {
    background: transparent;
    color: var(--text-sub);
}

.notes-btn-danger {
    color: #f09595;
    border-color: rgba(240, 149, 149, 0.28);
}

.notes-btn-danger:hover {
    background: rgba(240, 149, 149, 0.14);
    border-color: rgba(240, 149, 149, 0.5);
}

.notes-btn-sm {
    min-height: 32px;
    padding: 0 12px;
    border-radius: 10px;
    font-size: 12px;
}

/* ---------- 提示条 ---------- */

.notes-flash {
    padding: 16px 22px;
    border-color: rgba(38, 200, 189, 0.32);
    font-size: 13px;
}

.notes-flash.is-error {
    border-color: rgba(240, 149, 149, 0.42);
    color: #f5bcbc;
}

/* ---------- 写作区 ---------- */

.notes-editor-head h2 {
    margin: 10px 0 0;
    font-size: 22px;
}

.notes-editor form {
    display: grid;
    gap: 12px;
    margin-top: 20px;
}

.notes-editor label {
    margin-top: 4px;
    color: rgba(255, 255, 255, 0.42);
    font-size: 12px;
    letter-spacing: 2px;
}

.notes-editor input[type="text"],
.notes-editor textarea {
    width: 100%;
    padding: 14px 16px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    outline: none;
    background: rgba(8, 10, 18, 0.52);
    color: var(--text);
    font: inherit;
    font-size: 14px;
    transition: border-color 0.18s ease;
}

.notes-editor input[type="text"]:focus,
.notes-editor textarea:focus {
    border-color: rgba(216, 154, 199, 0.42);
}

.notes-editor textarea {
    min-height: 320px;
    line-height: 1.9;
    resize: vertical;
}

.notes-editor-hint {
    margin: 0;
    color: var(--text-sub);
    font-size: 12px;
    line-height: 2;
}

.notes-editor-hint code {
    padding: 1px 6px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid var(--border);
    font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
    font-size: 12px;
}

.notes-editor-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.notes-editor-actions .notes-btn-preview {
    margin-left: auto;
}

/* ---------- 列表 ---------- */

.notes-list {
    display: grid;
    gap: 14px;
}

.note-card {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
    padding: 22px 26px;
    border-radius: 20px;
    background: var(--card);
    border: 1px solid var(--border);
    backdrop-filter: blur(16px);
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.2);
    transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
    /* 配合下面 .note-title a::after 的「拉伸点击区」：整张卡都能点进去 */
    position: relative;
    cursor: pointer;
}

.note-card:hover {
    background: var(--card-hover);
    border-color: rgba(216, 154, 199, 0.24);
    transform: translateY(-2px);
}

.note-card.is-draft {
    border-style: dashed;
}

.note-card-main {
    flex: 1 1 320px;
    min-width: 0;
}

.note-card-actions {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 8px;
    padding-top: 24px;
    /* 抬到「拉伸点击区」上面，否则编辑 / 收回 会被那层铺住点不到 */
    position: relative;
    z-index: 2;
}

.notes-inline-form {
    display: inline-flex;
    margin: 0;
}

/* ---------- 笔名（登录 / 署名 / 投稿字段） ---------- */

/* 已登录时顶栏那颗小胶囊 */
.notes-author-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 5px 6px 5px 14px;
    border-radius: 999px;
    border: 1px solid rgba(216, 154, 199, 0.28);
    background: rgba(216, 154, 199, 0.1);
    color: var(--text);
    font-size: 12px;
    letter-spacing: 0.5px;
}

.notes-author-drafts {
    color: var(--text-sub);
    font-size: 11px;
}

/* 胶囊里那个「退出」——做成没有边框的小按钮，塞得进去 */
.notes-link-btn {
    width: auto;
    margin: 0;
    padding: 4px 10px;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-sub);
    font: inherit;
    font-size: 11px;
    line-height: 1;
    cursor: pointer;
    transition: background 0.18s ease, color 0.18s ease;
}

.notes-link-btn:hover {
    background: rgba(255, 255, 255, 0.16);
    color: var(--text);
    transform: none;
}

.notes-pending-note {
    color: var(--pink);
    font-size: 12px;
    letter-spacing: 0.5px;
}

/* 笔名登录：一个视觉隐藏的 checkbox 当开关（零脚本），
   展开块放在标题栏**外面**，展开时把下面的内容往下推 —— 不做浮层，
   就不会再出现"被卡片盖住、文字透过来"那种事。
   注意：标题栏那块有 backdrop-filter，会锁住内部层级，
   浮层放它里面的话，z-index 写多大都盖不过后面的卡片。 */
.notes-login-check {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

.notes-login-panel {
    display: none;
}

.notes-login-check:checked + .notes-login-panel {
    display: block;
}

/* 那个「笔名登录」其实是个 <label>，得让它摸起来像按钮 */
.notes-login-open {
    cursor: pointer;
    user-select: none;
}

.notes-login-form {
    display: grid;
    gap: 10px;
    padding: 18px 22px;
    border-radius: 20px;
    border: 1px solid var(--border);
    background: var(--card);
    backdrop-filter: blur(16px);
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.2);
}

/* 署名 / 密码 / 登录挤在一行 */
.notes-login-fields {
    display: grid;
    grid-template-columns: auto minmax(110px, 1fr) auto minmax(110px, 1fr) auto;
    align-items: center;
    gap: 10px;
}

.notes-login-fields label {
    color: var(--text-sub);
    font-size: 12px;
    white-space: nowrap;
}

.notes-login-fields input {
    width: 100%;
    margin: 0;
    padding: 9px 12px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.06);
    color: var(--text);
    font: inherit;
    font-size: 13px;
}

.notes-login-fields input:focus {
    outline: 2px solid rgba(216, 154, 199, 0.42);
    outline-offset: 1px;
}

.notes-login-fields .notes-btn {
    width: auto;
    margin: 0;
}

.notes-login-error {
    margin: 0;
    color: #f5bcbc;
    font-size: 12px;
    line-height: 1.6;
}

.notes-login-hint {
    margin: 0;
    color: rgba(255, 255, 255, 0.36);
    font-size: 11px;
    line-height: 1.7;
}

/* 第一次投稿时那段说明 */
.notes-signup {
    display: grid;
    gap: 5px;
    margin-top: 18px;
    padding: 16px 20px;
    border-radius: 14px;
    border: 1px solid rgba(216, 154, 199, 0.24);
    background: rgba(216, 154, 199, 0.07);
    font-size: 13px;
    line-height: 1.75;
}

.notes-signup strong {
    color: var(--text);
    font-size: 14px;
}

.notes-signup p {
    margin: 0;
    color: var(--text-sub);
}

.notes-signup p.is-warn {
    color: #f5bcbc;
}

/* 写作表单里的署名 / 密码 */
.notes-author-fields {
    display: grid;
    gap: 8px;
    padding-bottom: 4px;
}

.notes-field-hint {
    margin: 0;
    color: rgba(255, 255, 255, 0.34);
    font-size: 11px;
    line-height: 1.7;
}

/* 卡片 / 文章头上的署名 */
.note-author {
    color: rgba(216, 154, 199, 0.82);
    font-size: 12px;
    letter-spacing: 0.5px;
}

/* 待审核：卡片描一圈暖色，徽章也换成琥珀色 */
.note-card.is-pending {
    border-color: rgba(239, 159, 39, 0.34);
}

.note-badge.is-pending,
.home-journal-badge.is-pending {
    border-color: rgba(239, 159, 39, 0.42);
    background: rgba(239, 159, 39, 0.14);
    color: #ef9f27;
}

.notes-btn-approve {
    background: linear-gradient(135deg, rgba(239, 159, 39, 0.28), rgba(216, 154, 199, 0.2));
    border-color: rgba(239, 159, 39, 0.42);
    color: #fff;
    font-weight: 700;
}

.notes-btn-approve:hover {
    background: linear-gradient(135deg, rgba(239, 159, 39, 0.44), rgba(216, 154, 199, 0.3));
    border-color: rgba(239, 159, 39, 0.6);
}

.note-card-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    color: rgba(255, 255, 255, 0.42);
    font-size: 12px;
    letter-spacing: 1px;
}

.note-badge {
    padding: 2px 9px;
    border-radius: 999px;
    border: 1px solid rgba(216, 154, 199, 0.36);
    background: rgba(216, 154, 199, 0.14);
    color: var(--pink);
    font-size: 11px;
    letter-spacing: 1px;
}

.note-edited {
    color: rgba(255, 255, 255, 0.28);
    font-size: 11px;
}

/* 列表卡片上的「N 条留言」 */
.note-card-comments {
    color: rgba(255, 255, 255, 0.36);
    font-size: 11px;
    letter-spacing: 1px;
}

.note-title {
    margin: 10px 0 0;
    font-size: 20px;
    line-height: 1.5;
}

.note-title a {
    color: var(--text);
    text-decoration: none;
    transition: color 0.18s ease;
}

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

/* 整张卡片都能点进去：用伪元素把标题那个链接「拉伸」铺满整张卡。
   卡片自己设了 position: relative，所以 inset: 0 指的就是整张卡的范围。
   （右侧的编辑 / 收回 按钮靠 .note-card-actions 的 z-index 压在它上面） */
.note-title a::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
}

.note-excerpt {
    margin: 8px 0 0;
    color: var(--text-sub);
    font-size: 13px;
    line-height: 1.85;
}

/* ---------- 空状态 ---------- */

.notes-empty {
    text-align: center;
}

.notes-empty h2 {
    margin: 14px 0 0;
    font-size: 20px;
}

.notes-empty p {
    margin: 10px 0 0;
    color: var(--text-sub);
    line-height: 1.8;
}

.notes-empty .notes-btn {
    margin-top: 6px;
}

/* ---------- 单篇阅读 ---------- */

.note-back {
    font-size: 13px;
}

/* 做成圆角小胶囊，跟旁边主题切换器的样式对齐；裸文字在这套界面里显得太"方" */
.note-back a {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 0 16px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-sub);
    text-decoration: none;
    transition: color 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.note-back a:hover {
    color: var(--pink);
    border-color: rgba(216, 154, 199, 0.4);
    background: rgba(216, 154, 199, 0.12);
}

.note-article {
    /* 正文整体往右让出左侧装订区（约 56px），保证字和孔洞永不重叠 */
    padding: 36px 40px 36px 96px;
    position: relative;
    overflow: hidden;
}

/* 左侧装订条：一条比纸面略深的窄带 */
.note-article::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 56px;
    background: rgba(0, 0, 0, 0.18);
    pointer-events: none;
}

/* 装订条上的圆孔：用 radial-gradient 平铺出一排竖着的圆。
   每个孔 = 深色圆底（凹下去）+ 下缘一点浅色高光（打孔器留下的反光）。 */
.note-article::after {
    content: "";
    position: absolute;
    top: 16px;
    bottom: 24px;
    /* 格子必须比孔径宽（孔含高光圈约 18px，格子 24px），
       否则超出格子的部分会被平切 —— 浅色纸上一眼就能看到左右切口 */
    left: 16px;
    width: 24px;
    background:
        radial-gradient(
            circle at 50% 68%,
            #08090d 0,
            #08090d 3px,
            rgba(255, 255, 255, 0.16) 4px,
            rgba(255, 255, 255, 0.16) 5px,
            #08090d 6px,
            #08090d 8px,
            transparent 9px
        );
    background-size: 24px 48px;
    /* round：把 48px 的格子间距自动微调到刚好整除纸高 ——
       最后一孔永远不会被切成半个（repeat-y 会切，就是那个 bug） */
    background-repeat: round;
    background-position: top center;
    pointer-events: none;
}

.note-article-head h1 {
    margin: 12px 0 0;
    font-size: 32px;
    line-height: 1.4;
}

.note-article-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 14px;
    color: rgba(255, 255, 255, 0.42);
    font-size: 12px;
    letter-spacing: 1px;
}

.note-article-admin {
    margin-top: 34px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

/* ---------- 正文排版 ---------- */

.note-body {
    margin-top: 28px;
    color: var(--text);
    font-size: 15px;
    line-height: 1.95;
    overflow-wrap: break-word;
}

.note-body > *:first-child {
    margin-top: 0;
}

.note-body > *:last-child {
    margin-bottom: 0;
}

.note-body p {
    margin: 0 0 18px;
}

/* 随笔配图：最宽不超过正文，竖图也不会把版面顶开 */
.note-body .note-image {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 14px auto;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--bg-sub);
    box-shadow: 0 12px 28px var(--soft-shadow);
}

.note-body h2 {
    margin: 30px 0 14px;
    font-size: 22px;
}

.note-body h3 {
    margin: 26px 0 12px;
    font-size: 18px;
}

.note-body h4 {
    margin: 22px 0 10px;
    font-size: 16px;
}

.note-body ul,
.note-body ol {
    margin: 0 0 18px;
    padding-left: 26px;
}

.note-body li {
    margin: 6px 0;
}

.note-body blockquote {
    margin: 0 0 18px;
    padding: 6px 0 6px 18px;
    border-left: 2px solid rgba(216, 154, 199, 0.42);
    color: var(--text-sub);
}

.note-body hr {
    margin: 28px 0;
    border: 0;
    border-top: 1px solid var(--border);
}

.note-body code {
    padding: 2px 6px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid var(--border);
    font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
    font-size: 13px;
}

.note-body a {
    color: var(--blue);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.note-body a:hover {
    color: var(--pink);
}

/* ---------- 上一篇 / 下一篇 ---------- */

.note-pager {
    display: flex;
    align-items: stretch;
    gap: 14px;
    flex-wrap: wrap;
}

.note-pager a,
.note-pager-empty {
    flex: 1 1 260px;
    min-width: 0;
    display: grid;
    gap: 8px;
    align-content: center;
    padding: 18px 22px;
    min-height: 84px;
    color: var(--text);
    text-decoration: none;
    transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.note-pager a:hover {
    background: var(--card-hover);
    border-color: rgba(216, 154, 199, 0.28);
    transform: translateY(-2px);
}

.note-pager span {
    color: rgba(255, 255, 255, 0.4);
    font-size: 11px;
    letter-spacing: 2px;
}

.note-pager strong {
    font-size: 14px;
    font-weight: 500;
    line-height: 1.6;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.note-pager .is-next {
    text-align: right;
}

.note-pager-empty {
    opacity: 0.34;
}

/* =========================
   留言区（在单篇手记的最下面）
========================= */

.note-comments {
    padding: 28px;
    border-radius: 24px;
    background: var(--card);
    border: 1px solid var(--border);
    backdrop-filter: blur(16px);
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.2);
}

.note-comments-head {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.note-comments-head small {
    color: rgba(255, 255, 255, 0.36);
    letter-spacing: 4px;
    font-size: 12px;
}

.note-comments-head h2 {
    margin: 0;
    font-size: 20px;
}

.note-comments-count {
    margin-left: 8px;
    padding: 2px 10px;
    border-radius: 999px;
    border: 1px solid rgba(216, 154, 199, 0.32);
    background: rgba(216, 154, 199, 0.12);
    color: var(--pink);
    font-size: 12px;
    vertical-align: 2px;
}

.note-comments-empty {
    margin: 18px 0 0;
    color: var(--text-sub);
    font-size: 13px;
    line-height: 1.8;
}

.note-comment-flash {
    margin-top: 18px;
    padding: 14px 18px;
    border-radius: 14px;
    font-size: 13px;
    line-height: 1.7;
}

.note-comment-flash p {
    margin: 0;
}

.note-comment-flash p + p {
    margin-top: 6px;
}

.note-comment-flash.is-error {
    border: 1px solid rgba(240, 149, 149, 0.42);
    background: rgba(240, 149, 149, 0.08);
    color: #f5bcbc;
}

/* ---------- 留言列表 ---------- */

.note-comment-list {
    display: grid;
    gap: 12px;
    margin-top: 20px;
}

.note-comment {
    padding: 16px 20px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.035);
    border: 1px solid var(--border);
    scroll-margin-top: 24px;
}

/* 站长自己发的：换个颜色，一眼能认出来 */
.note-comment.is-author {
    background: rgba(216, 154, 199, 0.07);
    border-color: rgba(216, 154, 199, 0.28);
}

.note-comment-head {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.note-comment-name {
    color: var(--text);
    font-size: 14px;
    font-weight: 700;
}

.note-comment-badge {
    padding: 1px 8px;
    border-radius: 999px;
    border: 1px solid rgba(216, 154, 199, 0.4);
    background: rgba(216, 154, 199, 0.16);
    color: var(--pink);
    font-size: 11px;
    letter-spacing: 1px;
}

.note-comment-time {
    color: rgba(255, 255, 255, 0.34);
    font-size: 11px;
    letter-spacing: 1px;
}

/* 删除按钮推到最右边；表单本身不占位（不然 flex 会多出一块空白） */
.note-comment-del {
    display: inline-flex;
    margin: 0 0 0 auto;
}

.note-comment-text {
    margin: 10px 0 0;
    color: var(--text);
    font-size: 14px;
    line-height: 1.85;
    overflow-wrap: break-word;
}

/* ---------- 留言表单 ---------- */

.note-comment-form {
    display: grid;
    gap: 10px;
    margin-top: 24px;
    padding-top: 22px;
    border-top: 1px solid var(--border);
}

.note-comment-form label {
    margin-top: 2px;
    color: rgba(255, 255, 255, 0.42);
    font-size: 12px;
    letter-spacing: 2px;
}

.note-comment-form input[type="text"],
.note-comment-form textarea {
    width: 100%;
    padding: 12px 16px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    outline: none;
    background: rgba(8, 10, 18, 0.52);
    color: var(--text);
    font: inherit;
    font-size: 14px;
    transition: border-color 0.18s ease;
}

.note-comment-form input[type="text"]:focus,
.note-comment-form textarea:focus {
    border-color: rgba(216, 154, 199, 0.42);
}

.note-comment-form textarea {
    min-height: 104px;
    line-height: 1.8;
    resize: vertical;
}

.note-comment-form-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
}

.note-comment-counter {
    color: var(--text-sub);
    font-size: 12px;
    letter-spacing: 1px;
}

.note-comment-hint {
    margin: 2px 0 0;
    color: rgba(255, 255, 255, 0.3);
    font-size: 12px;
    line-height: 1.7;
}

/* =========================
   字体颜色
   粉 / 紫 / 蓝 / 灰 直接引用主题变量，换樱、海、nyaneko 主题时会跟着变；
   其余几个是固定色，但在四套深色主题上都看得清。
   工具栏的色板和正文里的渲染共用同一套变量，改一处两边都跟着变。
========================= */

:root {
    --note-color-pink: var(--pink, #d89ac7);
    --note-color-purple: var(--purple, #8b7fd1);
    --note-color-blue: var(--blue, #7aa2d6);
    --note-color-teal: #26c8bd;
    --note-color-gold: #e5c776;
    --note-color-orange: #f0a66f;
    --note-color-red: #f09595;
    --note-color-gray: var(--text-sub, #9ea4b5);
}

.note-color-pink {
    color: var(--note-color-pink);
}

.note-color-purple {
    color: var(--note-color-purple);
}

.note-color-blue {
    color: var(--note-color-blue);
}

.note-color-teal {
    color: var(--note-color-teal);
}

.note-color-gold {
    color: var(--note-color-gold);
}

.note-color-orange {
    color: var(--note-color-orange);
}

.note-color-red {
    color: var(--note-color-red);
}

.note-color-gray {
    color: var(--note-color-gray);
}

/* ---------- 新格式在正文里的样子 ---------- */

.note-body del {
    color: var(--text-sub);
}

.note-body mark {
    padding: 1px 4px;
    border-radius: 4px;
    background: rgba(229, 199, 118, 0.28);
    color: var(--text);
}

.note-body pre {
    margin: 0 0 18px;
    padding: 16px 18px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: rgba(0, 0, 0, 0.34);
    overflow-x: auto;
}

.note-body pre code {
    padding: 0;
    border: 0;
    background: none;
    font-size: 13px;
    line-height: 1.75;
}

/* =========================
   编辑器：格式工具栏
========================= */

.notes-toolbar {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    padding: 8px 10px;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.035);
}

.notes-tool {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: auto;
    min-width: 38px;
    min-height: 30px;
    margin: 0;
    padding: 0 10px;
    border-radius: 8px;
    border: 1px solid transparent;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text);
    font: inherit;
    font-size: 12px;
    line-height: 1;
    cursor: pointer;
    transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

.notes-tool:hover {
    opacity: 1;
    transform: none;
    box-shadow: none;
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(216, 154, 199, 0.36);
}

.notes-tool[aria-expanded="true"] {
    background: rgba(216, 154, 199, 0.2);
    border-color: rgba(216, 154, 199, 0.5);
    color: var(--pink);
}

.notes-tool-sep {
    width: 1px;
    height: 20px;
    margin: 0 3px;
    background: var(--border);
}

/* ---------- 颜色色板（贴在「颜色」按钮下面） ---------- */

.notes-color-pop {
    position: fixed;
    z-index: 60;
    width: 224px;
    padding: 12px;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: rgba(18, 21, 32, 0.96);
    box-shadow: 0 22px 60px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(14px);
}

.notes-color-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.notes-color-dot {
    width: 100%;
    height: 30px;
    margin: 0;
    padding: 0;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    cursor: pointer;
    transition: transform 0.14s ease, border-color 0.14s ease;
}

.notes-color-dot:hover {
    opacity: 1;
    transform: scale(1.08);
    border-color: rgba(255, 255, 255, 0.55);
    box-shadow: none;
}

.notes-color-custom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--border);
    color: var(--text-sub);
    font-size: 12px;
}

.notes-color-custom input[type="color"] {
    width: 54px;
    height: 28px;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: transparent;
    cursor: pointer;
}

.notes-color-clear {
    width: 100%;
    min-height: 30px;
    margin: 10px 0 0;
    padding: 0;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-sub);
    font: inherit;
    font-size: 12px;
    cursor: pointer;
}

.notes-color-clear:hover {
    opacity: 1;
    transform: none;
    box-shadow: none;
    color: var(--text);
    border-color: rgba(216, 154, 199, 0.36);
}

/* ---------- 预览面板 ---------- */

.notes-preview {
    border-radius: 16px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.03);
    overflow: hidden;
}

.notes-preview-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 18px;
    border-bottom: 1px solid var(--border);
    color: var(--text-sub);
    font-size: 12px;
    letter-spacing: 1px;
}

.notes-preview-note {
    margin-left: auto;
    color: rgba(255, 255, 255, 0.28);
    font-size: 11px;
}

/* 预览面板的正文元素直接复用 .note-body 那一整套排版规则
   （HTML 里同时挂了这两个类），这里只把外边距和内边距改一下 */
.notes-preview-body {
    margin-top: 0;
    padding: 20px 22px;
}

/* =========================
   活页记事本纸面（.note-article 的视觉皮肤）
   + 浅色 / 深色 切换
========================= */

/* 默认（深色纸面）：炭灰纸。把原本的半透明卡片换成更实的纸面色。 */
.note-article {
    background:
        linear-gradient(160deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0) 40%),
        #1c1f2b;
    border-color: rgba(255, 255, 255, 0.07);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

/* 浅色纸面：米白纸 + 深字。由 note-theme.js 给 <html> 加 data-note-light="true" 触发。
   只换「这张纸」本身的颜色和纸上文字的颜色，侧边栏/背景/上一篇下一篇/留言区都不动。 */
html[data-note-light="true"] .note-article {
    background:
        linear-gradient(160deg, rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0) 40%),
        #f2efe6;
    border-color: rgba(0, 0, 0, 0.12);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

html[data-note-light="true"] .note-article::before {
    background: rgba(0, 0, 0, 0.08);
}

/* 浅色纸面上，标题 / 时间 / 正文 / 分隔线等全部换成深色 */
html[data-note-light="true"] .note-article-head h1 {
    color: #2c2a24;
}

html[data-note-light="true"] .note-article-head small {
    color: #8a8576;
}

html[data-note-light="true"] .note-article-meta {
    color: #6a6658;
}

html[data-note-light="true"] .note-article-meta .note-badge {
    color: #8a4f72;
    border-color: rgba(140, 80, 120, 0.4);
    background: rgba(140, 80, 120, 0.12);
}

html[data-note-light="true"] .note-article-admin {
    border-top-color: rgba(0, 0, 0, 0.12);
}

html[data-note-light="true"] .note-body {
    color: #2c2a24;
}

html[data-note-light="true"] .note-body h2,
html[data-note-light="true"] .note-body h3,
html[data-note-light="true"] .note-body h4 {
    color: #2c2a24;
}

html[data-note-light="true"] .note-body blockquote {
    color: #5a5648;
    border-left-color: rgba(140, 80, 120, 0.4);
}

html[data-note-light="true"] .note-body hr {
    border-top-color: rgba(0, 0, 0, 0.14);
}

html[data-note-light="true"] .note-body code {
    background: rgba(0, 0, 0, 0.06);
    border-color: rgba(0, 0, 0, 0.14);
    color: #3a2f45;
}

html[data-note-light="true"] .note-body del {
    color: #7a766a;
}

html[data-note-light="true"] .note-body mark {
    background: rgba(220, 180, 80, 0.3);
    color: #2c2a24;
}

html[data-note-light="true"] .note-body pre {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.12);
}

html[data-note-light="true"] .note-body pre code {
    color: #2c2a24;
}

/* 浅色纸面上，链接/字体颜色几个固定色也换成深色底上看得清的版本 */
html[data-note-light="true"] .note-body a {
    color: #185fa5;
}

html[data-note-light="true"] .note-body a:hover {
    color: #993556;
}

/* =========================
   浅色 / 深色 切换按钮（单个太阳/月亮图标，挂在纸的右上角）
========================= */

.note-light-toggle {
    position: absolute;
    top: 84px;
    right: -6px;
    z-index: 30;
    width: 38px;
    height: 38px;
    margin: 0;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: rgba(18, 21, 32, 0.88);
    color: var(--text-sub);
    cursor: pointer;
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(10px);
    transition: color 0.16s ease, border-color 0.16s ease, transform 0.16s ease;
}

.note-light-toggle:hover {
    color: var(--text);
    border-color: rgba(216, 154, 199, 0.42);
    transform: translateY(-1px);
}

/* 两个图标叠在同一格，按状态二选一显示 */
.note-light-toggle .note-light-icon {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.16s ease;
}

.note-light-toggle .note-light-icon.is-moon {
    opacity: 1;
}

.note-light-toggle.is-light .note-light-icon.is-moon {
    opacity: 0;
}

.note-light-toggle.is-light .note-light-icon.is-sun {
    opacity: 1;
    color: #c9932e;
}

/* =========================
   昼主题：浅底上把主按钮换成实心，避免白字压在淡粉渐变上看不清
========================= */

:root[data-theme="day"] .notes-btn-main {
    background: linear-gradient(135deg, rgba(111, 95, 174, 0.92), rgba(194, 103, 156, 0.88));
    border-color: rgba(111, 95, 174, 0.42);
    color: #fff;
}

:root[data-theme="day"] .notes-btn-main:hover {
    background: linear-gradient(135deg, rgba(111, 95, 174, 1), rgba(194, 103, 156, 0.96));
    border-color: rgba(111, 95, 174, 0.55);
    box-shadow: 0 6px 18px rgba(111, 95, 174, 0.18);
}

:root[data-theme="day"] .notes-btn-danger {
    color: #b0424a;
    border-color: rgba(176, 66, 74, 0.3);
}

:root[data-theme="day"] .notes-btn-danger:hover {
    background: rgba(176, 66, 74, 0.1);
    border-color: rgba(176, 66, 74, 0.45);
}
