@import url('/assets/css/main.css');

:root {
    --primary: #d39b5e;
    --secondary: #f4e1c6;
    --success: #2f855a;
    --danger: #e11d48;
    --warning: #d97706;
    --bg: #f5f1ea;
    --surface: #ffffff;
    --text: #1f2933;
    --text-secondary: #6b7280;
    --border: rgba(15, 23, 42, 0.08);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Arial, sans-serif;
    background: radial-gradient(circle at top left, #f9f3e7 0, #f5f1ea 40%, #ece6dd 100%);
    color: var(--text);
}

.loading-screen {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    overflow: hidden;
    background:
        radial-gradient(circle at 14% 18%, rgba(229, 186, 105, 0.24), transparent 30%),
        radial-gradient(circle at 82% 16%, rgba(113, 71, 32, 0.18), transparent 24%),
        linear-gradient(145deg, #f8f3eb 0%, #efe5d7 52%, #f6efe4 100%);
}

.loading-screen-noise {
    position: absolute;
    inset: 0;
    opacity: 0.34;
    background-image:
        linear-gradient(rgba(123, 88, 46, 0.06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(123, 88, 46, 0.05) 1px, transparent 1px);
    background-size: 22px 22px;
    mask-image: radial-gradient(circle at center, black 45%, transparent 92%);
    pointer-events: none;
}

.loading-shell {
    position: relative;
    display: grid;
    grid-template-columns: minmax(220px, 290px) minmax(0, 1fr);
    gap: 34px;
    width: min(920px, 100%);
    padding: 32px;
    border-radius: 34px;
    background: linear-gradient(180deg, rgba(255, 250, 244, 0.8), rgba(255, 246, 235, 0.72));
    border: 1px solid rgba(141, 103, 58, 0.16);
    box-shadow:
        0 32px 80px rgba(38, 22, 6, 0.18),
        inset 0 1px 0 rgba(255, 255, 255, 0.72);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
}

.loading-shell::before {
    content: "";
    position: absolute;
    inset: 14px;
    border-radius: 26px;
    border: 1px solid rgba(255, 255, 255, 0.45);
    pointer-events: none;
}

.loading-visual {
    position: relative;
    min-height: 280px;
    border-radius: 28px;
    background:
        radial-gradient(circle at 50% 46%, rgba(255, 248, 236, 0.96), rgba(242, 226, 198, 0.82) 45%, rgba(214, 182, 132, 0.72) 100%);
    border: 1px solid rgba(156, 117, 70, 0.16);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.82),
        0 18px 36px rgba(117, 81, 39, 0.12);
    overflow: hidden;
}

.loading-visual::before,
.loading-visual::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    filter: blur(2px);
}

.loading-visual::before {
    width: 180px;
    height: 180px;
    top: -56px;
    right: -38px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.68), rgba(255, 255, 255, 0));
}

.loading-visual::after {
    width: 150px;
    height: 150px;
    bottom: -34px;
    left: -22px;
    background: radial-gradient(circle, rgba(205, 150, 69, 0.28), rgba(205, 150, 69, 0));
}

.loading-orbit {
    position: absolute;
    inset: 50%;
    border-radius: 50%;
    border: 1px solid rgba(137, 94, 42, 0.2);
    transform: translate(-50%, -50%);
}

.loading-orbit-a {
    width: 200px;
    height: 200px;
    animation: loadingOrbitSpin 14s linear infinite;
}

.loading-orbit-b {
    width: 148px;
    height: 148px;
    border-style: dashed;
    border-color: rgba(137, 94, 42, 0.28);
    animation: loadingOrbitSpinReverse 11s linear infinite;
}

.loading-orbit-c {
    width: 92px;
    height: 92px;
    border-color: rgba(228, 172, 86, 0.42);
    animation: loadingOrbitPulse 2.6s ease-in-out infinite;
}

.loading-core {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 116px;
    height: 116px;
    transform: translate(-50%, -50%);
    border-radius: 32px;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.92), rgba(251, 239, 216, 0.82));
    box-shadow:
        0 16px 34px rgba(134, 92, 45, 0.18),
        inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

.loading-core-ring,
.loading-core-dot {
    position: absolute;
    inset: 50%;
    transform: translate(-50%, -50%);
    border-radius: 50%;
}

.loading-core-ring {
    width: 54px;
    height: 54px;
    border: 6px solid rgba(216, 164, 82, 0.22);
    border-top-color: rgba(179, 118, 42, 0.86);
    animation: loadingOrbitSpin 1.1s linear infinite;
}

.loading-core-dot {
    width: 14px;
    height: 14px;
    background: linear-gradient(135deg, #f1b25e, #9a632d);
    box-shadow: 0 0 0 10px rgba(230, 177, 94, 0.16);
}

.loading-scanline {
    position: absolute;
    left: 12%;
    right: 12%;
    top: 18%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.82), transparent);
    box-shadow: 0 0 18px rgba(255, 255, 255, 0.75);
    animation: loadingScanline 3.4s ease-in-out infinite;
}

.loading-panel {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
}

.loading-kicker {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: rgba(89, 58, 27, 0.58);
    margin-bottom: 14px;
}

.loading-panel h1 {
    font-size: clamp(30px, 4vw, 46px);
    line-height: 1.04;
    color: #3f2811;
    margin-bottom: 12px;
}

.loading-message {
    font-size: clamp(18px, 2.2vw, 24px);
    line-height: 1.35;
    color: #5a3c1d;
    font-weight: 600;
    margin-bottom: 8px;
}

.loading-detail {
    font-size: 14px;
    line-height: 1.7;
    color: rgba(82, 58, 33, 0.74);
    max-width: 52ch;
    margin-bottom: 24px;
}

.loading-progress-block {
    margin-bottom: 18px;
}

.loading-progress-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    font-size: 12px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: rgba(91, 62, 30, 0.68);
    margin-bottom: 10px;
}

.loading-progress-meta strong {
    font-size: 16px;
    color: #6f451e;
}

.loading-progress-track {
    position: relative;
    height: 12px;
    border-radius: 999px;
    overflow: hidden;
    background: rgba(132, 92, 43, 0.1);
    box-shadow: inset 0 1px 2px rgba(63, 40, 17, 0.08);
}

.loading-progress-fill {
    position: absolute;
    inset: 0 auto 0 0;
    border-radius: inherit;
    background:
        linear-gradient(90deg, rgba(151, 93, 33, 0.96), rgba(231, 175, 92, 0.96)),
        linear-gradient(90deg, rgba(255, 255, 255, 0.42), transparent);
    box-shadow: 0 8px 18px rgba(175, 117, 48, 0.24);
    transition: width 0.36s cubic-bezier(0.22, 1, 0.36, 1);
}

.loading-progress-fill::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.45), transparent);
    transform: translateX(-100%);
    animation: loadingProgressSweep 1.8s ease-in-out infinite;
}

.loading-stage-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.loading-stage-item {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    padding: 12px 14px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.44);
    border: 1px solid rgba(138, 101, 58, 0.08);
    color: rgba(87, 58, 28, 0.66);
    transition: transform 0.24s ease, border-color 0.24s ease, background 0.24s ease, color 0.24s ease;
}

.loading-stage-item.active {
    background: rgba(255, 250, 244, 0.8);
    border-color: rgba(187, 128, 58, 0.26);
    color: #5f3811;
    transform: translateY(-1px);
}

.loading-stage-item.done {
    background: rgba(244, 226, 195, 0.52);
    border-color: rgba(171, 114, 49, 0.14);
    color: rgba(96, 62, 28, 0.82);
}

.loading-stage-dot {
    width: 10px;
    height: 10px;
    flex-shrink: 0;
    border-radius: 50%;
    background: rgba(176, 119, 52, 0.18);
    box-shadow: 0 0 0 5px rgba(176, 119, 52, 0.08);
}

.loading-stage-item.active .loading-stage-dot {
    background: linear-gradient(135deg, #efb565, #9e632d);
    box-shadow: 0 0 0 7px rgba(239, 181, 101, 0.16);
    animation: loadingDotPulse 1.8s ease-in-out infinite;
}

.loading-stage-item.done .loading-stage-dot {
    background: #9e632d;
    box-shadow: 0 0 0 5px rgba(158, 99, 45, 0.12);
}

@keyframes loadingOrbitSpin {
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

@keyframes loadingOrbitSpinReverse {
    to {
        transform: translate(-50%, -50%) rotate(-360deg);
    }
}

@keyframes loadingOrbitPulse {
    0%,
    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }

    50% {
        transform: translate(-50%, -50%) scale(1.08);
        opacity: 0.82;
    }
}

@keyframes loadingScanline {
    0%,
    100% {
        transform: translateY(0);
        opacity: 0.22;
    }

    45% {
        transform: translateY(118px);
        opacity: 0.78;
    }

    55% {
        transform: translateY(132px);
        opacity: 0.35;
    }
}

@keyframes loadingProgressSweep {
    to {
        transform: translateX(100%);
    }
}

@keyframes loadingDotPulse {
    0%,
    100% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.12);
        opacity: 0.82;
    }
}

@media (max-width: 860px) {
    .loading-shell {
        grid-template-columns: 1fr;
        gap: 22px;
        padding: 24px;
    }

    .loading-visual {
        min-height: 220px;
    }

    .loading-stage-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 560px) {
    .loading-screen {
        padding: 16px;
    }

    .loading-shell {
        padding: 18px;
        border-radius: 26px;
    }

    .loading-visual {
        min-height: 180px;
        border-radius: 22px;
    }

    .loading-core {
        width: 94px;
        height: 94px;
        border-radius: 26px;
    }

    .loading-orbit-a {
        width: 152px;
        height: 152px;
    }

    .loading-orbit-b {
        width: 118px;
        height: 118px;
    }

    .loading-orbit-c {
        width: 76px;
        height: 76px;
    }

    .loading-panel h1 {
        font-size: 28px;
    }

    .loading-message {
        font-size: 17px;
    }

    .loading-detail {
        font-size: 13px;
        margin-bottom: 18px;
    }
}

.app-wrapper {
    --sidebar-width: 280px;
    background: linear-gradient(135deg, #f5f1ea 0%, #ece3d8 40%, #f7f2ea 100%);
}

.app-wrapper.sidebar-collapsed {
    --sidebar-width: 86px;
}

.sidebar {
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);
    background: rgba(255, 255, 255, 0.95);
    border-right: 1px solid rgba(148, 120, 84, 0.16);
    box-shadow: 6px 0 24px rgba(148, 120, 84, 0.12);
    transition: width 0.26s ease, min-width 0.26s ease, box-shadow 0.26s ease;
}

.sidebar.desktop-collapsed {
    width: 86px;
    min-width: 86px;
}

.sidebar-header {
    border-bottom: 1px solid rgba(148, 120, 84, 0.16);
    padding: 0px 20px;
    /* 进一步调整Logo位置，使其与右侧搜索框对齐 */
}

.logo {
    background: linear-gradient(135deg, #c48a3a, #e0b46a);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-top: -11px;
    /* 强制向上偏移 */
}

.nav-item {
    border-radius: 999px;
}

.nav-item:hover {
    background: rgba(211, 155, 94, 0.09);
}

.nav-item.active {
    background: linear-gradient(120deg, #c48a3a, #e0b46a);
    box-shadow: 0 10px 30px rgba(148, 120, 84, 0.35);
}

.nav-item-other {
    position: relative;
}

.nav-item-caret {
    margin-left: auto;
    font-size: 18px;
    opacity: 0.75;
}

.nav-submenu {
    display: grid;
    gap: 8px;
    margin: 6px 0 4px 14px;
    padding: 8px 0 8px 12px;
    border-left: 1px dashed rgba(148, 120, 84, 0.35);
}

.nav-sub-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: 12px;
    cursor: pointer;
    color: #6f5a44;
    transition: all 0.2s ease;
}

.nav-sub-item:hover {
    background: rgba(211, 155, 94, 0.12);
    color: #5f4428;
    transform: translateX(2px);
}

.nav-sub-item.active {
    background: rgba(196, 138, 58, 0.18);
    color: #5a4024;
    box-shadow: inset 0 0 0 1px rgba(196, 138, 58, 0.28);
}

.nav-sub-item svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.top-toolbar {
    background: rgba(255, 255, 255, 0.92);
    border-bottom: 1px solid rgba(148, 120, 84, 0.14);
    box-shadow: 0 8px 26px rgba(148, 120, 84, 0.14);
}

.desktop-sidebar-toggle {
    flex-shrink: 0;
}

.desktop-sidebar-toggle .material-symbols-outlined {
    font-size: 20px;
    line-height: 1;
}

.search-input input {
    background: #f4eee4;
}

.search-input input:focus {
    background: #fdfaf5;
    border-color: #d39b5e;
    box-shadow: 0 0 0 4px rgba(211, 155, 94, 0.18);
}

.memo-grid {
    background:
        radial-gradient(circle at top, rgba(248, 241, 230, 0.88), transparent 62%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.5), rgba(244, 236, 223, 0.68));
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 26px;
    padding: 26px 24px 30px;
}

.app-wrapper.sidebar-collapsed .memo-grid {
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 22px;
    padding: 22px 20px 28px;
}

.sidebar.desktop-collapsed~.main-area .memo-grid {
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 22px;
    padding: 22px 20px 28px;
}

.app-wrapper.sidebar-collapsed .sidebar-header,
.sidebar.desktop-collapsed .sidebar-header {
    padding: 8px 10px;
}

.app-wrapper.sidebar-collapsed .logo,
.sidebar.desktop-collapsed .logo {
    margin-top: 0;
    justify-content: center;
}

.app-wrapper.sidebar-collapsed .logo img,
.sidebar.desktop-collapsed .logo img {
    width: 56px !important;
}

.app-wrapper.sidebar-collapsed .nav-menu,
.sidebar.desktop-collapsed .nav-menu {
    padding: 14px 8px;
}

.app-wrapper.sidebar-collapsed .nav-item,
.sidebar.desktop-collapsed .nav-item {
    justify-content: center;
    gap: 0;
    padding: 12px 10px;
    border-radius: 14px;
}

.app-wrapper.sidebar-collapsed .nav-item span,
.sidebar.desktop-collapsed .nav-item span {
    display: none;
}

.app-wrapper.sidebar-collapsed .sidebar.desktop-collapsed:not(:hover) .nav-item-caret,
.sidebar.desktop-collapsed:not(:hover) .nav-item-caret,
.app-wrapper.sidebar-collapsed .sidebar.desktop-collapsed:not(:hover) .nav-submenu,
.sidebar.desktop-collapsed:not(:hover) .nav-submenu {
    display: none !important;
}

.app-wrapper.sidebar-collapsed .nav-item:hover,
.sidebar.desktop-collapsed .nav-item:hover {
    transform: translateY(-2px);
}

.app-wrapper.sidebar-collapsed .user-panel,
.sidebar.desktop-collapsed .user-panel {
    display: none;
}

@media (hover: hover) and (pointer: fine) {
    .app-wrapper.sidebar-collapsed .sidebar.desktop-collapsed:hover {
        width: 280px;
        min-width: 280px;
        box-shadow: 8px 0 28px rgba(148, 120, 84, 0.2);
    }

    .app-wrapper.sidebar-collapsed .sidebar.desktop-collapsed:hover .sidebar-header {
        padding: 0 20px;
    }

    .app-wrapper.sidebar-collapsed .sidebar.desktop-collapsed:hover .logo {
        margin-top: -11px;
        justify-content: flex-start;
    }

    .app-wrapper.sidebar-collapsed .sidebar.desktop-collapsed:hover .logo img {
        width: 100% !important;
    }

    .app-wrapper.sidebar-collapsed .sidebar.desktop-collapsed:hover .nav-menu {
        padding: 20px 12px;
    }

    .app-wrapper.sidebar-collapsed .sidebar.desktop-collapsed:hover .nav-item {
        justify-content: flex-start;
        gap: 12px;
        padding: 14px 18px;
        border-radius: 999px;
    }

    .app-wrapper.sidebar-collapsed .sidebar.desktop-collapsed:hover .nav-item span {
        display: inline;
    }

    .app-wrapper.sidebar-collapsed .sidebar.desktop-collapsed:hover .user-panel {
        display: block;
    }

    .app-wrapper.sidebar-collapsed .sidebar.desktop-collapsed:hover~.main-area .memo-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 26px;
        padding: 26px 24px 30px;
    }
}

.memo-card {
    --note-bg: #fffef8;
    --note-line: rgba(93, 93, 93, 0.13);
    --note-border: rgba(152, 122, 87, 0.34);
    --note-tape-left: rgba(253, 197, 184, 0.72);
    --note-tape-right: rgba(175, 220, 235, 0.78);
    --note-tilt: 0deg;
    --note-hover-x: 2deg;
    --note-hover-y: -2.6deg;
    --note-row-height: 26px;
    --note-row-thickness: 1px;
    --tape-a-width: 72px;
    --tape-a-height: 22px;
    --tape-a-top: -9px;
    --tape-a-left: 14px;
    --tape-a-rotate: -26deg;
    --tape-a-opacity: 0.88;
    --tape-b-width: 68px;
    --tape-b-height: 20px;
    --tape-b-top: -8px;
    --tape-b-right: 14px;
    --tape-b-rotate: 22deg;
    --tape-b-opacity: 0.84;
    border-radius: 8px;
    background-color: var(--note-bg);
    background-image:
        linear-gradient(to bottom, rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0) 34px),
        radial-gradient(circle at 7px 7px,
            rgba(255, 255, 255, 0.98) 0 3.8px,
            rgba(0, 0, 0, 0.18) 3.8px 4.8px,
            transparent 5px);
    background-size: auto, 30px 14px;
    background-repeat: no-repeat, repeat-x;
    background-position: 0 0, 18px 10px;
    border: 2px solid var(--note-border);
    border-bottom-width: 4px;
    box-shadow:
        0 12px 24px rgba(0, 0, 0, 0.08),
        0 6px 0 rgba(0, 0, 0, 0.05),
        0 0 0 1px rgba(255, 255, 255, 0.45) inset;
    padding: 52px 18px 18px;
    min-height: 336px;
    box-sizing: border-box;
    position: relative;
    overflow: hidden;
    transform-origin: 50% 18%;
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    will-change: transform;
    cursor: pointer;
    transform: translate3d(0, 0, 0) perspective(980px) rotateX(0deg) rotateY(0deg) rotate(var(--note-tilt));
    transition: transform 0.28s cubic-bezier(0.2, 0.65, 0.25, 1), box-shadow 0.28s ease, border-color 0.24s ease, filter 0.24s ease;
}

.memo-card>* {
    position: relative;
    z-index: 12;
    transform: translateZ(0);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

.memo-card::before,
.memo-card::after {
    content: '';
    position: absolute;
    pointer-events: none;
    border-radius: 3px;
    clip-path: polygon(4% 0, 95% 0, 100% 18%, 96% 100%, 7% 100%, 0 84%);
    background-image: linear-gradient(145deg, rgba(255, 255, 255, 0.45), rgba(255, 255, 255, 0.08) 42%, rgba(255, 255, 255, 0.22));
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow:
        0 4px 10px rgba(66, 51, 35, 0.2),
        inset 0 0 0 1px rgba(255, 255, 255, 0.2);
    z-index: 3;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

.memo-card::before {
    width: var(--tape-a-width);
    height: var(--tape-a-height);
    top: var(--tape-a-top);
    left: var(--tape-a-left);
    opacity: var(--tape-a-opacity);
    background-color: var(--note-tape-left);
    transform: translate3d(0, 0, 0) rotate(var(--tape-a-rotate));
}

.memo-card::after {
    width: var(--tape-b-width);
    height: var(--tape-b-height);
    top: var(--tape-b-top);
    right: var(--tape-b-right);
    opacity: var(--tape-b-opacity);
    background-color: var(--note-tape-right);
    transform: translate3d(0, 0, 0) rotate(var(--tape-b-rotate));
}

.memo-card:hover {
    border-color: rgba(123, 94, 66, 0.72);
    box-shadow:
        0 22px 40px rgba(67, 50, 32, 0.26),
        0 14px 26px rgba(0, 0, 0, 0.14),
        0 0 0 1px rgba(255, 255, 255, 0.38) inset,
        inset -18px 16px 0 -14px rgba(255, 255, 255, 0.55),
        inset -26px 22px 0 -20px rgba(198, 166, 126, 0.28);
    transform: translate3d(0, -10px, 0) perspective(980px) rotateX(var(--note-hover-x)) rotateY(var(--note-hover-y)) rotate(var(--note-tilt)) scale(1.035);
    z-index: 8;
}

.memo-card:active {
    transform: translate3d(0, -3px, 0) perspective(980px) rotateX(2deg) rotateY(var(--note-hover-y)) rotate(var(--note-tilt)) scale(1.012);
}

.memo-card.memo-color-yellow {
    --note-bg: #f7e7bf;
    --note-line: rgba(167, 122, 33, 0.2);
    --note-border: rgba(155, 113, 30, 0.41);
    --note-tape-left: rgba(248, 188, 171, 0.7);
    --note-tape-right: rgba(181, 222, 238, 0.78);
}

.memo-card.memo-color-green {
    --note-bg: #d9f2e3;
    --note-line: rgba(68, 150, 94, 0.18);
    --note-border: rgba(63, 133, 85, 0.38);
    --note-tape-left: rgba(246, 228, 145, 0.74);
    --note-tape-right: rgba(245, 212, 158, 0.72);
}

.memo-card.memo-color-blue {
    --note-bg: #cfe7fb;
    --note-line: rgba(72, 136, 186, 0.18);
    --note-border: rgba(66, 119, 161, 0.4);
    --note-tape-left: rgba(248, 201, 184, 0.74);
    --note-tape-right: rgba(193, 227, 240, 0.76);
}

.memo-card.memo-color-pink {
    --note-bg: #ffd8d2;
    --note-line: rgba(187, 96, 88, 0.16);
    --note-border: rgba(165, 81, 74, 0.36);
    --note-tape-left: rgba(186, 226, 239, 0.78);
    --note-tape-right: rgba(244, 213, 208, 0.72);
}

.memo-card.memo-color-orange {
    --note-bg: #ffe7cf;
    --note-line: rgba(188, 128, 62, 0.18);
    --note-border: rgba(170, 112, 47, 0.36);
    --note-tape-left: rgba(247, 193, 179, 0.73);
    --note-tape-right: rgba(188, 227, 239, 0.78);
}

.memo-card.memo-color-purple {
    --note-bg: #ecdefe;
    --note-line: rgba(126, 98, 168, 0.17);
    --note-border: rgba(110, 84, 151, 0.36);
    --note-tape-left: rgba(250, 209, 198, 0.74);
    --note-tape-right: rgba(194, 228, 241, 0.78);
}

.memo-card.memo-color-neutral,
.memo-card.memo-color-default {
    --note-bg: #f8f8f7;
    --note-line: rgba(136, 136, 136, 0.14);
    --note-border: rgba(145, 145, 145, 0.34);
    --note-tape-left: rgba(248, 205, 189, 0.7);
    --note-tape-right: rgba(196, 228, 239, 0.75);
}

.memo-card.memo-tape-v-1 {
    --note-tilt: -0.72deg;
    --note-hover-y: -3deg;
    --tape-a-width: 76px;
    --tape-a-height: 24px;
    --tape-a-top: -10px;
    --tape-a-left: 10px;
    --tape-a-rotate: -30deg;
    --tape-b-width: 78px;
    --tape-b-height: 22px;
    --tape-b-top: calc(100% - 25px);
    --tape-b-right: 8px;
    --tape-b-rotate: -30deg;
}

.memo-card.memo-tape-v-2 {
    --note-tilt: 0.68deg;
    --note-hover-y: 3deg;
    --tape-a-width: 26px;
    --tape-a-height: 84px;
    --tape-a-top: -10px;
    --tape-a-left: 22px;
    --tape-a-rotate: -6deg;
    --tape-b-width: 74px;
    --tape-b-height: 22px;
    --tape-b-top: -10px;
    --tape-b-right: 18px;
    --tape-b-rotate: 24deg;
}

.memo-card.memo-tape-v-3 {
    --note-tilt: -0.52deg;
    --note-hover-y: -2.8deg;
    --tape-a-width: 70px;
    --tape-a-height: 22px;
    --tape-a-top: -9px;
    --tape-a-left: 8px;
    --tape-a-rotate: -20deg;
    --tape-b-width: 24px;
    --tape-b-height: 82px;
    --tape-b-top: -12px;
    --tape-b-right: 16px;
    --tape-b-rotate: 8deg;
}

.memo-card.memo-tape-v-4 {
    --note-tilt: 0.82deg;
    --note-hover-y: 2.8deg;
    --tape-a-width: 24px;
    --tape-a-height: 82px;
    --tape-a-top: -10px;
    --tape-a-left: calc(50% - 12px);
    --tape-a-rotate: 2deg;
    --tape-b-width: 24px;
    --tape-b-height: 72px;
    --tape-b-top: -8px;
    --tape-b-right: 24px;
    --tape-b-rotate: -8deg;
}

.memo-card.memo-tape-v-5 {
    --note-tilt: -0.24deg;
    --note-hover-y: -2.5deg;
    --tape-a-width: 26px;
    --tape-a-height: 76px;
    --tape-a-top: -10px;
    --tape-a-left: 16px;
    --tape-a-rotate: -8deg;
    --tape-b-width: 24px;
    --tape-b-height: 72px;
    --tape-b-top: -8px;
    --tape-b-right: 14px;
    --tape-b-rotate: 8deg;
}

.memo-card.memo-tape-v-6 {
    --note-tilt: 0.42deg;
    --note-hover-y: 2.5deg;
    --tape-a-width: 74px;
    --tape-a-height: 22px;
    --tape-a-top: -10px;
    --tape-a-left: 12px;
    --tape-a-rotate: -38deg;
    --tape-b-width: 24px;
    --tape-b-height: 86px;
    --tape-b-top: 8px;
    --tape-b-right: -8px;
    --tape-b-rotate: 10deg;
}

.memo-card.memo-tape-v-7 {
    --note-tilt: -0.86deg;
    --note-hover-y: -3.2deg;
    --tape-a-width: 68px;
    --tape-a-height: 20px;
    --tape-a-top: -8px;
    --tape-a-left: 10px;
    --tape-a-rotate: -16deg;
    --tape-b-width: 76px;
    --tape-b-height: 20px;
    --tape-b-top: calc(100% - 24px);
    --tape-b-right: 10px;
    --tape-b-rotate: 24deg;
}

.memo-card.memo-tape-v-8 {
    --note-tilt: 0.22deg;
    --note-hover-y: 3.1deg;
    --tape-a-width: 82px;
    --tape-a-height: 20px;
    --tape-a-top: -10px;
    --tape-a-left: calc(50% - 42px);
    --tape-a-rotate: 4deg;
    --tape-b-width: 24px;
    --tape-b-height: 74px;
    --tape-b-top: -9px;
    --tape-b-right: 18px;
    --tape-b-rotate: -4deg;
}

.memo-card.selected {
    border-color: rgba(103, 77, 49, 0.72);
    box-shadow:
        0 18px 34px rgba(87, 65, 42, 0.3),
        0 0 0 2px rgba(200, 152, 94, 0.45),
        0 0 0 1px rgba(255, 255, 255, 0.35) inset;
}

/* 文档卡片保持文件风格 */
.memo-card.document-card {
    min-height: 336px;
}

.memo-card.document-card::before,
.memo-card.document-card::after {
    display: none;
}

/* 备忘录预览区 */
.memo-card:not(.document-card) {
    min-height: 336px;
}

/* 标题加粗放大 */
.memo-card:not(.document-card) .memo-title {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 1;
    overflow: hidden;
    min-height: 30px;
    font-size: 21px;
    font-weight: 800;
    color: #1c1c1c;
    letter-spacing: 0.01em;
    text-align: center;
    margin-top: -2px;
    margin-bottom: 6px;
    line-height: 30px;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.45);
    z-index: 13;
}

.memo-card:not(.document-card) .memo-title.memo-title-long {
    text-align: left;
}

.memo-card:not(.document-card) .memo-date {
    font-size: 12px;
    font-weight: 600;
    color: rgba(34, 34, 34, 0.58);
    line-height: 24px;
    margin-bottom: 8px;
    z-index: 13;
}

/* 默认预览9行，不溢出 */
.memo-card:not(.document-card) .memo-preview {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 9;
    line-clamp: 9;
    min-height: calc(var(--note-row-height) * 9 + 2px);
    max-height: calc(var(--note-row-height) * 9 + 2px);
    overflow: hidden;
    font-size: 15px;
    line-height: var(--note-row-height);
    color: rgba(26, 26, 26, 0.88);
    font-weight: 500;
    letter-spacing: 0.01em;
    background-image:
        repeating-linear-gradient(to bottom,
            transparent 0 calc(var(--note-row-height) - var(--note-row-thickness)),
            var(--note-line) calc(var(--note-row-height) - var(--note-row-thickness)) var(--note-row-height));
    background-repeat: repeat-y;
    background-size: 100% var(--note-row-height);
    background-position: 0 3px;
    padding-top: 2px;
    z-index: 13;
}

.memo-card.memo-completed:not(.document-card) .memo-preview {
    text-decoration-line: line-through;
    text-decoration-thickness: 1.5px;
    text-decoration-color: rgba(54, 54, 54, 0.62);
}

.memo-card.document-card:hover {
    transform: perspective(980px) translateY(-10px) rotateX(var(--note-hover-x)) rotateY(var(--note-hover-y)) rotate(var(--note-tilt)) scale(1.035);
}

.memo-card.document-card .doc-card-title {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 1;
    overflow: hidden;
}

@media (max-width: 1080px) {
    .memo-grid {
        grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    }

    .app-wrapper.sidebar-collapsed .memo-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 24px;
        padding: 24px 20px 28px;
    }

    .sidebar.desktop-collapsed~.main-area .memo-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 24px;
        padding: 24px 20px 28px;
    }
}

@media (max-width: 860px) {
    .memo-grid {
        grid-template-columns: 1fr;
        gap: 18px;
        padding: 18px 14px 24px;
    }

    .memo-card,
    .memo-card.document-card,
    .memo-card:not(.document-card) {
        --note-row-height: 24px;
        min-height: 300px;
    }

    .memo-card:not(.document-card) .memo-title {
        font-size: 19px;
        line-height: 28px;
    }

    .memo-card:not(.document-card) .memo-preview {
        -webkit-line-clamp: 7;
        line-clamp: 7;
        min-height: calc(var(--note-row-height) * 7 + 2px);
        max-height: calc(var(--note-row-height) * 7 + 2px);
    }

    .app-wrapper.sidebar-collapsed .memo-grid {
        grid-template-columns: 1fr;
        gap: 18px;
        padding: 18px 14px 24px;
    }

    .sidebar.desktop-collapsed~.main-area .memo-grid {
        grid-template-columns: 1fr;
        gap: 18px;
        padding: 18px 14px 24px;
    }
}

/* === 右键便条颜色子菜单色块 === */
.color-swatch-menu {
    display: flex;
    gap: 8px;
    padding: 10px 14px;
    flex-wrap: wrap;
    justify-content: center;
}

.color-swatch {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.10);
}

.color-swatch:hover {
    transform: scale(1.2);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
}

.color-swatch.active {
    border-color: #333;
    box-shadow: 0 0 0 2px #fff, 0 0 0 4px #333;
}

.color-swatch-yellow {
    background: #f7e7bf;
}

.color-swatch-green {
    background: #d9f2e3;
}

.color-swatch-blue {
    background: #cfe7fb;
}

.color-swatch-pink {
    background: #ffd8d2;
}

.color-swatch-orange {
    background: #ffe7cf;
}

.color-swatch-purple {
    background: #ecdefe;
}

.color-swatch-neutral {
    background: #f8f8f7;
}

.editor-modal {
    background: radial-gradient(circle at top, rgba(34, 24, 17, 0.75), rgba(12, 10, 8, 0.96));
}

.editor-workspace-shell {
    width: min(1500px, calc(100vw - 40px));
    max-height: min(92vh, 980px);
    display: flex;
    gap: 14px;
    align-items: stretch;
}

.editor-session-tabs {
    width: 208px;
    background: rgba(245, 227, 206, 0.9);
    border-radius: 18px;
    border: 1px solid rgba(148, 120, 84, 0.25);
    box-shadow: 0 20px 42px rgba(26, 18, 11, 0.32);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    backdrop-filter: blur(6px);
    transition: width 0.28s cubic-bezier(0.22, 0.8, 0.28, 1), box-shadow 0.26s ease;
}

.editor-session-tabs.collapsed {
    width: 72px;
}

.editor-session-tabs.collapsed .editor-session-tabs-head {
    justify-content: flex-end;
    padding: 10px 8px;
    gap: 0;
}

.editor-session-tabs.collapsed .editor-session-tabs-head-left {
    display: none;
}

.editor-session-tabs-head-left {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.session-head-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.editor-session-tabs.collapsed .session-head-text {
    opacity: 0;
    transform: translateX(-6px);
    width: 0;
}

.editor-session-tabs-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 14px;
    color: #5a3f26;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.04em;
    border-bottom: 1px solid rgba(148, 120, 84, 0.2);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.74), rgba(244, 223, 192, 0.76));
}

.editor-session-tabs-head .material-symbols-outlined {
    font-size: 18px;
}

.session-tabs-toggle-btn {
    width: 24px;
    height: 24px;
    border: none;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.72);
    color: #6d5134;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.session-tabs-toggle-btn .material-symbols-outlined {
    font-size: 17px;
}

.session-tabs-toggle-btn:hover {
    background: rgba(196, 138, 58, 0.2);
    color: #5d4022;
    transform: translateX(-1px);
}

.editor-session-tabs.collapsed .session-tabs-toggle-btn {
    margin-left: auto;
    transform: translateX(2px);
}

.editor-session-tabs.collapsed .session-tabs-toggle-btn:hover {
    transform: translateX(2px);
}

.editor-session-tab-list {
    padding: 10px;
    display: grid;
    gap: 8px;
    overflow-y: auto;
    overflow-x: hidden;
}

.editor-session-tab {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 10px;
    border-radius: 12px;
    border: 1px solid rgba(148, 120, 84, 0.16);
    background: rgba(255, 255, 255, 0.62);
    color: #5e4530;
    cursor: pointer;
    transition: all 0.22s ease;
    min-width: 0;
    width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}

.editor-session-tab:hover {
    transform: translateY(-1px);
    border-color: rgba(196, 138, 58, 0.44);
    box-shadow: 0 7px 14px rgba(148, 120, 84, 0.16);
}

.editor-session-tab.active {
    background: linear-gradient(140deg, #f8e6ca, #f2dcb7);
    border-color: rgba(196, 138, 58, 0.52);
    box-shadow: 0 10px 18px rgba(126, 92, 57, 0.24);
}

.editor-session-tab.minimized {
    opacity: 0.6;
}

.editor-session-tab .tab-icon {
    font-size: 18px;
    flex-shrink: 0;
}

.editor-session-tab .tab-title {
    flex: 1;
    display: block;
    min-width: 0;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tab-close-btn {
    width: 24px;
    height: 24px;
    border: none;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.7);
    color: #72563a;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tab-close-btn .material-symbols-outlined {
    font-size: 15px;
}

.tab-close-btn:hover {
    background: rgba(225, 68, 68, 0.16);
    color: #992e2e;
}

.editor-session-tabs.collapsed .editor-session-tab {
    justify-content: center;
    padding: 10px 6px;
}

.editor-session-tabs.collapsed .editor-session-tab .tab-title,
.editor-session-tabs.collapsed .editor-session-tab .tab-close-btn {
    display: none;
}

.editor-box {
    background: #fbf4ea;
    box-shadow: 0 26px 80px rgba(27, 19, 12, 0.9);
    flex: 1;
    min-width: 0;
}

.editor-workspace-shell .editor-box {
    width: auto;
    max-width: none;
    height: min(90vh, 920px);
}

.minimized-editor-dock {
    position: fixed;
    left: 0;
    top: 0;
    pointer-events: none;
    z-index: 11000;
}

.minimized-editor-window {
    position: fixed;
    display: flex;
    flex-direction: column;
    min-width: 320px;
    min-height: 220px;
    max-width: min(560px, 82vw);
    max-height: min(420px, 66vh);
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid rgba(148, 120, 84, 0.3);
    background: rgba(251, 244, 234, 0.95);
    box-shadow: 0 20px 42px rgba(25, 16, 9, 0.4);
    backdrop-filter: blur(7px);
    resize: both;
    pointer-events: auto;
}

.minimized-editor-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 10px;
    background: linear-gradient(135deg, #f2d9b6, #eecb9a);
    color: #4f3925;
    font-size: 12px;
    font-weight: 700;
    cursor: move;
    user-select: none;
    touch-action: none;
}

.mini-title {
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mini-actions {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.mini-action-btn {
    width: 24px;
    height: 24px;
    border: none;
    border-radius: 7px;
    background: rgba(255, 255, 255, 0.64);
    color: #5a4128;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    touch-action: manipulation;
}

.mini-action-btn .material-symbols-outlined {
    font-size: 15px;
}

.mini-action-btn:hover {
    background: rgba(255, 255, 255, 0.95);
}

.minimized-editor-body {
    flex: 1;
    min-height: 0;
    padding: 0;
    overflow: hidden;
    display: block;
}

.minimized-editor-loading {
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 18px 16px;
    text-align: center;
    color: rgba(73, 50, 23, 0.86);
    background:
        linear-gradient(180deg, rgba(255, 250, 243, 0.96), rgba(245, 232, 214, 0.9));
}

.mini-window-spinner {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 3px solid rgba(191, 132, 57, 0.16);
    border-top-color: #bf8439;
    animation: securityRingSpin 0.85s linear infinite;
}

.minimized-editor-loading p {
    margin: 0;
    font-size: 13px;
    font-weight: 700;
}

.minimized-editor-loading-preview {
    max-width: 100%;
    font-size: 12px;
    line-height: 1.6;
    color: rgba(101, 74, 40, 0.78);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.minimized-editor-editable {
    height: 100%;
    min-height: 0;
    width: 100%;
    overflow: auto;
    font-family: inherit;
    font-size: 13px;
    line-height: 1.52;
    color: rgba(54, 39, 25, 0.9);
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 10px 12px 10px 14px;
    outline: none;
    white-space: pre-wrap;
    word-break: break-word;
    box-sizing: border-box;
}

.minimized-editor-editable:focus {
    border: none;
    box-shadow: none;
}

.minimized-editor-editable.readonly {
    background: transparent;
    color: rgba(51, 51, 51, 0.84);
    cursor: default;
}

.minimized-editor-editable * {
    font-size: inherit !important;
    line-height: inherit !important;
}

.auth-progress-note {
    margin-top: 12px;
    padding: 12px 14px;
    border-radius: 14px;
    background: rgba(255, 247, 232, 0.88);
    color: #6a461c;
    font-size: 13px;
    line-height: 1.6;
    display: flex;
    align-items: center;
    gap: 10px;
}

.auth-progress-note.processing {
    border: 1px solid rgba(191, 132, 57, 0.18);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.auth-progress-spinner {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    flex: 0 0 auto;
}

.auth-progress-spinner span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: linear-gradient(135deg, #c78d41, #edc17a);
    animation: activityBounce 0.9s ease-in-out infinite;
}

.auth-progress-spinner span:nth-child(2) {
    animation-delay: 0.12s;
}

.auth-progress-spinner span:nth-child(3) {
    animation-delay: 0.24s;
}

.social-auth-progress-overlay {
    backdrop-filter: blur(6px);
}

.social-auth-progress-card {
    width: min(90vw, 420px);
    padding: 26px 24px 24px;
    border-radius: 28px;
    background:
        linear-gradient(180deg, rgba(255, 252, 247, 0.98), rgba(250, 240, 224, 0.94));
    border: 1px solid rgba(191, 132, 57, 0.16);
    box-shadow: 0 24px 60px rgba(43, 29, 12, 0.18);
    text-align: center;
}

.social-auth-progress-eyebrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(191, 132, 57, 0.12);
    color: #98652b;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.social-auth-progress-card h3 {
    margin: 0 0 10px;
    font-size: 22px;
    color: #3f2814;
}

.social-auth-progress-card p {
    margin: 0;
    font-size: 14px;
    line-height: 1.7;
    color: rgba(93, 64, 31, 0.8);
}

.social-auth-progress-spinner {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: 0 0 18px;
}

.social-auth-progress-spinner span {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: linear-gradient(135deg, #c78d41, #edc17a);
    animation: activityBounce 0.9s ease-in-out infinite;
}

.social-auth-progress-spinner span:nth-child(2) {
    animation-delay: 0.12s;
}

.social-auth-progress-spinner span:nth-child(3) {
    animation-delay: 0.24s;
}

.editor-modal.fullscreen .editor-session-tabs {
    display: none;
}

.editor-modal.fullscreen .editor-workspace-shell {
    width: 100%;
    max-height: 100vh;
    gap: 0;
}

/* ===== 核心修复：网格线跟随文字 ===== */
/* 将网格线应用到具体的块级元素上，而不是容器背景 */
.ql-editor p,
.ql-editor ol,
.ql-editor ul,
.ql-editor pre,
.ql-editor blockquote,
.ql-editor h1,
.ql-editor h2,
.ql-editor h3,
.ql-editor h4,
.ql-editor h5,
.ql-editor h6 {
    /* 网格线样式 */
    background-image: linear-gradient(#0000 95%, rgba(0, 0, 0, 0.03) 100%);
    background-size: 100% 1.6em;
    /* 必须与 line-height 保持一致 */
    background-repeat: repeat-y;

    /* 强制行高与网格一致 */
    line-height: 1.6em;

    /* 移除段落间距，确保网格连续 */
    margin-bottom: 0;
    padding-bottom: 0;
}

/* 标题字号较大，网格线也会随之变大，形成"大格子"效果，视觉上更和谐 */
.ql-editor h1 {
    font-size: 2em;
}

.ql-editor h2 {
    font-size: 1.5em;
}

.ql-editor h3 {
    font-size: 1.17em;
}

/* 列表项特殊处理 */
.ql-editor li {
    line-height: 1.6em;
}



/* placeholder 文字对齐光标位置，稍微往下 */
.ql-editor.ql-blank::before {
    left: 15px !important;
    top: 19 !important;
}

.login-modal {
    background: radial-gradient(circle at top, rgba(34, 24, 17, 0.78), rgba(20, 16, 12, 0.95));
    z-index: 10001;
}

.login-box {
    background: #fbf4ea;
    box-shadow: 0 22px 70px rgba(20, 12, 6, 0.85);
}

.share-modal-loading {
    margin-top: 12px;
    padding: 22px 18px 18px;
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(255, 250, 242, 0.96), rgba(247, 234, 214, 0.92));
    border: 1px solid rgba(180, 133, 73, 0.16);
    text-align: center;
    color: #6b4a24;
}

.share-modal-loading h3 {
    margin: 16px 0 8px;
    font-size: 20px;
    color: #4e3114;
}

.share-modal-loading p {
    margin: 0;
    font-size: 14px;
    line-height: 1.7;
    color: #7b5a34;
}

.share-modal-spinner {
    width: 68px;
    height: 68px;
    margin: 0 auto;
    border-radius: 50%;
    position: relative;
    display: grid;
    place-items: center;
    background: radial-gradient(circle at center, rgba(255, 255, 255, 0.78) 0 36%, transparent 37% 100%);
}

.share-modal-spinner::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    border: 3px solid rgba(211, 155, 94, 0.18);
    border-top-color: rgba(211, 155, 94, 0.92);
    animation: securityRingSpin 1.1s linear infinite;
}

.share-modal-spinner span {
    position: absolute;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: linear-gradient(135deg, #d39b5e, #f4e1c6);
    box-shadow: 0 0 0 3px rgba(211, 155, 94, 0.1);
    animation: activityBounce 1.4s ease-in-out infinite;
}

.share-modal-spinner span:nth-child(1) {
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
}

.share-modal-spinner span:nth-child(2) {
    bottom: 14px;
    left: 14px;
    animation-delay: 0.18s;
}

.share-modal-spinner span:nth-child(3) {
    bottom: 14px;
    right: 14px;
    animation-delay: 0.36s;
}

.device-trust-modal {
    position: fixed;
    inset: 0;
    z-index: 10021;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 22px;
    background: radial-gradient(circle at 20% 12%, rgba(224, 180, 106, 0.2), rgba(20, 16, 12, 0.86));
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.device-trust-card {
    width: min(92vw, 520px);
    border-radius: 20px;
    background: linear-gradient(155deg, #fff6e8 0%, #f9eddb 52%, #f6e4cb 100%);
    border: 1px solid rgba(148, 120, 84, 0.25);
    box-shadow: 0 30px 80px rgba(32, 20, 10, 0.45);
    padding: 24px 24px 22px;
    color: #3f2e1b;
}

.device-trust-mark {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.76);
    border: 1px solid rgba(148, 120, 84, 0.28);
    font-size: 20px;
}

.device-trust-title {
    margin: 12px 0 8px;
    font-size: 22px;
    line-height: 1.35;
    color: #422d16;
}

.device-trust-desc {
    margin: 0;
    font-size: 14px;
    line-height: 1.7;
    color: #6b4e2f;
}

.device-trust-note {
    margin-top: 12px;
    padding: 10px 12px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(148, 120, 84, 0.2);
    font-size: 12px;
    color: #8a4b1b;
}

.device-trust-actions {
    margin-top: 16px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.device-trust-actions .btn {
    margin-top: 0;
    width: 100%;
}

.btn-primary {
    background: linear-gradient(135deg, #c48a3a, #e0b46a);
    box-shadow: 0 8px 24px rgba(148, 120, 84, 0.35);
}

.btn-primary:hover {
    box-shadow: 0 14px 32px rgba(148, 120, 84, 0.45);
}

.batch-bar {
    background: linear-gradient(135deg, #c48a3a, #e0b46a);
}

.doc-viewer-header {
    background: linear-gradient(135deg, #c48a3a, #e0b46a);
}

.notification.info {
    background: linear-gradient(135deg, #2563eb, #1e40af);
}

.notification.success {
    background: linear-gradient(135deg, #15803d, #166534);
}

.notification.warning {
    background: linear-gradient(135deg, #d97706, #b45309);
}

.notification.error {
    background: linear-gradient(135deg, #b91c1c, #7f1d1d);
}

.title-input {
    flex: 1;
    background: transparent;
    border: 1px solid rgba(148, 120, 84, 0.15);
    border-radius: 8px;
    padding: 8px 14px;
    font-size: 28px;
    font-weight: 700;
    color: var(--text);
    transition: all 0.3s;
}

.title-input:focus {
    outline: none;
    border-color: rgba(211, 155, 94, 0.45);
    box-shadow: 0 0 0 3px rgba(211, 155, 94, 0.08);
}

/* 桌面端：汉堡菜单和遮罩层隐藏 */
.mobile-menu-btn,
.mobile-sidebar-overlay {
    display: none;
}

/* 电脑端编辑器工具栏样式 */
.editor-toolbar {
    padding: 12px 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
    background: #f0dec7;
    /* 统一背景色 */
    border-bottom: 1px solid rgba(148, 120, 84, 0.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
    z-index: 100;
    position: relative;
}

/* 电脑端标题输入框（吊牌风格） */
.editor-toolbar .memo-title-tag {
    flex: 1;
    min-width: 220px;
    margin-right: 8px;
    position: relative;
    padding: 12px 16px 9px;
    background: linear-gradient(180deg, #dde2c2 0%, #d3d9b9 100%);
    border: 2px solid rgba(88, 68, 46, 0.72);
    border-radius: 18px;
    box-shadow:
        0 4px 0 rgba(88, 68, 46, 0.2),
        0 11px 22px rgba(120, 94, 59, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.42);
    transition: transform 0.24s ease, border-color 0.24s ease, box-shadow 0.24s ease;
}

.editor-toolbar .memo-title-tag::before,
.editor-toolbar .memo-title-tag::after {
    content: '';
    position: absolute;
    top: -22px;
    width: 2px;
    height: 18px;
    border-radius: 2px;
    background: rgba(82, 65, 44, 0.78);
}

.editor-toolbar .memo-title-tag::before {
    left: 22%;
}

.editor-toolbar .memo-title-tag::after {
    right: 22%;
}

.editor-toolbar .memo-title-tag .tag-pin {
    position: absolute;
    top: 8px;
    width: 8px;
    height: 8px;
    border: 1.6px solid rgba(82, 65, 44, 0.74);
    border-radius: 50%;
    background: #edf2d4;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

.editor-toolbar .memo-title-tag .tag-pin-left {
    left: calc(22% - 4px);
}

.editor-toolbar .memo-title-tag .tag-pin-right {
    right: calc(22% - 4px);
}

.editor-toolbar .memo-title-tag .tag-bridge {
    position: absolute;
    top: 11px;
    left: 22%;
    right: 22%;
    height: 1.5px;
    border-radius: 999px;
    background: rgba(82, 65, 44, 0.62);
    pointer-events: none;
}

.editor-toolbar .memo-title-tag:focus-within {
    border-color: #9b7649;
    transform: translateY(-1px);
    box-shadow:
        0 0 0 3px rgba(173, 133, 83, 0.18),
        0 4px 0 rgba(88, 68, 46, 0.22),
        0 14px 24px rgba(120, 94, 59, 0.2);
}

.editor-toolbar .memo-title-tag .title-input {
    width: 100%;
    min-width: 0;
    margin: 0;
    padding: 18px 0 0;
    background: transparent;
    border: none;
    box-shadow: none;
    font-size: 21px;
    font-weight: 700;
    color: #4b3623;
    caret-color: #8f6537;
    text-align: center;
}

.editor-toolbar .memo-title-tag .title-input:hover,
.editor-toolbar .memo-title-tag .title-input:focus {
    background: transparent;
    border: none;
    box-shadow: none;
    transform: none;
    outline: none;
}

.editor-toolbar .memo-title-tag .title-input::placeholder {
    color: rgba(84, 63, 43, 0.78);
    font-weight: 700;
    font-style: normal;
    letter-spacing: 0.18px;
    text-align: center;
}

.editor-toolbar .editor-toolbar-collapse-btn {
    display: none;
}

@media (max-width: 768px) {

    /* 移动端使用上下布局，避免只看到侧边栏 */
    body {
        overflow: auto;
    }

    .app-wrapper {
        height: auto;
        min-height: 100vh;
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        width: 280px;
        min-width: 280px;
        height: 100dvh;
        /* 修复：使用 dvh 避免被浏览器工具栏遮挡 */
        padding-bottom: env(safe-area-inset-bottom);
        /* 适配底部安全区 */
        z-index: 1001;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        box-shadow: 4px 0 24px rgba(148, 120, 84, 0.32);
    }

    .sidebar.mobile-open {
        transform: translateX(0);
    }

    /* 移动端汉堡菜单按钮：嵌入 toolbar 内部，统一样式 */
    .mobile-menu-btn {
        display: flex !important;
        width: 40px;
        height: 40px;
        border-radius: 8px;
        background: rgba(255, 255, 255, 0.85);
        border: 1px solid rgba(148, 120, 84, 0.2);
        box-shadow: 0 2px 6px rgba(148, 120, 84, 0.12);
        align-items: center;
        justify-content: center;
        cursor: pointer;
        padding: 0;
        order: -1;
        flex-shrink: 0;
        transition: all 0.2s;
    }

    .desktop-sidebar-toggle {
        display: none !important;
    }

    .app-wrapper.sidebar-collapsed .sidebar,
    .sidebar.desktop-collapsed {
        width: 280px;
        min-width: 280px;
    }

    .mobile-menu-btn:active {
        transform: scale(0.95);
    }

    .mobile-menu-btn svg {
        width: 20px;
        height: 20px;
        color: #947854;
    }

    /* 编辑器打开时隐藏汉堡菜单 */
    body:has(.editor-modal) .mobile-menu-btn {
        display: none !important;
    }

    /* 侧边栏打开时隐藏汉堡菜单 */
    .sidebar.mobile-open~.main-area .mobile-menu-btn {
        display: none !important;
    }

    /* 遮罩层 */
    .mobile-sidebar-overlay {
        display: block !important;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.4);
        z-index: 1000;
    }

    .main-area {
        width: 100%;
        min-height: 100vh;
        padding-top: 0;
        padding-left: 0;
    }

    /* 重构顶部工具栏布局：汉堡菜单作为第一个元素 */
    .top-toolbar {
        padding: 14px 12px !important;
        gap: 8px !important;
        display: flex !important;
        flex-wrap: nowrap !important;
        align-items: center !important;
    }

    /* 搜索输入框容器：缩小最小宽度 */
    .search-input {
        flex: 1 1 auto !important;
        min-width: 80px !important;
        margin: 0 !important;
    }

    /* 搜索输入框：调整内边距 */
    .search-input input {
        padding: 12px 12px 12px 40px !important;
        font-size: 14px !important;
    }

    /* 搜索图标位置调整 */
    .search-input svg {
        left: 12px !important;
    }

    /* 按钮组 */
    .top-toolbar .btn,
    .top-toolbar .btn-icon {
        flex-shrink: 0 !important;
    }

    /* 新建按钮文字在手机端可选择性隐藏 */
    .top-toolbar .btn.btn-primary {
        padding: 10px 12px !important;
    }

    .editor-box {
        width: 100%;
        height: 100dvh;
        /* 使用 dvh 解决移动端浏览器工具栏遮挡问题 */
        max-width: 100%;
        border-radius: 0;
        display: flex;
        flex-direction: column;
        overflow: hidden;
        /* 防止整体滚动 */
    }

    .editor-workspace-shell .editor-box {
        width: 100%;
        max-width: 100%;
        height: 100dvh;
    }

    .editor-workspace-shell {
        width: 100%;
        max-height: 100dvh;
        gap: 0;
    }

    .editor-session-tabs {
        display: none;
    }

    .editor-session-tabs.collapsed {
        width: 72px;
    }

    .minimized-editor-window {
        min-width: 250px;
        min-height: 188px;
        max-width: 90vw;
        max-height: 60vh;
    }

    /* 编辑器modal在移动端完全覆盖 */
    .editor-modal {
        position: fixed;
        inset: 0;
        z-index: 9999;
        overflow: hidden;
        /* 防止modal本身滚动 */
    }

    .editor-toolbar {
        padding: 8px 12px;
        padding-top: max(8px, env(safe-area-inset-top));
        /* 适配刘海屏 */
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
        align-items: center;
        justify-content: flex-start;
        flex-shrink: 0;
        /* 防止工具栏被压缩 */
        position: sticky;
        /* 固定在顶部 */
        top: 0;
        z-index: 10000;
        /* 统一背景色：与footer一致 */
        background: #f0dec7;
        border-bottom: 1px solid rgba(148, 120, 84, 0.1);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
    }

    /* 新版编辑器工具栏样式 */
    .editor-toolbar-new {
        flex-shrink: 0;
        /* 防止工具栏被压缩 */
        position: sticky;
        /* 固定在顶部 */
        top: 0;
        z-index: 10000;
        /* 统一背景色：与footer一致，稍微亮一点点区分层级 */
        background: #f4e3cf;
    }

    /* 编辑器内容区域可以滚动 */
    .editor-content-new {
        flex: 1 1 auto;
        min-height: 0;
        overflow-y: auto;
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
        /* iOS平滑滚动 */
    }

    /* footer固定在底部，不会滚动出视野 */
    .editor-footer {
        flex-shrink: 0;
        position: relative;
        /* 不使用sticky，因为在flex布局中会自动在底部 */
        z-index: 100;
    }

    /* 全屏按钮在手机端隐藏 */
    .editor-toolbar .editor-fullscreen-btn {
        display: none !important;
    }

    /* 标题吊牌占满第一行 */
    .editor-toolbar .memo-title-tag {
        flex: 1 0 100%;
        min-width: 0;
        order: 10;
        margin-right: 0;
        margin: -2px auto 0;
        max-width: 92%;
        padding: 10px 10px 8px;
        border-radius: 13px;
        z-index: 1;
    }

    .editor-toolbar .memo-title-tag::before,
    .editor-toolbar .memo-title-tag::after {
        top: -24px;
        height: 24px;
        width: 2.2px;
        background: #6f5840;
        z-index: 2;
    }

    .editor-toolbar .memo-title-tag::before {
        left: 16%;
    }

    .editor-toolbar .memo-title-tag::after {
        right: 16%;
    }

    .editor-toolbar .memo-title-tag .tag-pin {
        top: 7px;
        z-index: 3;
    }

    .editor-toolbar .memo-title-tag .tag-pin-left {
        left: calc(16% - 4px);
    }

    .editor-toolbar .memo-title-tag .tag-pin-right {
        right: calc(16% - 4px);
    }

    .editor-toolbar .memo-title-tag .tag-bridge {
        top: 10px;
        left: 16%;
        right: 16%;
    }

    .editor-toolbar .memo-title-tag .title-input {
        font-size: 14px;
        padding-top: 16px;
        text-align: center;
    }

    .editor-toolbar .memo-title-tag .title-input::placeholder {
        font-size: 13px;
        font-weight: 700;
        letter-spacing: 0.16px;
        text-align: center;
    }

    .editor-toolbar .btn-icon {
        width: 28px;
        height: 28px;
        border-radius: 9px;
        padding: 0;
    }

    .editor-toolbar .btn-icon svg {
        width: 14px;
        height: 14px;
    }

    .editor-toolbar .btn-icon .material-symbols-outlined {
        font-size: 15px;
    }

    .editor-toolbar .editor-toolbar-collapse-btn,
    .editor-toolbar .editor-minimize-btn,
    .editor-toolbar .editor-save-btn,
    .editor-toolbar .editor-close-btn {
        display: inline-flex;
        position: static;
        width: 29px;
        height: 29px;
        border-radius: 10px;
        border: 1.6px solid rgba(101, 78, 55, 0.66);
        background: linear-gradient(180deg, #dfe4c6 0%, #d4dbbc 100%);
        color: #5a4531;
        box-shadow:
            0 2px 0 rgba(101, 78, 55, 0.2),
            0 4px 10px rgba(120, 94, 59, 0.14),
            inset 0 1px 0 rgba(255, 255, 255, 0.4);
        z-index: 2;
    }

    .editor-toolbar .editor-toolbar-collapse-btn:active,
    .editor-toolbar .editor-minimize-btn:active,
    .editor-toolbar .editor-save-btn:active,
    .editor-toolbar .editor-close-btn:active {
        transform: translateY(1px);
        box-shadow:
            0 1px 0 rgba(101, 78, 55, 0.18),
            0 2px 5px rgba(120, 94, 59, 0.12),
            inset 0 1px 0 rgba(255, 255, 255, 0.35);
    }

    .editor-toolbar .editor-toolbar-collapse-btn {
        order: 1;
    }

    .editor-toolbar .editor-minimize-btn {
        order: 2;
    }

    .editor-toolbar .editor-save-btn {
        order: 3;
        margin-left: auto;
    }

    .editor-toolbar .editor-close-btn {
        order: 4;
    }

    .editor-toolbar .mobile-toolbar-hint {
        position: absolute;
        top: calc(env(safe-area-inset-top) + 38px);
        left: 10px;
        display: inline-flex;
        align-items: center;
        gap: 4px;
        padding: 4px 8px;
        border-radius: 999px;
        border: 1px solid rgba(117, 89, 60, 0.35);
        background: rgba(254, 245, 222, 0.95);
        color: #6a4f36;
        font-size: 11px;
        font-weight: 600;
        line-height: 1;
        box-shadow: 0 5px 12px rgba(92, 66, 38, 0.16);
        pointer-events: none;
        z-index: 6;
        animation: mobile-toolbar-hint-pop 0.26s ease-out;
    }

    .editor-toolbar .mobile-toolbar-hint .material-symbols-outlined {
        font-size: 13px;
    }

    @keyframes mobile-toolbar-hint-pop {
        from {
            opacity: 0;
            transform: translateY(-5px) scale(0.94);
        }

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

    .editor-toolbar .editor-save-btn:disabled {
        opacity: 0.55;
    }

    .toolbar-toggle-btn {
        display: none !important;
    }

    /* 全屏模式：隐藏 footer 和 Quill 工具栏，但保留 editor-toolbar */
    .editor-modal.fullscreen .editor-footer {
        display: none !important;
    }

    .editor-modal.fullscreen .toolbar-toggle-btn {
        display: none !important;
    }

    .editor-modal.fullscreen .ql-toolbar.ql-snow {
        display: none !important;
    }

    /* 全屏模式下隐藏新版工具栏（格式化工具栏） */
    .editor-modal.fullscreen .editor-toolbar-new {
        display: none !important;
    }

    /* 全屏模式下 editor-toolbar (顶部标题栏) 依然显示，且强制在最上层 */
    .editor-modal.fullscreen .editor-toolbar {
        display: flex !important;
        position: fixed !important;
        /* 使用 fixed 彻底解决真机兼容性问题 */
        top: 0;
        left: 0;
        right: 0;
        z-index: 10001 !important;
        background: #f0dec7 !important;
        /* 确保背景不透明 */
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
        padding-top: max(12px, env(safe-area-inset-top)) !important;
    }

    /* 全屏模式下，内容区域需要给顶部工具栏留出空间 */
    .editor-modal.fullscreen .editor-content-new {
        /* 大幅增加 margin-top，确保内容区不被工具栏遮挡 */
        /* 工具栏高度约 60-70px + 安全区域 + 额外缓冲 */
        margin-top: calc(120px + env(safe-area-inset-top, 20px)) !important;
        padding-top: 16px !important;
        /* 确保从顶部开始有足够的距离 */
        min-height: calc(100vh - 120px - env(safe-area-inset-top, 20px)) !important;
    }

    /* 全屏模式下 editor-box 占满整个视口 */
    .editor-modal.fullscreen .editor-box {
        overflow: hidden !important;
        /* 防止 editor-box 本身滚动 */
    }
}

/* 圆形图标按钮，更柔和，更炫酷 */
.btn-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    /* 方圆形更现代 */
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow: 0 2px 5px rgba(148, 120, 84, 0.05);
    color: #5d4037;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-icon:hover {
    background: #fff;
    border-color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(148, 120, 84, 0.15);
    color: #c48a3a;
}

.btn-icon:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(148, 120, 84, 0.1);
}

.btn-icon.active {
    background: linear-gradient(135deg, #c48a3a, #e0b46a);
    color: #fff;
    border: none;
    box-shadow: 0 4px 12px rgba(196, 138, 58, 0.3);
}

/* 标题输入框美化 - 增强版 */
.title-input {
    flex: 1;
    background: rgba(255, 255, 255, 0.3);
    /* 默认有淡淡的背景 */
    border: none;
    border-bottom: 2px solid rgba(148, 120, 84, 0.2);
    /* 底部边框提示输入 */
    border-radius: 6px 6px 0 0;
    /* 上方圆角 */
    padding: 8px 14px;
    font-size: 24px;
    font-weight: 700;
    color: #3e2723;
    /* 深咖啡色 */
    transition: all 0.3s;
    margin-right: 12px;
    /* 与按钮保持距离 */
}

.title-input:hover {
    background: rgba(255, 255, 255, 0.5);
    border-bottom-color: rgba(148, 120, 84, 0.5);
}

.title-input:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.8);
    border-bottom-color: #c48a3a;
    /* 聚焦时高亮底部 */
    box-shadow: 0 4px 12px rgba(148, 120, 84, 0.1);
}

.title-input::placeholder {
    color: rgba(62, 39, 35, 0.4);
    font-weight: 500;
    font-style: italic;
    /* 斜体提示 */
}

/* 编辑器工具栏折叠时隐藏 Quill 工具栏 */
.editor-box.toolbar-collapsed .ql-toolbar.ql-snow {
    display: none !important;
}

.editor-box.toolbar-collapsed .editor-content {
    border-top: 1px solid rgba(148, 120, 84, 0.18);
}

/* 桌面端：拉链风格收起按钮 */
.toolbar-toggle-btn.zipper-toggle-btn {
    position: absolute;
    top: 78px;
    right: 15px;
    width: 38px;
    height: 78px;
    padding: 0;
    border: none;
    background: transparent;
    display: inline-flex;
    align-items: flex-end;
    justify-content: center;
    cursor: pointer;
    z-index: 52;
    transition: top 0.26s ease;
}

.editor-box:not(.toolbar-collapsed) .toolbar-toggle-btn.zipper-toggle-btn {
    top: 132px;
}

.toolbar-toggle-btn.zipper-toggle-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    width: 2px;
    height: 34px;
    border-radius: 999px;
    transform: translateX(-50%);
    background: linear-gradient(180deg, rgba(94, 70, 46, 0.82) 0%, rgba(123, 94, 65, 0.42) 100%);
}

.toolbar-toggle-btn.zipper-toggle-btn .zipper-teeth {
    position: absolute;
    top: 30px;
    left: 50%;
    width: 10px;
    height: 15px;
    transform: translateX(-50%);
    border-radius: 6px;
    background:
        repeating-linear-gradient(180deg,
            rgba(121, 91, 61, 0.75) 0 2px,
            rgba(232, 214, 187, 0.95) 2px 4px);
    border: 1px solid rgba(108, 80, 54, 0.44);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.66),
        0 1px 2px rgba(113, 82, 54, 0.2);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.toolbar-toggle-btn.zipper-toggle-btn .zipper-teeth {
    pointer-events: none;
}

.toolbar-toggle-btn.zipper-toggle-btn:hover .zipper-teeth {
    transform: translateY(1.5px);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.66),
        0 2px 4px rgba(106, 78, 51, 0.22);
}

.toolbar-toggle-btn.zipper-toggle-btn:active .zipper-teeth {
    transform: translateY(6px);
}

.toolbar-toggle-btn.zipper-toggle-btn:focus-visible {
    outline: none;
}

.toolbar-toggle-btn.zipper-toggle-btn:focus-visible .zipper-teeth {
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.66),
        0 2px 4px rgba(106, 78, 51, 0.22),
        0 0 0 3px rgba(171, 133, 89, 0.28);
}

/* 编辑器 box 相对定位 */
.editor-box {
    position: relative;
}

/* 右键菜单子菜单箭头 */
.context-menu {
    transform-origin: top left;
    animation: contextMenuPop 0.12s ease-out;
    will-change: transform, opacity;
    backface-visibility: hidden;
}

.context-menu .menu-item {
    transition: background-color 0.16s ease, color 0.16s ease;
}

@keyframes contextMenuPop {
    from {
        opacity: 0;
        transform: translate3d(0, 6px, 0) scale(0.985);
    }

    to {
        opacity: 1;
        transform: translate3d(0, 0, 0) scale(1);
    }
}

.context-menu .submenu-arrow {
    width: 16px;
    height: 16px;
    margin-left: auto;
    opacity: 0.5;
}

/* 卡通背景主题样式 */

/* 吉伊卡哇：使用 jiyi.JPG 作为背景 */
.editor-box.theme-chiikawa .ql-editor,
.editor-box.theme-chiikawa .editor-content-new {
    background-color: #fff9f5;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.88), rgba(255, 255, 255, 0.88)),
        url('https://image.wawacm.com/2025/11/20/599255.webp');
    background-size: cover, cover;
    background-position: center, center;
    background-repeat: no-repeat, no-repeat;
    background-attachment: local, local;
    position: relative;
}

/* 哆啦A梦：使用 duola.jpg 作为背景 */
.editor-box.theme-doraemon .ql-editor,
.editor-box.theme-doraemon .editor-content-new {
    background-color: #f8fcff;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.88), rgba(255, 255, 255, 0.88)),
        url('https://image.wawacm.com/2025/11/20/676386.webp');
    background-size: cover, cover;
    background-position: center, center;
    background-repeat: no-repeat, no-repeat;
    background-attachment: local, local;
    position: relative;
}

/* 蜡笔小新：使用 labi.jpg 作为背景 */
.editor-box.theme-shinchan .ql-editor,
.editor-box.theme-shinchan .editor-content-new {
    background-color: #fffef8;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.89), rgba(255, 255, 255, 0.89)),
        url('https://image.wawacm.com/2025/11/20/866721.webp');
    background-size: cover, cover;
    background-position: center, center;
    background-repeat: no-repeat, no-repeat;
    background-attachment: local, local;
    position: relative;
}

/* 无背景：保持原有木质纹理和网格线 */
.editor-box.theme-none .ql-editor,
.editor-box.theme-none .editor-content-new {
    background-color: #fbf4ea;
    background-image: linear-gradient(180deg, rgba(255, 255, 255, 0.2), rgba(244, 227, 207, 0.9));
}

/* 手机端背景图片（使用专门的手机版图片） */
@media (max-width: 768px) {

    /* 吉伊卡哇：手机端使用 phonejiyi.jpg */
    .editor-box.theme-chiikawa .ql-editor,
    .editor-box.theme-chiikawa .editor-content-new {
        background-image:
            linear-gradient(rgba(255, 255, 255, 0.10), rgba(255, 255, 255, 0.10)),
            url('https://image.wawacm.com/2025/11/20/319069.webp');
    }

    /* 哆啦A梦：手机端使用 phoneduola.jpg */
    .editor-box.theme-doraemon .ql-editor,
    .editor-box.theme-doraemon .editor-content-new {
        background-image:
            linear-gradient(rgba(255, 255, 255, 0.88), rgba(255, 255, 255, 0.88)),
            url('https://image.wawacm.com/2025/11/20/795125.webp');
    }

    /* 蜡笔小新：手机端使用 phonelabi.jpg */
    .editor-box.theme-shinchan .ql-editor,
    .editor-box.theme-shinchan .editor-content-new {
        background-image:
            linear-gradient(rgba(255, 255, 255, 0.89), rgba(255, 255, 255, 0.89)),
            url('https://image.wawacm.com/2025/11/20/331758.webp');
    }
}


/* 批量操作栏按钮：胶囊形，有明显交互 */
.batch-bar .btn {
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.2) !important;
    border: 1px solid rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(12px);
}

.batch-bar .btn:hover {
    transform: translateY(-1px);
    background: rgba(255, 255, 255, 0.32) !important;
}

.batch-bar .btn:first-child {
    font-weight: 600;
}

/* 用户操作按钮样式 */
.user-info {
    position: relative;
}

.user-action-btns {
    display: flex;
    gap: 8px;
    margin-left: auto;
}

.user-action-btn {
    width: 32px;
    height: 32px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(211, 155, 94, 0.1);
    border: 1px solid rgba(211, 155, 94, 0.3);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    pointer-events: auto;
    position: relative;
    z-index: 10;
}

.user-action-btn:hover {
    background: rgba(211, 155, 94, 0.2);
    border-color: rgba(211, 155, 94, 0.5);
    transform: translateY(-2px);
}

.user-action-btn svg {
    width: 18px;
    height: 18px;
    stroke: var(--primary);
    fill: none;
    pointer-events: none;
}

/* ===== 设置浮窗 ===== */
.settings-popup {
    position: absolute;
    bottom: 100%;
    right: 0;
    margin-bottom: 6px;
    background: var(--card-bg, #fff);
    border: 1px solid var(--border-color, rgba(211, 155, 94, 0.2));
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
    min-width: 200px;
    padding: 6px 0;
    z-index: 1000;
    animation: settingsPopupIn 0.15s ease-out;
    will-change: transform, opacity;
    backface-visibility: hidden;
}

@keyframes settingsPopupIn {
    from {
        opacity: 0;
        transform: translateY(6px);
    }

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

.settings-popup-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    cursor: pointer;
    font-size: 13px;
    color: var(--text-primary, #333);
    transition: background 0.2s;
    white-space: nowrap;
}

.settings-popup-item:hover {
    background: rgba(211, 155, 94, 0.08);
}

.settings-popup-item svg {
    flex-shrink: 0;
    stroke: var(--primary, #d39b5e);
    fill: none;
}

.settings-popup-divider {
    height: 1px;
    background: var(--border-color, rgba(211, 155, 94, 0.15));
    margin: 4px 12px;
}

/* ===== 安全中心 ===== */
.security-overlay {
    position: fixed;
    inset: 0;
    z-index: 10030;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background:
        radial-gradient(circle at 15% 18%, rgba(224, 180, 106, 0.22), transparent 30%),
        radial-gradient(circle at 85% 16%, rgba(120, 74, 28, 0.18), transparent 26%),
        rgba(26, 18, 12, 0.82);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    overflow-y: auto;
    overscroll-behavior: contain;
}

.security-center-modal,
.mfa-setup-modal,
.security-challenge-modal,
.login-activity-modal {
    width: min(94vw, 1020px);
    max-height: min(calc(100dvh - 48px), 900px);
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: 28px;
    background: linear-gradient(180deg, rgba(255, 248, 239, 0.96), rgba(248, 237, 221, 0.98));
    border: 1px solid rgba(145, 106, 58, 0.2);
    box-shadow: 0 34px 90px rgba(17, 10, 4, 0.42);
    color: #3b2611;
}

.security-center-hero,
.login-activity-header,
.security-challenge-header,
.mfa-setup-header {
    position: relative;
    padding: 28px 30px 24px;
    background:
        linear-gradient(135deg, rgba(245, 222, 190, 0.95), rgba(215, 168, 104, 0.92)),
        linear-gradient(180deg, rgba(255, 255, 255, 0.2), transparent);
    overflow: hidden;
}

.security-center-glow {
    position: absolute;
    top: -42px;
    right: -32px;
    width: 180px;
    height: 180px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.62), rgba(255, 255, 255, 0));
    pointer-events: none;
}

.security-center-topline,
.mfa-setup-eyebrow,
.security-challenge-eyebrow,
.login-activity-eyebrow {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: rgba(70, 42, 15, 0.75);
}

.security-chip {
    display: inline-flex;
    align-items: center;
    padding: 5px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.62);
    border: 1px solid rgba(132, 93, 46, 0.18);
}

.security-center-headline,
.login-activity-header h3,
.security-challenge-header h3,
.mfa-setup-header h3 {
    margin: 10px 0 8px;
    font-size: 30px;
    line-height: 1.1;
    color: #37210e;
}

.security-center-subtitle,
.login-activity-header p,
.security-challenge-header p {
    margin: 0;
    max-width: 640px;
    font-size: 14px;
    line-height: 1.7;
    color: rgba(74, 49, 23, 0.84);
}

.security-close-btn {
    position: absolute;
    top: 18px;
    right: 18px;
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.62);
    color: #533516;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.security-center-body,
.mfa-setup-body,
.security-challenge-body,
.login-activity-list {
    flex: 1 1 auto;
    min-height: 0;
    padding: 28px 30px 30px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

.security-center-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.security-card {
    position: relative;
    border-radius: 24px;
    padding: 22px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(255, 247, 236, 0.78));
    border: 1px solid rgba(180, 139, 88, 0.18);
    box-shadow: 0 18px 36px rgba(121, 86, 44, 0.08);
}

.security-card-wide {
    grid-column: span 2;
}

.security-card-enhanced {
    background:
        linear-gradient(135deg, rgba(255, 244, 224, 0.96), rgba(255, 236, 208, 0.86)),
        radial-gradient(circle at top right, rgba(210, 149, 62, 0.12), transparent 34%);
}

.security-card-icon {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(211, 155, 94, 0.12);
    color: #ab6e2f;
}

.security-card-title {
    margin-top: 16px;
    font-size: 20px;
    font-weight: 700;
    color: #3b2410;
}

.security-card-desc {
    margin-top: 8px;
    font-size: 14px;
    line-height: 1.7;
    color: rgba(82, 55, 24, 0.78);
}

.security-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
}

.security-badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 12px;
    color: #8c6740;
    background: rgba(155, 113, 61, 0.08);
    border: 1px solid rgba(155, 113, 61, 0.12);
}

.security-badge.is-active {
    color: #4b310f;
    background: rgba(224, 180, 106, 0.26);
    border-color: rgba(186, 135, 66, 0.26);
}

.security-action-btn {
    margin-top: 18px;
    padding: 13px 18px;
    border: 0;
    border-radius: 16px;
    background: linear-gradient(135deg, #c48a3a, #e0b46a);
    color: #fffaf3;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 14px 28px rgba(176, 122, 56, 0.22);
}

.security-action-btn-secondary {
    background: rgba(255, 255, 255, 0.82);
    color: #6a461c;
    border: 1px solid rgba(180, 139, 88, 0.24);
    box-shadow: none;
}

.trust-device-toggle,
.enhanced-security-switch {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 18px;
}

.trust-device-toggle input,
.enhanced-security-switch input {
    display: none;
}

.trust-device-toggle-ui,
.enhanced-security-slider {
    position: relative;
    width: 54px;
    height: 32px;
    border-radius: 999px;
    background: rgba(136, 104, 66, 0.18);
    transition: background 0.2s ease;
}

.trust-device-toggle-ui::after,
.enhanced-security-slider::after {
    content: '';
    position: absolute;
    top: 4px;
    left: 4px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 4px 10px rgba(82, 53, 21, 0.2);
    transition: transform 0.2s ease;
}

.trust-device-toggle input:checked+.trust-device-toggle-ui,
.enhanced-security-switch input:checked+.enhanced-security-slider {
    background: linear-gradient(135deg, #bf8439, #ddb165);
}

.trust-device-toggle input:checked+.trust-device-toggle-ui::after,
.enhanced-security-switch input:checked+.enhanced-security-slider::after {
    transform: translateX(22px);
}

.trust-device-toggle-text,
.enhanced-security-label {
    font-size: 14px;
    font-weight: 600;
    color: #4b3112;
}

.security-inline-note {
    margin-top: 14px;
    font-size: 12px;
    line-height: 1.7;
    color: rgba(95, 67, 34, 0.72);
}

.security-challenge-trust {
    margin-top: 20px;
    padding: 16px 18px;
    border-radius: 20px;
    background:
        linear-gradient(180deg, rgba(255, 251, 245, 0.98), rgba(248, 237, 220, 0.92));
    border: 1px solid rgba(191, 132, 57, 0.16);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.security-challenge-trust-toggle {
    margin-top: 0;
}

.security-challenge-trust-note {
    margin-top: 10px;
    margin-left: 68px;
}

.security-center-loading,
.login-activity-loading {
    padding: 48px 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    color: #6f4d27;
}

.security-loader-ring {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    border: 3px solid rgba(203, 159, 93, 0.22);
    border-top-color: #c78d41;
    animation: securityRingSpin 0.85s linear infinite;
}

@keyframes securityRingSpin {
    to {
        transform: rotate(360deg);
    }
}

.mfa-setup-modal {
    width: min(94vw, 560px);
}

.mfa-setup-qr-wrap {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

.mfa-setup-qr {
    width: 220px;
    height: 220px;
    border-radius: 20px;
    padding: 12px;
    background: #fff;
    box-shadow: 0 18px 36px rgba(113, 80, 43, 0.12);
}

.mfa-secret-box {
    margin-bottom: 18px;
    padding: 16px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(180, 139, 88, 0.18);
}

.mfa-secret-label {
    font-size: 12px;
    color: rgba(89, 63, 31, 0.72);
}

.mfa-secret-value {
    margin-top: 8px;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: #4d3212;
    word-break: break-all;
}

.security-challenge-modal {
    width: min(94vw, 660px);
}

.security-method-tabs {
    display: flex;
    gap: 10px;
    padding: 0 30px 0;
    margin-top: -8px;
    flex-wrap: wrap;
}

.security-method-tab {
    padding: 11px 16px;
    border-radius: 999px;
    border: 1px solid rgba(171, 124, 64, 0.18);
    background: rgba(255, 255, 255, 0.72);
    color: #6b4a22;
    cursor: pointer;
}

.security-method-tab.active {
    background: linear-gradient(135deg, rgba(224, 180, 106, 0.32), rgba(255, 239, 210, 0.76));
    color: #3f2711;
    border-color: rgba(177, 126, 61, 0.26);
}

.line-challenge-panel,
.line-password-panel,
.mfa-challenge-panel {
    padding-top: 8px;
}

.line-challenge-code {
    font-size: 56px;
    font-weight: 800;
    letter-spacing: 0.18em;
    text-align: center;
    color: #7b4a13;
}

.line-challenge-copy,
.line-challenge-expire {
    text-align: center;
    color: rgba(88, 58, 24, 0.78);
}

.line-challenge-expire {
    margin-top: 8px;
    font-size: 13px;
}

.line-challenge-orbit {
    margin: 22px auto;
    display: flex;
    justify-content: center;
    gap: 8px;
}

.line-challenge-orbit span {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: linear-gradient(135deg, #c78d41, #edc17a);
    animation: challengePulse 1.1s ease-in-out infinite;
}

.line-challenge-orbit span:nth-child(2) {
    animation-delay: 0.15s;
}

.line-challenge-orbit span:nth-child(3) {
    animation-delay: 0.3s;
}

@keyframes challengePulse {

    0%,
    100% {
        transform: scale(0.75);
        opacity: 0.45;
    }

    50% {
        transform: scale(1.12);
        opacity: 1;
    }
}

.security-challenge-error {
    margin-top: 16px;
    padding: 12px 14px;
    border-radius: 16px;
    background: rgba(188, 73, 35, 0.1);
    color: #9a4323;
}

.security-challenge-footer {
    padding: 0 30px 30px;
}

.login-activity-modal {
    width: min(94vw, 860px);
}

.activity-loader-lane {
    display: flex;
    gap: 10px;
}

.activity-loader-lane span {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: linear-gradient(135deg, #c78d41, #edc17a);
    animation: activityBounce 0.9s ease-in-out infinite;
}

.activity-loader-lane span:nth-child(2) {
    animation-delay: 0.12s;
}

.activity-loader-lane span:nth-child(3) {
    animation-delay: 0.24s;
}

@keyframes activityBounce {

    0%,
    100% {
        transform: translateY(0);
        opacity: 0.38;
    }

    50% {
        transform: translateY(-8px);
        opacity: 1;
    }
}

.login-activity-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.login-activity-item {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 20px;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.78);
    border: 1px solid rgba(177, 132, 76, 0.14);
}

.login-activity-main {
    min-width: 0;
}

.login-activity-title-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
    flex-wrap: wrap;
}

.login-activity-title {
    font-size: 18px;
    font-weight: 700;
    color: #442912;
}

.login-activity-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.login-activity-meta {
    margin-top: 7px;
    font-size: 13px;
    color: rgba(84, 57, 24, 0.76);
}

.login-activity-location {
    margin-top: 12px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(233, 212, 180, 0.26);
    color: #714717;
}

.login-activity-location.is-loading {
    animation: locationGlow 1.1s ease-in-out infinite;
}

@keyframes locationGlow {

    0%,
    100% {
        box-shadow: 0 0 0 rgba(210, 149, 62, 0);
    }

    50% {
        box-shadow: 0 0 0 8px rgba(210, 149, 62, 0.08);
    }
}

.login-activity-logout-btn {
    align-self: center;
    min-width: 108px;
    padding: 12px 16px;
    border-radius: 16px;
    border: 1px solid rgba(164, 107, 55, 0.16);
    background: rgba(255, 255, 255, 0.86);
    color: #8d4f20;
    cursor: pointer;
}

/* ===== Quill 自定义字号样式 ===== */
.ql-snow .ql-picker.ql-size {
    width: 80px;
}

.ql-snow .ql-picker.ql-size .ql-picker-label::before,
.ql-snow .ql-picker.ql-size .ql-picker-item::before {
    content: '14px';
    /* 默认字号 */
    font-size: 14px !important;
    /* 统一工具栏显示大小 */
}

/* 具体的字号标签 - 强制覆盖默认样式，只改变文字内容，不改变工具栏显示大小 */
.ql-snow .ql-picker.ql-size .ql-picker-label[data-value="12px"]::before,
.ql-snow .ql-picker.ql-size .ql-picker-item[data-value="12px"]::before {
    content: '12px' !important;
}

.ql-snow .ql-picker.ql-size .ql-picker-label[data-value="13px"]::before,
.ql-snow .ql-picker.ql-size .ql-picker-item[data-value="13px"]::before {
    content: '13px' !important;
}

.ql-snow .ql-picker.ql-size .ql-picker-label[data-value="14px"]::before,
.ql-snow .ql-picker.ql-size .ql-picker-item[data-value="14px"]::before {
    content: '14px' !important;
}

.ql-snow .ql-picker.ql-size .ql-picker-label[data-value="15px"]::before,
.ql-snow .ql-picker.ql-size .ql-picker-item[data-value="15px"]::before {
    content: '15px' !important;
}

.ql-snow .ql-picker.ql-size .ql-picker-label[data-value="16px"]::before,
.ql-snow .ql-picker.ql-size .ql-picker-item[data-value="16px"]::before {
    content: '16px' !important;
}

.ql-snow .ql-picker.ql-size .ql-picker-label[data-value="18px"]::before,
.ql-snow .ql-picker.ql-size .ql-picker-item[data-value="18px"]::before {
    content: '18px' !important;
}

.ql-snow .ql-picker.ql-size .ql-picker-label[data-value="20px"]::before,
.ql-snow .ql-picker.ql-size .ql-picker-item[data-value="20px"]::before {
    content: '20px' !important;
}

.ql-snow .ql-picker.ql-size .ql-picker-label[data-value="24px"]::before,
.ql-snow .ql-picker.ql-size .ql-picker-item[data-value="24px"]::before {
    content: '24px' !important;
}

.ql-snow .ql-picker.ql-size .ql-picker-label[data-value="32px"]::before,
.ql-snow .ql-picker.ql-size .ql-picker-item[data-value="32px"]::before {
    content: '32px' !important;
}

.ql-snow .ql-picker.ql-size .ql-picker-label[data-value="48px"]::before,
.ql-snow .ql-picker.ql-size .ql-picker-item[data-value="48px"]::before {
    content: '48px' !important;
}

/* 大字号行高优化，尝试对齐网格 */
.ql-editor span[style*="font-size: 24px"] {
    line-height: 1.5;
    display: inline-block;
    vertical-align: baseline;
}

.ql-editor span[style*="font-size: 32px"] {
    line-height: 1.5;
    display: inline-block;
    vertical-align: baseline;
}

.ql-editor span[style*="font-size: 48px"] {
    line-height: 1.2;
    display: inline-block;
    vertical-align: baseline;
}

/* ===== 移动端适配修复 ===== */
@media (max-width: 768px) {
    .editor-footer {
        padding-bottom: max(12px, env(safe-area-inset-bottom)) !important;
    }

    .login-modal {
        align-items: center;
        /* 确保居中 */
        padding-bottom: env(safe-area-inset-bottom);
    }

    .login-box {
        max-height: 85dvh;
        overflow-y: auto;
        /* 确保底部按钮不被遮挡，增加额外空间 */
        margin-bottom: calc(env(safe-area-inset-bottom) + 40px);
    }

    .wechat-bind-box {
        width: min(92vw, 440px);
    }

    .device-trust-modal {
        padding: 16px;
    }

    .device-trust-card {
        width: min(94vw, 520px);
        padding: 20px 18px 18px;
        border-radius: 16px;
    }

    .device-trust-title {
        font-size: 19px;
    }

    .device-trust-actions {
        grid-template-columns: 1fr;
    }

    .security-overlay {
        padding: 14px;
        align-items: flex-start;
    }

    .security-center-modal,
    .mfa-setup-modal,
    .security-challenge-modal,
    .login-activity-modal {
        width: min(96vw, 720px);
        max-height: calc(100dvh - 28px);
        border-radius: 22px;
        margin: auto 0;
    }

    .security-center-headline,
    .login-activity-header h3,
    .security-challenge-header h3,
    .mfa-setup-header h3 {
        font-size: 24px;
    }

    .security-center-body,
    .mfa-setup-body,
    .security-challenge-body,
    .login-activity-list {
        padding: 20px 18px 22px;
    }

    .security-center-grid {
        grid-template-columns: 1fr;
    }

    .security-card-wide {
        grid-column: span 1;
    }

    .line-challenge-code {
        font-size: 40px;
        letter-spacing: 0.12em;
    }

    .login-activity-item {
        flex-direction: column;
        align-items: stretch;
    }

    .login-activity-logout-btn {
        width: 100%;
    }
}

/* ===== 编辑器Loading遮罩层 ===== */
.editor-loading-overlay {
    position: absolute;
    top: 120px;
    /* 在工具栏下方 */
    left: 0;
    right: 0;
    bottom: 60px;
    /* 在footer上方 */
    background: rgba(251, 244, 234, 0.95);
    backdrop-filter: blur(8px);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
}

.editor-loading-content {
    text-align: center;
    color: var(--text-secondary);
    font-size: 14px;
}

.editor-loading-content p {
    margin: 0;
    font-weight: 500;
}

/* 工具栏折叠时调整loading位置 */
.editor-box.toolbar-collapsed .editor-loading-overlay {
    top: 75px;
}

@media (max-width: 768px) {
    .editor-loading-overlay {
        top: 160px;
    }

    .editor-box.toolbar-collapsed .editor-loading-overlay {
        top: calc(75px - 1.5em);
    }
}

/* ===== AURA 风控弹窗 ===== */
.aura-overlay {
    position: fixed;
    inset: 0;
    z-index: 14000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(241, 245, 249, 0.52);
    backdrop-filter: blur(0);
    -webkit-backdrop-filter: blur(0);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.28s ease, backdrop-filter 0.28s ease;
}

.aura-overlay.active {
    opacity: 1;
    pointer-events: all;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.aura-overlay.closing {
    opacity: 0;
    pointer-events: none;
    backdrop-filter: blur(0);
    -webkit-backdrop-filter: blur(0);
}

.aura-modal {
    width: min(92vw, 390px);
    min-height: 220px;
    background: rgba(255, 255, 255, 0.76);
    border-radius: 22px;
    box-shadow: 0 22px 60px rgba(0, 0, 0, 0.16), 0 0 0 1px rgba(255, 255, 255, 0.65) inset;
    transform: scale(0.92) translateY(22px) rotateX(8deg);
    opacity: 0;
    transition: transform 0.34s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.34s ease;
    overflow: hidden;
    position: relative;
}

.aura-overlay.active .aura-modal {
    transform: scale(1) translateY(0) rotateX(0);
    opacity: 1;
}

.aura-overlay.closing .aura-modal {
    transform: scale(0.9) translateY(16px) rotateX(8deg);
    opacity: 0;
}

.aura-modal::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(115deg, transparent 0%, rgba(255, 255, 255, 0.85) 35%, transparent 62%);
    transform: translateX(-130%);
    pointer-events: none;
}

.aura-overlay.active .aura-modal::before {
    animation: auraShine 0.95s ease forwards;
    animation-delay: 0.14s;
}

.aura-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 22px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}

.aura-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #0f172a;
    font-size: 14px;
    font-weight: 700;
}

.shield-icon-wrapper {
    position: relative;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #2563eb;
}

.shield-pulse {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: #3b82f6;
    opacity: 0.15;
    transform: scale(0.8);
}

.aura-overlay.active .shield-pulse {
    animation: auraPulse 1.8s infinite;
}

.aura-close {
    width: 30px;
    height: 30px;
    border: 0;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.04);
    color: #64748b;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.22s ease, background 0.22s ease, color 0.22s ease;
}

.aura-close:hover {
    background: rgba(0, 0, 0, 0.08);
    color: #0f172a;
    transform: rotate(90deg);
}

.aura-body {
    min-height: 170px;
    padding: 20px 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.scan-state {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: opacity 0.26s ease, transform 0.26s ease;
}

.scan-state.hidden {
    opacity: 0;
    transform: scale(0.92);
    pointer-events: none;
}

.scan-circle {
    width: 58px;
    height: 58px;
    border-radius: 50%;
    border: 2px solid rgba(37, 99, 235, 0.14);
    border-top-color: #3b82f6;
    animation: auraSpin 1s linear infinite;
    margin-bottom: 14px;
    position: relative;
}

.scan-circle::after {
    content: '';
    position: absolute;
    inset: 7px;
    border-radius: 50%;
    border: 2px solid rgba(37, 99, 235, 0.14);
    border-bottom-color: #3b82f6;
    animation: auraSpin 1.45s linear infinite reverse;
}

.scan-text {
    font-size: 13px;
    color: #64748b;
    font-weight: 500;
    display: flex;
    gap: 4px;
}

.scan-dots span {
    animation: auraBlink 1.4s infinite both;
}

.scan-dots span:nth-child(2) {
    animation-delay: 0.22s;
}

.scan-dots span:nth-child(3) {
    animation-delay: 0.44s;
}

#aura-captcha-stage {
    width: 100%;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.28s ease, transform 0.28s ease;
}

#aura-captcha-stage.visible {
    opacity: 1;
    transform: translateY(0);
}

.aura-loading-text {
    text-align: center;
    color: #64748b;
    font-size: 13px;
    padding: 22px 0;
}

.aura-pass-state,
.aura-error-state,
.aura-submit-state {
    text-align: center;
    padding: 14px 0;
}

.aura-pass-state svg {
    width: 42px;
    height: 42px;
    color: #16a34a;
}

.aura-pass-state .title,
.aura-error-state .title,
.aura-submit-state .title {
    margin-top: 8px;
    font-size: 16px;
    font-weight: 700;
}

.aura-pass-state .title {
    color: #16a34a;
}

.aura-error-state .title {
    color: #dc2626;
}

.aura-pass-state .desc,
.aura-error-state .desc,
.aura-submit-state .desc {
    margin-top: 6px;
    color: #64748b;
    font-size: 12px;
}

.aura-submit-state .title {
    color: #2563eb;
}

.aura-submit-spinner {
    width: 42px;
    height: 42px;
    margin: 0 auto;
    border-radius: 50%;
    border: 2px solid rgba(37, 99, 235, 0.18);
    border-top-color: #3b82f6;
    border-right-color: #60a5fa;
    animation: auraSpin 0.9s linear infinite;
    box-shadow: 0 0 0 1px rgba(147, 197, 253, 0.2);
}

.aura-hcaptcha-slot {
    display: flex;
    justify-content: center;
    padding: 8px 0;
}

.aura-footer {
    padding: 12px 22px 15px;
    border-top: 1px solid rgba(0, 0, 0, 0.04);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    color: #94a3b8;
    font-size: 11px;
}

.aura-help-link {
    color: #2563eb;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s ease, text-decoration-color 0.2s ease;
}

.aura-help-link:hover {
    color: #1d4ed8;
    text-decoration: underline;
}

.security-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #cbd5e1;
    transition: all 0.22s ease;
}

.status-dot.secure {
    background: #16a34a;
    box-shadow: 0 0 7px rgba(22, 163, 74, 0.45);
}

@keyframes auraShine {
    to {
        transform: translateX(135%);
    }
}

@keyframes auraPulse {
    0% {
        transform: scale(0.78);
        opacity: 0.18;
    }

    70% {
        transform: scale(1.55);
        opacity: 0;
    }

    100% {
        transform: scale(0.78);
        opacity: 0;
    }
}

@keyframes auraSpin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes auraBlink {

    0%,
    100% {
        opacity: 0.2;
    }

    50% {
        opacity: 1;
    }
}

@media (max-width: 768px) {
    .aura-modal {
        width: min(94vw, 390px);
    }
}

/* ============================================
   待完成/已完成 切换开关
   ============================================ */
.nav-completion-toggle {
    position: relative;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 18px;
    border: 1px solid rgba(148, 120, 84, 0.18);
    background: linear-gradient(140deg, rgba(255, 255, 255, 0.94), rgba(246, 236, 224, 0.95));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.nav-completion-toggle:hover {
    transform: none;
    border-color: rgba(196, 138, 58, 0.4);
    background: linear-gradient(140deg, rgba(255, 255, 255, 0.98), rgba(245, 230, 208, 0.95));
}

.nav-completion-toggle.active {
    color: #5a4024;
    border-color: rgba(196, 138, 58, 0.44);
    background: linear-gradient(140deg, rgba(255, 255, 255, 0.99), rgba(246, 224, 191, 0.95));
    box-shadow:
        0 8px 18px rgba(131, 95, 57, 0.16),
        inset 0 1px 0 rgba(255, 255, 255, 0.92);
}

.nav-completion-toggle svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    color: #9a6d3f;
}

.nav-completion-switch-wrap {
    flex: 1;
    display: flex;
    align-items: center;
    min-width: 0;
}

.completion-switch {
    position: relative;
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
    background: linear-gradient(180deg, #f8eee0 0%, #f2e4d2 100%);
    border: 1px solid rgba(148, 120, 84, 0.24);
    border-radius: 14px;
    padding: 4px;
    gap: 0;
    cursor: pointer;
    width: 100%;
    min-height: 40px;
    max-width: 168px;
    box-shadow:
        inset 0 1px 2px rgba(255, 255, 255, 0.9),
        inset 0 -1px 1px rgba(148, 120, 84, 0.08);
}

.completion-switch-option {
    position: relative;
    z-index: 2;
    flex: 1;
    text-align: center;
    padding: 9px 8px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.01em;
    color: #7a6148;
    border-radius: 10px;
    transition: color 0.25s ease;
    cursor: pointer;
    white-space: nowrap;
    user-select: none;
}

.completion-switch-option::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 999px;
    margin-right: 6px;
    vertical-align: middle;
    opacity: 0.75;
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.completion-switch-option:first-child::before {
    background: #d97706;
}

.completion-switch-option:nth-child(2)::before {
    background: #2f855a;
}

.completion-switch-option.active {
    color: #4e351e;
}

.completion-switch-option.active::before {
    opacity: 1;
    transform: scale(1.15);
}

.completion-switch-slider {
    position: absolute;
    top: 4px;
    left: 4px;
    width: calc(50% - 4px);
    height: calc(100% - 8px);
    background: linear-gradient(140deg, #ffffff 0%, #fff7ec 100%);
    border: 1px solid rgba(211, 155, 94, 0.45);
    border-radius: 10px;
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1;
    box-shadow: 0 5px 12px rgba(127, 88, 50, 0.18);
}

.completion-switch.is-completed .completion-switch-slider {
    transform: translateX(100%);
}

/* ============================================
   侧边栏分割线和文件夹区域
   ============================================ */
.nav-divider {
    height: 1px;
    background: rgba(148, 120, 84, 0.12);
    margin: 8px 16px;
}

.nav-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 16px 4px 20px;
    margin-bottom: 2px;
}

.nav-section-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    opacity: 0.7;
}

.nav-section-add-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    opacity: 0.6;
}

.nav-section-add-btn:hover {
    background: rgba(148, 120, 84, 0.12);
    color: var(--primary);
    opacity: 1;
}

.nav-folder-input-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 16px;
    animation: folderInputSlide 0.25s ease;
}

@keyframes folderInputSlide {
    from {
        opacity: 0;
        transform: translateY(-8px);
        max-height: 0;
    }

    to {
        opacity: 1;
        transform: translateY(0);
        max-height: 60px;
    }
}

.nav-folder-input {
    flex: 1;
    padding: 6px 10px;
    border: 1px solid rgba(148, 120, 84, 0.2);
    border-radius: 8px;
    font-size: 13px;
    background: rgba(255, 255, 255, 0.8);
    color: var(--text);
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.nav-folder-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(211, 155, 94, 0.15);
}

.nav-folder-input-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: none;
    background: var(--primary);
    color: #fff;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.nav-folder-input-btn:hover {
    background: #c08a4e;
    transform: scale(1.05);
}

.nav-folder-item {
    position: relative;
    transition: all 0.2s ease;
}

.nav-folder-item:hover {
    padding-left: 36px;
}

/* ============================================
   备忘录卡片已完成徽章
   ============================================ */
.memo-completed-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    background: linear-gradient(135deg, #34c759 0%, #2f9e4e 100%);
    color: #fff;
    border-radius: 50%;
    font-size: 11px;
    font-weight: 700;
    margin-left: 6px;
    vertical-align: middle;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(52, 199, 89, 0.3);
    animation: badgePop 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes badgePop {
    0% {
        transform: scale(0);
        opacity: 0;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* 已完成卡片仅通过绿色徽章区分，不降低透明度 */

/* ============================================
   侧边栏折叠时的自适应
   ============================================ */
.app-wrapper.sidebar-collapsed .nav-completion-switch-wrap,
.sidebar.desktop-collapsed:not(:hover) .nav-completion-switch-wrap {
    display: none;
}

.app-wrapper.sidebar-collapsed .nav-section-header,
.sidebar.desktop-collapsed:not(:hover) .nav-section-header {
    display: none;
}

.app-wrapper.sidebar-collapsed .nav-folder-input-wrap,
.sidebar.desktop-collapsed:not(:hover) .nav-folder-input-wrap {
    display: none;
}

.app-wrapper.sidebar-collapsed .nav-folder-item span,
.sidebar.desktop-collapsed:not(:hover) .nav-folder-item span {
    display: none;
}

.app-wrapper.sidebar-collapsed .nav-divider,
.sidebar.desktop-collapsed:not(:hover) .nav-divider {
    margin: 4px 12px;
}

/* 展开时恢复 */
.sidebar.desktop-collapsed:hover .nav-completion-switch-wrap,
.sidebar.desktop-collapsed:hover .nav-section-header,
.sidebar.desktop-collapsed:hover .nav-folder-input-wrap,
.sidebar.desktop-collapsed:hover .nav-folder-item span {
    display: flex;
}

.sidebar.desktop-collapsed:hover .nav-divider {
    margin: 8px 16px;
}

/* ============================================
   移动端适配
   ============================================ */
@media (max-width: 768px) {
    .completion-switch {
        max-width: 152px;
        min-height: 38px;
    }

    .completion-switch-option {
        font-size: 12px;
        padding: 8px 6px;
    }

    .nav-section-header {
        padding: 4px 12px;
    }

    .nav-folder-input-wrap {
        padding: 4px 12px;
    }

    /* 移动端强制取消桌面折叠视觉，避免文字与用户面板被隐藏 */
    .app-wrapper.sidebar-collapsed .sidebar-header,
    .sidebar.desktop-collapsed .sidebar-header {
        padding: 0 20px;
    }

    .app-wrapper.sidebar-collapsed .logo,
    .sidebar.desktop-collapsed .logo {
        margin-top: -11px;
        justify-content: flex-start;
    }

    .app-wrapper.sidebar-collapsed .logo img,
    .sidebar.desktop-collapsed .logo img {
        width: 100% !important;
    }

    .app-wrapper.sidebar-collapsed .nav-menu,
    .sidebar.desktop-collapsed .nav-menu {
        padding: 20px 12px;
    }

    .app-wrapper.sidebar-collapsed .nav-item,
    .sidebar.desktop-collapsed .nav-item {
        justify-content: flex-start;
        gap: 12px;
        padding: 14px 18px;
        border-radius: 999px;
    }

    .app-wrapper.sidebar-collapsed .nav-item span,
    .sidebar.desktop-collapsed .nav-item span {
        display: inline-flex;
    }

    .app-wrapper.sidebar-collapsed .nav-completion-switch-wrap,
    .sidebar.desktop-collapsed .nav-completion-switch-wrap {
        display: flex;
    }

    .app-wrapper.sidebar-collapsed .nav-section-header,
    .sidebar.desktop-collapsed .nav-section-header {
        display: flex;
    }

    .app-wrapper.sidebar-collapsed .nav-folder-input-wrap,
    .sidebar.desktop-collapsed .nav-folder-input-wrap {
        display: flex;
    }

    .app-wrapper.sidebar-collapsed .nav-folder-item span,
    .sidebar.desktop-collapsed .nav-folder-item span {
        display: inline;
    }

    .app-wrapper.sidebar-collapsed .nav-divider,
    .sidebar.desktop-collapsed .nav-divider {
        margin: 8px 16px;
    }

    .app-wrapper.sidebar-collapsed .user-panel,
    .sidebar.desktop-collapsed .user-panel {
        display: block;
    }
}
