:root {
    --bg-main: #f5efe6;
    --bg-card: #fffdf8;
    --bg-chalkboard: #3d6b2e;
    --accent-orange: #e8915a;
    --accent-green: #7bc47f;
    --accent-pink: #f2a0b3;
    --accent-blue: #8ec5e2;
    --accent-purple: #b8a9d4;
    --accent-yellow: #f5d98a;
    --accent-coral: #e07a6a;
    --text-primary: #4a3f35;
    --text-secondary: #8a7d6f;
    --border-dashed: #d4c5a9;
    --shadow-soft: 0 4px 12px rgba(74, 63, 53, 0.08), 0 1px 3px rgba(74, 63, 53, 0.06);
    --shadow-card: 0 6px 20px rgba(74, 63, 53, 0.10), 0 2px 6px rgba(74, 63, 53, 0.06);
    --shadow-hover: 0 10px 30px rgba(74, 63, 53, 0.14), 0 4px 10px rgba(74, 63, 53, 0.08);
    --shadow-layer: 0 2px 0 rgba(0,0,0,0.03);
    --radius-card: 14px;
    --radius-btn: 22px;
    --font-cartoon: 'ZCOOL KuaiLe', 'Ma Shan Zheng', cursive, sans-serif;
    --font-body: -apple-system, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    --ease-paper: cubic-bezier(0.25, 0.46, 0.45, 0.94);
    --ease-damping: cubic-bezier(0.34, 1.56, 0.64, 1);
    --ease-smooth: cubic-bezier(0.25, 0.46, 0.45, 0.94);
    --paper-texture: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
}

* { box-sizing: border-box; margin: 0; padding: 0; user-select: none; }
*::selection { background: rgba(232, 145, 90, 0.25); color: var(--text-primary); }

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background: var(--bg-main);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    background-image: var(--paper-texture);
}

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: transparent;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--accent-orange), var(--accent-pink));
    border-radius: 10px;
    border: 2px solid transparent;
    background-clip: padding-box;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, var(--accent-pink), var(--accent-orange));
    border: 1px solid transparent;
    background-clip: padding-box;
}

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

* {
    scrollbar-width: thin;
    scrollbar-color: var(--accent-orange) transparent;
}

html, body {
    scrollbar-gutter: stable;
}

.notebook-bg {
    position: fixed;
    inset: 0;
    background-image:
        radial-gradient(circle at 20% 30%, rgba(232, 145, 90, 0.04) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(242, 160, 179, 0.04) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(139, 197, 127, 0.03) 0%, transparent 60%);
    pointer-events: none;
    z-index: 0;
}

.paper-plane {
    position: fixed;
    z-index: 1;
    pointer-events: none;
    opacity: 0.06;
    animation: floatPlane 18s ease-in-out infinite;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}

.paper-plane-1 {
    top: 15%;
    left: 5%;
    animation-delay: 0s;
}

.paper-plane-2 {
    top: 60%;
    right: 8%;
    animation-delay: -6s;
    transform: scaleX(-1);
}

.paper-plane-3 {
    bottom: 20%;
    left: 12%;
    animation-delay: -12s;
}

@keyframes floatPlane {
    0%, 100% { transform: translateY(0) translateX(0) rotate(0deg); }
    25% { transform: translateY(-30px) translateX(20px) rotate(5deg); }
    50% { transform: translateY(-15px) translateX(-8px) rotate(-2deg); }
    75% { transform: translateY(-45px) translateX(15px) rotate(-6deg); }
}

.paper-star {
    position: fixed;
    z-index: 1;
    pointer-events: none;
    opacity: 0.07;
    animation: twinkleStar 5s ease-in-out infinite;
}

.paper-star-1 { top: 10%; right: 15%; animation-delay: 0s; }
.paper-star-2 { top: 30%; left: 10%; animation-delay: -1.2s; }
.paper-star-3 { bottom: 40%; right: 20%; animation-delay: -2.5s; }
.paper-star-4 { top: 50%; left: 20%; animation-delay: -3.8s; }

@keyframes twinkleStar {
    0%, 100% { opacity: 0.07; transform: scale(1) rotate(0deg); }
    50% { opacity: 0.15; transform: scale(1.15) rotate(90deg); }
}

.paper-cloud {
    position: fixed;
    z-index: 1;
    pointer-events: none;
    animation: floatCloud 22s ease-in-out infinite;
    filter: drop-shadow(0 3px 6px rgba(74, 63, 53, 0.06));
}

.paper-cloud-1 {
    top: 8%;
    right: 10%;
    animation-delay: 0s;
}

.paper-cloud-2 {
    top: 55%;
    left: 3%;
    animation-delay: -8s;
}

@keyframes floatCloud {
    0%, 100% { transform: translateY(0) translateX(0); }
    25% { transform: translateY(-20px) translateX(15px); }
    50% { transform: translateY(-8px) translateX(-10px); }
    75% { transform: translateY(-30px) translateX(8px); }
}

.paper-leaf {
    position: fixed;
    z-index: 1;
    pointer-events: none;
    animation: floatLeaf 16s ease-in-out infinite;
}

.paper-leaf-1 {
    left: 25px;
    top: 35%;
    animation-delay: 0s;
}

.paper-leaf-2 {
    right: 35px;
    bottom: 30%;
    animation-delay: -7s;
    transform: rotate(30deg);
}

@keyframes floatLeaf {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    25% { transform: translateY(-18px) rotate(8deg); }
    50% { transform: translateY(-5px) rotate(-5deg); }
    75% { transform: translateY(-25px) rotate(12deg); }
}

.paper-bird {
    position: fixed;
    z-index: 1;
    pointer-events: none;
    animation: flyBird 20s ease-in-out infinite;
}

.paper-bird-1 {
    top: 20%;
    left: 8%;
    animation-delay: 0s;
}

.paper-bird-2 {
    bottom: 25%;
    right: 12%;
    animation-delay: -10s;
}

@keyframes flyBird {
    0%, 100% { transform: translateY(0) translateX(0) rotate(0deg); }
    20% { transform: translateY(-25px) translateX(20px) rotate(5deg); }
    40% { transform: translateY(-10px) translateX(-8px) rotate(-3deg); }
    60% { transform: translateY(-35px) translateX(15px) rotate(8deg); }
    80% { transform: translateY(-15px) translateX(-5px) rotate(-2deg); }
}

.cartoon-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(245, 239, 230, 0.95);
    backdrop-filter: blur(16px);
    border-bottom: none;
    box-shadow: 0 3px 12px rgba(74, 63, 53, 0.08);
    padding: 0 24px;
    transition: box-shadow 0.2s var(--ease-paper), background 0.2s var(--ease-paper);
}

.cartoon-header::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 0;
    right: 0;
    height: 6px;
    background: linear-gradient(90deg,
        var(--accent-orange) 0%, var(--accent-orange) 20%,
        var(--accent-pink) 20%, var(--accent-pink) 40%,
        var(--accent-yellow) 40%, var(--accent-yellow) 60%,
        var(--accent-green) 60%, var(--accent-green) 80%,
        var(--accent-blue) 80%, var(--accent-blue) 100%
    );
    clip-path: polygon(0 0, 100% 0, 100% 40%, 95% 100%, 85% 30%, 75% 100%, 65% 40%, 55% 100%, 45% 30%, 35% 100%, 25% 40%, 15% 100%, 5% 30%, 0 100%);
    opacity: 0.6;
}

.header-inner {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo-icon {
    width: 32px;
    height: 32px;
    animation: mushroomBounce 2.5s var(--ease-damping) infinite;
}

svg {
    display: inline-block;
    vertical-align: middle;
}

.tab-icon {
    width: 20px;
    height: 20px;
    margin-right: 4px;
    transition: transform 0.2s var(--ease-paper);
}

.nav-tab:hover .tab-icon {
    transform: scale(1.1) rotate(-3deg);
}

.chalkboard-title-icon {
    width: 28px;
    height: 28px;
    margin-right: 8px;
    vertical-align: middle;
}

.stationery-title-icon {
    width: 18px;
    height: 18px;
    margin-right: 4px;
    vertical-align: middle;
}

.stat-icon {
    width: 20px;
    height: 20px;
}

.quote-deco-icon {
    width: 32px;
    height: 32px;
}

.refresh-icon {
    width: 16px;
    height: 16px;
}

.search-icon {
    width: 20px;
    height: 20px;
    color: var(--text-secondary);
}

.tag-icon {
    width: 16px;
    height: 16px;
    margin-right: 4px;
    vertical-align: middle;
}

.load-more-icon {
    width: 16px;
    height: 16px;
    margin-right: 4px;
}

.search-title-icon {
    width: 24px;
    height: 24px;
    margin-right: 6px;
    vertical-align: middle;
}

.tool-icon {
    width: 20px;
    height: 20px;
}

.close-icon {
    width: 16px;
    height: 16px;
}

.footer-icon {
    width: 16px;
    height: 16px;
    margin-right: 4px;
    vertical-align: middle;
}

.back-to-top-icon {
    width: 28px;
    height: 28px;
}

@keyframes mushroomBounce {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-4px) scale(1.06); }
}

.logo-text {
    font-family: var(--font-cartoon);
    font-size: 22px;
    color: var(--text-primary);
    text-shadow: 1px 1px 0 rgba(255,255,255,0.8);
}

.cartoon-nav {
    display: flex;
    gap: 18px;
}

.nav-tab {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px 18px;
    border-radius: 20px;
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 14px;
    transition: all 0.18s var(--ease-paper);
    border: none;
    background: var(--bg-card);
    box-shadow: 0 2px 6px rgba(74, 63, 53, 0.08), 0 1px 2px rgba(74, 63, 53, 0.04);
    position: relative;
}

.nav-tab::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 20px;
    border: 2px solid rgba(212, 197, 169, 0.5);
    pointer-events: none;
}

.nav-tab:hover {
    color: var(--accent-orange);
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(232, 145, 90, 0.18), 0 2px 6px rgba(74, 63, 53, 0.06);
}

.nav-tab:hover::before {
    border-color: var(--accent-orange);
}

.nav-tab:active {
    transform: translateY(1px);
    box-shadow: 0 1px 3px rgba(74, 63, 53, 0.08);
}

.nav-tab.active {
    color: #fff;
    background: var(--accent-orange);
    box-shadow: 0 4px 14px rgba(232, 145, 90, 0.35), 0 2px 4px rgba(74, 63, 53, 0.06);
    transform: translateY(-2px);
}

.nav-tab.active::before {
    border-color: transparent;
}

.nav-tab.study-btn {
    background: var(--accent-purple);
    color: #fff;
}

.nav-tab.study-btn::before {
    border-color: transparent;
}

.nav-tab.study-btn:hover {
    background: #a494c4;
    color: #fff;
    box-shadow: 0 6px 16px rgba(184, 169, 212, 0.35), 0 2px 6px rgba(74, 63, 53, 0.06);
}

.nav-tab.about-btn {
    background: #C41E3A;
    color: #fff;
}

.nav-tab.about-btn::before {
    border-color: transparent;
}

.nav-tab.about-btn:hover {
    background: #a8182f;
    color: #fff;
    box-shadow: 0 6px 16px rgba(196, 30, 58, 0.35), 0 2px 6px rgba(74, 63, 53, 0.06);
}

.tab-icon { font-size: 16px; }

.cartoon-main {
    position: relative;
    z-index: 2;
    max-width: 1100px;
    margin: 30px auto;
    padding: 0 24px;
    display: flex;
    gap: 30px;
}

.cartoon-main.three-column {
    max-width: 1400px;
}

.sidebar-left,
.sidebar-right {
    width: 260px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 20px;
    position: sticky;
    top: 90px;
    align-self: flex-start;
}

.sidebar-chalkboard {
    width: 280px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 20px;
    position: sticky;
    top: 90px;
    align-self: flex-start;
}

.sidebar-brand {
    background: linear-gradient(135deg, var(--accent-orange), var(--accent-pink));
    border-radius: var(--radius-card);
    padding: 20px;
    text-align: center;
    box-shadow: 0 6px 20px rgba(232, 145, 90, 0.25), 0 2px 6px rgba(74, 63, 53, 0.06);
    position: relative;
    overflow: hidden;
    transition: transform 0.18s var(--ease-paper), box-shadow 0.18s var(--ease-paper);
}

.sidebar-brand::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent 40%, rgba(255,255,255,0.15) 50%, transparent 60%);
    animation: shimmer 4s ease-in-out infinite;
}

.sidebar-brand::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--radius-card);
    border: 2px solid rgba(255,255,255,0.2);
    pointer-events: none;
}

@keyframes shimmer {
    0% { transform: translateX(-100%) rotate(45deg); }
    100% { transform: translateX(100%) rotate(45deg); }
}

.brand-text {
    font-family: var(--font-cartoon);
    font-size: 20px;
    color: #fff;
    text-shadow: 0 1px 3px rgba(0,0,0,0.15);
    position: relative;
    z-index: 1;
}

.brand-cursor {
    display: inline-block;
    width: 3px;
    height: 22px;
    background: #fff;
    margin-left: 2px;
    vertical-align: middle;
    animation: blink 1s step-end infinite;
    border-radius: 2px;
    box-shadow: 0 0 6px rgba(255,255,255,0.6);
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

.content-area {
    flex: 1;
    min-width: 0;
}

.chalkboard-panel {
    background: var(--bg-chalkboard);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 6px 20px rgba(61, 107, 46, 0.2), 0 2px 6px rgba(74, 63, 53, 0.08);
    border: none;
    position: relative;
    transition: transform 0.18s var(--ease-paper), box-shadow 0.18s var(--ease-paper);
}

.chalkboard-panel::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 12px;
    border: 3px solid rgba(139, 105, 20, 0.6);
    pointer-events: none;
}

.chalkboard-panel:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 30px rgba(61, 107, 46, 0.25), 0 4px 10px rgba(74, 63, 53, 0.08);
}

.chalkboard-top-bar {
    background: rgba(139, 105, 20, 0.8);
    padding: 5px 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.chalk-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    transition: transform 0.2s var(--ease-paper);
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.chalk-dot:hover {
    transform: scale(1.3);
}

.chalk-dot.red { background: #e74c3c; }
.chalk-dot.yellow { background: #f1c40f; }
.chalk-dot.green { background: #2ecc71; }

.chalkboard-title {
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    margin-left: 6px;
    font-family: var(--font-cartoon);
}

.sidebar-brand-text {
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    font-family: var(--font-cartoon);
}

.chalkboard-body {
    padding: 16px;
    min-height: 100px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100' height='100'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
}

.chalk-text {
    color: rgba(255, 255, 255, 0.9);
    font-family: var(--font-cartoon);
    font-size: 14px;
    line-height: 1.8;
    text-shadow: 0 0 3px rgba(255,255,255,0.2);
}

.stationery-card {
    background: var(--bg-card);
    border-radius: var(--radius-card);
    padding: 20px;
    border: none;
    box-shadow: var(--shadow-card);
    transition: all 0.18s var(--ease-paper);
    position: relative;
}

.stationery-card::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--radius-card);
    border: 2px solid rgba(212, 197, 169, 0.3);
    pointer-events: none;
}

.stationery-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}

.stationery-title {
    font-family: var(--font-cartoon);
    font-size: 16px;
    color: var(--text-primary);
    margin-bottom: 14px;
    text-align: center;
}

.stationery-stats {
    display: flex;
    justify-content: space-around;
}

.stat-item {
    text-align: center;
    transition: transform 0.18s var(--ease-paper);
}

.stat-item:hover {
    transform: translateY(-3px);
}

.stat-emoji {
    font-size: 24px;
    display: block;
    margin-bottom: 4px;
}

.stat-num {
    font-size: 22px;
    font-weight: 800;
    color: var(--accent-orange);
    font-family: var(--font-cartoon);
    display: block;
}

.stat-label {
    font-size: 12px;
    color: var(--text-secondary);
}

.recommended-section {
    margin-top: 16px;
    padding-top: 16px;
    border-top: none;
    position: relative;
}

.recommended-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 10%;
    right: 10%;
    height: 2px;
    background: repeating-linear-gradient(90deg, var(--accent-orange) 0px, var(--accent-orange) 6px, transparent 6px, transparent 12px);
    opacity: 0.4;
}

.recommended-title {
    font-family: var(--font-cartoon);
    font-size: 14px;
    color: var(--text-primary);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.recommended-icon {
    width: 16px;
    height: 16px;
    fill: var(--accent-orange);
}

.recommended-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.recommended-item {
    padding: 8px 12px;
    background: var(--bg-main);
    border-radius: 10px;
    font-size: 13px;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.18s var(--ease-paper);
    border: none;
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 1px 3px rgba(74, 63, 53, 0.06);
}

.recommended-item:hover {
    background: var(--accent-orange);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(232, 145, 90, 0.25);
}

.recommended-item svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    fill: currentColor;
}

.recommended-empty {
    text-align: center;
    font-size: 12px;
    color: var(--text-secondary);
    padding: 8px 0;
}

.quote-card {
    background: var(--bg-card);
    border-radius: var(--radius-card);
    padding: 20px;
    border: none;
    box-shadow: var(--shadow-card);
    text-align: center;
    position: relative;
    transition: all 0.18s var(--ease-paper);
    min-height: 120px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.quote-card::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--radius-card);
    border: 2px solid rgba(212, 197, 169, 0.3);
    pointer-events: none;
}

.quote-card::before {
    content: '';
    position: absolute;
    top: -4px;
    left: 20px;
    right: 20px;
    height: 8px;
    background: var(--accent-yellow);
    border-radius: 4px 4px 0 0;
    box-shadow: 0 1px 3px rgba(245, 217, 138, 0.3);
}

.quote-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}

.quote-deco {
    font-size: 24px;
    margin-bottom: 8px;
}

.quote-text {
    font-family: var(--font-cartoon);
    font-size: 15px;
    color: var(--text-primary);
    line-height: 1.8;
    margin-bottom: 8px;
    transition: opacity 0.5s var(--ease-smooth);
    opacity: 1;
}

.quote-text.fade-out {
    opacity: 0;
}

.quote-author {
    font-size: 12px;
    color: var(--text-secondary);
    transition: opacity 0.5s var(--ease-smooth);
    opacity: 1;
}

.quote-author.fade-out {
    opacity: 0;
}

.quote-refresh {
    display: none;
}

.search-bar {
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.search-bar-inner {
    flex: 1;
    display: flex;
    align-items: center;
    background: var(--bg-card);
    border: none;
    border-radius: 25px;
    padding: 4px 16px;
    box-shadow: var(--shadow-soft);
    transition: all 0.18s var(--ease-paper);
    position: relative;
}

.search-bar-inner::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 25px;
    border: 2px solid rgba(212, 197, 169, 0.3);
    pointer-events: none;
    transition: border-color 0.18s var(--ease-paper);
}

.search-bar-inner:focus-within {
    box-shadow: 0 6px 20px rgba(232, 145, 90, 0.15), 0 2px 6px rgba(74, 63, 53, 0.06);
    transform: translateY(-2px);
}

.search-bar-inner:focus-within::after {
    border-color: var(--accent-orange);
}

.search-icon {
    font-size: 18px;
    margin-right: 8px;
}

.search-input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    font-size: 14px;
    color: var(--text-primary);
    padding: 10px 0;
    font-family: var(--font-body);
}

.search-input::placeholder {
    color: var(--text-secondary);
    opacity: 0.6;
}

.search-go-btn {
    background: var(--accent-orange);
    color: #fff;
    border: none;
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.18s var(--ease-paper);
    box-shadow: 0 2px 8px rgba(232, 145, 90, 0.25);
}
.search-go-btn:hover {
    background: #d4804a;
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(232, 145, 90, 0.35);
}
.search-go-btn:active {
    transform: translateY(1px);
    box-shadow: 0 1px 3px rgba(232, 145, 90, 0.2);
}

.user-area {
    display: flex;
    align-items: center;
    gap: 8px;
}

.user-btn {
    font-size: 13px;
    padding: 6px 14px;
}

.user-info {
    position: relative;
}

.user-name-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 14px;
    border-radius: 20px;
    border: 2px solid rgba(212, 197, 169, 0.5);
    background: var(--bg-card);
    color: var(--accent-orange);
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.18s var(--ease-paper);
    box-shadow: 0 2px 6px rgba(74, 63, 53, 0.06);
}
.user-name-btn:hover {
    border-color: var(--accent-orange);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(232, 145, 90, 0.2);
}

.user-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: var(--bg-card);
    border: none;
    border-radius: 12px;
    padding: 8px 0;
    min-width: 160px;
    box-shadow: 0 8px 30px rgba(74, 63, 53, 0.15), 0 2px 8px rgba(74, 63, 53, 0.06);
    display: none;
    z-index: 200;
    animation: fadeSlideIn 0.2s var(--ease-paper);
}

.user-menu.show { display: block; }

.user-menu-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.18s var(--ease-paper);
}
.user-menu-item:hover {
    background: rgba(232, 145, 90, 0.08);
    color: var(--accent-orange);
}

.notification-item { position: relative; }
.notification-badge {
    background: #e74c3c;
    color: #fff;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 10px;
    margin-left: auto;
}

.publish-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: var(--accent-orange);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.18s var(--ease-paper);
    margin-left: 8px;
    box-shadow: 0 3px 10px rgba(232, 145, 90, 0.3);
}
.publish-btn:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 6px 18px rgba(232, 145, 90, 0.4);
}
.publish-btn:active {
    transform: translateY(1px) scale(0.95);
}
.publish-icon {
    width: 18px;
    height: 18px;
}

.tag-row {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.tag-btn {
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    background: var(--bg-card);
    color: var(--text-secondary);
    transition: all 0.18s var(--ease-paper);
    box-shadow: 0 2px 6px rgba(74, 63, 53, 0.06);
    position: relative;
}

.tag-btn::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 20px;
    border: 2px solid rgba(212, 197, 169, 0.4);
    pointer-events: none;
    transition: border-color 0.18s var(--ease-paper);
}

.tag-btn:hover {
    color: var(--accent-orange);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(232, 145, 90, 0.15);
}

.tag-btn:hover::after {
    border-color: var(--accent-orange);
}

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

.tag-btn.active {
    background: var(--accent-green);
    color: #fff;
    box-shadow: 0 4px 14px rgba(123, 196, 127, 0.3), 0 2px 4px rgba(74, 63, 53, 0.06);
    transform: translateY(-2px);
}

.tag-btn.active::after {
    border-color: transparent;
}

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

.tag-checkbox-label {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    background: var(--bg-card);
    border: 2px solid rgba(212, 197, 169, 0.4);
    border-radius: 20px;
    cursor: pointer;
    font-size: 13px;
    color: var(--text-primary);
    transition: all 0.18s var(--ease-paper);
}

.tag-checkbox-label:hover {
    border-color: var(--accent-orange);
    transform: translateY(-2px);
}

.tag-checkbox-label input[type="checkbox"] {
    accent-color: var(--accent-orange);
}

.tag-checkbox-label:has(input:checked) {
    background: var(--accent-orange);
    border-color: var(--accent-orange);
    color: white;
    box-shadow: 0 2px 8px rgba(232, 145, 90, 0.25);
}

.diary-list {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.diary-card {
    background: var(--bg-card);
    border-radius: var(--radius-card);
    border: none;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s var(--ease-paper);
    box-shadow: var(--shadow-card);
    display: flex;
    min-height: 200px;
    position: relative;
}

.diary-card::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--radius-card);
    border: 2px solid rgba(212, 197, 169, 0.2);
    pointer-events: none;
    transition: border-color 0.2s var(--ease-paper);
}

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

.diary-card:hover::after {
    border-color: var(--accent-orange);
}

.diary-card:active {
    transform: translateY(-1px);
    box-shadow: var(--shadow-soft);
}

.diary-cover {
    width: 280px;
    height: 220px;
    flex-shrink: 0;
    overflow: hidden;
    position: relative;
}

.diary-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s var(--ease-paper);
}

.diary-card:hover .diary-cover img {
    transform: scale(1.05);
}

.diary-card.no-cover .diary-info {
    padding: 20px 24px;
}

.diary-cover-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--accent-yellow), var(--accent-orange));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
}

.placeholder-icon {
    width: 40px;
    height: 40px;
    opacity: 0.5;
}

.diary-info {
    flex: 1;
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
}

.diary-date {
    font-size: 12px;
    color: var(--text-secondary);
    font-family: var(--font-cartoon);
    margin-bottom: 6px;
}

.diary-title {
    font-size: 25px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-family: 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    letter-spacing: 0.3px;
}

.diary-desc {
    font-size: 16px;
    color: var(--text-secondary);
    line-height: 1.7;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 8px;
    font-family: 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
}

.diary-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    margin-top: auto;
    line-height: 1.5;
}

.diary-time {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.diary-tag-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 10px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 600;
    background: rgba(123, 196, 127, 0.12);
    color: var(--accent-green);
    transition: all 0.18s var(--ease-paper);
}

.diary-tag-badge:hover {
    background: rgba(123, 196, 127, 0.22);
    transform: translateY(-1px);
}

.diary-tag-icon {
    width: 14px;
    height: 14px;
}

.empty-icon {
    width: 48px;
    height: 48px;
    display: block;
    margin: 0 auto 12px;
    opacity: 0.6;
}

.page-view {
    display: none;
    animation: fadeSlideIn 0.3s var(--ease-paper);
}

.page-view.active {
    display: block;
}

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

.search-page-title {
    font-family: var(--font-cartoon);
    font-size: 24px;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.search-results {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.search-result-item {
    background: var(--bg-card);
    border: none;
    border-radius: var(--radius-card);
    padding: 16px;
    cursor: pointer;
    transition: all 0.18s var(--ease-paper);
    box-shadow: var(--shadow-soft);
    position: relative;
}

.search-result-item::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--radius-card);
    border: 2px solid rgba(212, 197, 169, 0.2);
    pointer-events: none;
    transition: border-color 0.18s var(--ease-paper);
}

.search-result-item:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
}

.search-result-item:hover::after {
    border-color: var(--accent-orange);
}

.search-result-date {
    font-size: 12px;
    color: var(--text-secondary);
    font-family: var(--font-cartoon);
    margin-bottom: 4px;
}

.search-result-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.search-result-title mark {
    background: rgba(232, 145, 90, 0.2);
    color: var(--text-primary);
    padding: 0 2px;
    border-radius: 3px;
}

.search-result-desc {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.search-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
    font-family: var(--font-cartoon);
    font-size: 16px;
    background: var(--bg-card);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-soft);
}

.load-more-area {
    text-align: center;
    padding: 30px 0;
}

.load-more-btn {
    background: var(--accent-orange);
    color: #fff;
    border: none;
    padding: 12px 32px;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    font-family: var(--font-cartoon);
    transition: all 0.18s var(--ease-paper);
    box-shadow: 0 4px 14px rgba(232, 145, 90, 0.3);
}

.load-more-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 22px rgba(232, 145, 90, 0.4);
}

.load-more-btn:active {
    transform: translateY(1px);
    box-shadow: 0 2px 6px rgba(232, 145, 90, 0.2);
}

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(74, 63, 53, 0.4);
    backdrop-filter: blur(6px);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-overlay.show {
    display: flex;
}

.modal-notebook {
    background: var(--bg-card);
    border-radius: 20px;
    max-width: 79vw;
    width: 100%;
    max-height: 88vh;
    overflow: hidden;
    position: relative;
    box-shadow: 0 20px 60px rgba(74, 63, 53, 0.25), 0 8px 20px rgba(74, 63, 53, 0.1);
    border: none;
    animation: modalPop 0.3s var(--ease-paper);
    user-select: text;
}

.modal-notebook * {
    user-select: text;
}
.modal-notebook *::selection {
    background: rgba(232, 145, 90, 0.25);
    color: var(--text-primary);
}

@keyframes modalPop {
    from { opacity: 0; transform: scale(0.95) translateY(20px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-spiral,
.spiral-ring,
.spiral-hole {
    display: none;
}

.modal-toolbar {
    position: absolute;
    top: 16px;
    right: 16px;
    display: flex;
    gap: 8px;
    z-index: 10;
}

.modal-tool-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: var(--bg-card);
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.18s var(--ease-paper);
    box-shadow: 0 2px 8px rgba(74, 63, 53, 0.1);
}

.modal-tool-btn:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 4px 14px rgba(74, 63, 53, 0.15);
}

.modal-close-btn:hover {
    background: rgba(231, 76, 60, 0.08);
    box-shadow: 0 4px 14px rgba(231, 76, 60, 0.15);
}

.modal-edit-btn:hover {
    background: rgba(142, 197, 226, 0.08);
    box-shadow: 0 4px 14px rgba(142, 197, 226, 0.15);
}

.modal-body {
    padding: 40px 40px 120px 77px;
    overflow-y: auto;
    max-height: 85vh;
    line-height: 1.8;
    font-size: 15px;
    color: var(--text-primary);
}

.modal-body::-webkit-scrollbar {
    width: 8px;
}

.modal-body::-webkit-scrollbar-track {
    background: var(--bg-main);
    border-radius: 8px;
}

.modal-body::-webkit-scrollbar-thumb {
    background: var(--accent-orange);
    border-radius: 8px;
}

.modal-body img {
    max-width: 100%;
    max-height: 400px;
    object-fit: contain;
    border-radius: 12px;
    margin: 12px 0;
    display: block;
    box-shadow: 0 4px 16px rgba(74, 63, 53, 0.1);
    cursor: zoom-in;
    transition: transform 0.2s var(--ease-paper);
}

.modal-body img:hover {
    transform: scale(1.02);
}

.modal-body h1, .modal-body h2, .modal-body h3 {
    font-family: var(--font-cartoon);
    margin: 16px 0 8px;
}

.modal-body p {
    margin: 12px 0;
    line-height: 1.8;
}

.diary-modal-meta {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: none;
    font-size: 12px;
    color: var(--text-secondary);
    position: relative;
}

.diary-modal-meta::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: repeating-linear-gradient(90deg, var(--accent-orange) 0px, var(--accent-orange) 6px, transparent 6px, transparent 12px);
    opacity: 0.3;
}

.diary-modal-meta span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.editor-overlay {
    position: fixed;
    inset: 0;
    background: rgba(74, 63, 53, 0.4);
    backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.editor-overlay.show {
    display: flex;
}

.editor-modal {
    background: var(--bg-card);
    border-radius: 20px;
    width: 100%;
    max-width: 1200px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(74, 63, 53, 0.25), 0 8px 20px rgba(74, 63, 53, 0.1);
    border: none;
}

.editor-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    border-bottom: none;
    background: var(--bg-main);
    position: relative;
}

.editor-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: repeating-linear-gradient(90deg, var(--accent-orange) 0px, var(--accent-orange) 6px, transparent 6px, transparent 12px);
    opacity: 0.3;
}

.editor-header .editor-title {
    font-family: var(--font-cartoon);
    font-size: 18px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.editor-title-icon {
    width: 20px;
    height: 20px;
    fill: var(--accent-orange);
}

.editor-header .editor-close {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: var(--bg-card);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.18s var(--ease-paper);
    box-shadow: 0 2px 6px rgba(74, 63, 53, 0.08);
}

.editor-header .editor-close:hover {
    background: rgba(231, 76, 60, 0.08);
    color: #e74c3c;
    transform: translateY(-2px);
}

.editor-body {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    display: flex;
    gap: 20px;
    align-items: stretch;
}

.editor-body::-webkit-scrollbar {
    width: 8px;
}

.editor-body::-webkit-scrollbar-track {
    background: var(--bg-main);
    border-radius: 8px;
}

.editor-body::-webkit-scrollbar-thumb {
    background: var(--accent-orange);
    border-radius: 8px;
}

.editor-form {
    flex: 6;
    min-width: 0;
}

.editor-image-column {
    flex: 1.5;
    min-width: 120px;
    max-width: 160px;
    border: none;
    border-radius: 12px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: var(--bg-main);
    box-shadow: 0 2px 8px rgba(74, 63, 53, 0.06);
}

.editor-image-scroll {
    flex: 1;
    overflow-y: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    width: 100%;
    display: flex;
    justify-content: center;
}

.editor-image-scroll::-webkit-scrollbar {
    display: none;
}

.editor-image-empty {
    text-align: center;
    color: var(--text-secondary);
    font-size: 13px;
    padding: 20px 0;
    font-family: var(--font-cartoon);
}

.editor-preview {
    flex: 2.5;
    min-width: 0;
    border: none;
    border-radius: 12px;
    padding: 16px;
    overflow-y: auto;
    max-height: 50vh;
    background: var(--bg-main);
    box-shadow: 0 2px 8px rgba(74, 63, 53, 0.06);
}

.editor-preview::-webkit-scrollbar {
    width: 6px;
}

.editor-preview::-webkit-scrollbar-track {
    background: var(--bg-main);
    border-radius: 6px;
}

.editor-preview::-webkit-scrollbar-thumb {
    background: var(--accent-pink);
    border-radius: 6px;
}

.preview-label {
    font-family: var(--font-cartoon);
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.preview-label-icon {
    width: 16px;
    height: 16px;
    fill: var(--accent-orange);
}

.preview-content {
    font-size: 14px;
    line-height: 1.8;
    color: var(--text-primary);
}

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

.editor-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px;
    border-top: none;
    background: var(--bg-main);
    position: relative;
}

.editor-footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: repeating-linear-gradient(90deg, var(--accent-orange) 0px, var(--accent-orange) 6px, transparent 6px, transparent 12px);
    opacity: 0.3;
}

.editor-toolbar {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px 12px;
    background: var(--bg-main);
    border: none;
    border-radius: 12px 12px 0 0;
    flex-wrap: wrap;
    box-shadow: 0 2px 6px rgba(74, 63, 53, 0.04);
}

.toolbar-btn {
    background: var(--bg-card);
    border: none;
    border-radius: 6px;
    padding: 6px 10px;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 700;
    font-family: var(--font-cartoon);
    transition: all 0.18s var(--ease-paper);
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    box-shadow: 0 1px 3px rgba(74, 63, 53, 0.06);
}

.toolbar-btn:hover {
    color: var(--accent-orange);
    background: rgba(232, 145, 90, 0.08);
    transform: translateY(-2px);
    box-shadow: 0 3px 8px rgba(232, 145, 90, 0.12);
}

.toolbar-upload-btn {
    background: var(--accent-green);
    color: #fff;
    box-shadow: 0 2px 8px rgba(123, 196, 127, 0.25);
}

.toolbar-upload-btn:hover {
    background: #6ab870;
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(123, 196, 127, 0.35);
}

.toolbar-divider {
    width: 1px;
    height: 20px;
    background: rgba(212, 197, 169, 0.4);
    margin: 0 4px;
}

.image-preview-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 8px 0;
}

.image-preview-item {
    position: relative;
    width: 80px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
    border: none;
    cursor: pointer;
    transition: all 0.18s var(--ease-paper);
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(74, 63, 53, 0.08);
}

.image-preview-item:hover {
    transform: translateY(-2px) scale(1.03);
    box-shadow: 0 4px 12px rgba(74, 63, 53, 0.12);
}

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

.image-delete-btn {
    position: absolute;
    top: 3px;
    right: 3px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: rgba(231, 76, 60, 0.85);
    border: none;
    color: #fff;
    font-size: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.18s var(--ease-paper);
}

.image-preview-item:hover .image-delete-btn {
    opacity: 1;
}

.image-preview-loading {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    color: var(--text-secondary);
    font-family: var(--font-cartoon);
    background: var(--bg-main);
    box-shadow: 0 2px 6px rgba(74, 63, 53, 0.06);
}

.editor-textarea {
    border-radius: 0 0 12px 12px !important;
    border-top: none !important;
}

.label-icon {
    width: 14px;
    height: 14px;
    fill: var(--accent-orange);
    margin-right: 4px;
    vertical-align: middle;
}

@media (max-width: 768px) {
    .editor-body {
        flex-direction: column;
    }
    .editor-preview {
        max-height: 300px;
    }
    .editor-form {
        max-width: 100%;
    }
    .editor-image-column {
        max-width: 100%;
        min-height: 120px;
    }
}

.lightbox-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.88);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 40px;
    animation: lightboxFade 0.2s var(--ease-smooth);
}

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

.lightbox-overlay.show {
    display: flex;
}

.lightbox-overlay img {
    max-width: 90%;
    max-height: 90vh;
    border-radius: 12px;
    box-shadow: 0 15px 50px rgba(0,0,0,0.5);
    animation: lightboxZoom 0.25s var(--ease-paper);
    cursor: grab;
    user-select: none;
    -webkit-user-drag: none;
}

@keyframes lightboxZoom {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

.lightbox-reset-btn {
    position: absolute;
    top: 20px;
    right: 74px;
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    border: 2px solid rgba(255, 255, 255, 0.3);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    font-size: 22px;
    cursor: pointer;
    transition: all 0.18s var(--ease-paper);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.lightbox-reset-btn:hover {
    background: rgba(0, 0, 0, 0.7);
    border-color: rgba(255, 255, 255, 0.6);
    transform: scale(1.08);
}

.lightbox-close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    border: 2px solid rgba(255, 255, 255, 0.3);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.18s var(--ease-paper);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.lightbox-close-btn:hover {
    background: rgba(0, 0, 0, 0.7);
    border-color: rgba(255, 255, 255, 0.6);
    transform: scale(1.08);
}

.toast-msg {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(-30px);
    background: var(--accent-orange);
    color: #fff;
    padding: 14px 32px;
    border-radius: 30px;
    font-weight: 700;
    font-size: 14px;
    z-index: 3000;
    opacity: 0;
    pointer-events: none;
    transition: all 0.2s var(--ease-paper);
    box-shadow: 0 6px 20px rgba(232, 145, 90, 0.35);
}

.toast-msg.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.toast-msg.error {
    background: var(--accent-coral);
    box-shadow: 0 6px 20px rgba(224, 122, 106, 0.35);
}

.toast-msg.success {
    background: var(--accent-green);
    box-shadow: 0 6px 20px rgba(123, 196, 127, 0.35);
}

.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: var(--accent-orange);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.8);
    transition: all 0.2s var(--ease-paper);
    box-shadow: 0 4px 16px rgba(232, 145, 90, 0.3);
    border: none;
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.back-to-top:hover {
    transform: translateY(-4px) scale(1.08);
    box-shadow: 0 8px 24px rgba(232, 145, 90, 0.4);
}

.back-to-top:active {
    transform: translateY(1px) scale(0.95);
    box-shadow: 0 2px 6px rgba(232, 145, 90, 0.2);
}

.cartoon-footer {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 30px;
    color: var(--text-secondary);
    font-size: 13px;
    font-family: var(--font-cartoon);
    border-top: none;
    margin-top: 40px;
}

.cartoon-footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 10%;
    right: 10%;
    height: 3px;
    background: linear-gradient(90deg,
        var(--accent-orange) 0%, var(--accent-orange) 20%,
        var(--accent-pink) 20%, var(--accent-pink) 40%,
        var(--accent-yellow) 40%, var(--accent-yellow) 60%,
        var(--accent-green) 60%, var(--accent-green) 80%,
        var(--accent-blue) 80%, var(--accent-blue) 100%
    );
    clip-path: polygon(0 0, 100% 0, 100% 40%, 95% 100%, 85% 30%, 75% 100%, 65% 40%, 55% 100%, 45% 30%, 35% 100%, 25% 40%, 15% 100%, 5% 30%, 0 100%);
    opacity: 0.5;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(212, 197, 169, 0.3);
    border-top-color: var(--accent-orange);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 40px auto;
}

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

.editor-overlay {
    position: fixed;
    inset: 0;
    background: rgba(74, 63, 53, 0.4);
    backdrop-filter: blur(6px);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.editor-overlay.show { display: flex; }

.editor-modal {
    background: var(--bg-card);
    border: none;
    border-radius: 20px;
    width: 90vw;
    max-width: 1200px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(74, 63, 53, 0.25), 0 8px 20px rgba(74, 63, 53, 0.1);
    animation: modalPop 0.3s var(--ease-paper);
}

.editor-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 24px;
    border-bottom: none;
    min-height: 50px;
    position: relative;
}
.editor-title {
    font-family: var(--font-cartoon);
    font-size: 18px;
}
.editor-close {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: var(--text-secondary);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.18s var(--ease-paper);
}
.editor-close:hover {
    background: rgba(231, 76, 60, 0.08);
    color: #e74c3c;
    transform: translateY(-2px);
}

.editor-body {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    display: flex;
    gap: 24px;
}
.editor-body::-webkit-scrollbar { width: 8px; }
.editor-body::-webkit-scrollbar-track { background: var(--bg-main); border-radius: 8px; }
.editor-body::-webkit-scrollbar-thumb { background: var(--accent-orange); border-radius: 8px; }

.editor-form { flex: 7; min-width: 0; }
.editor-preview { flex: 3; min-width: 0; border: none; border-radius: 12px; padding: 16px; overflow-y: auto; background: var(--bg-main); box-shadow: 0 2px 8px rgba(74, 63, 53, 0.06); }
.editor-preview::-webkit-scrollbar { width: 6px; }
.editor-preview::-webkit-scrollbar-track { background: var(--bg-main); border-radius: 6px; }
.editor-preview::-webkit-scrollbar-thumb { background: var(--accent-pink); border-radius: 6px; }

.preview-label { font-family: var(--font-cartoon); font-size: 14px; color: var(--text-secondary); margin-bottom: 12px; }
.preview-content { font-size: 14px; line-height: 1.8; }
.preview-content img { max-width: 100%; border-radius: 8px; }

.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 13px; font-weight: 600; color: var(--text-secondary); margin-bottom: 6px; }
.form-input, .form-select, .form-textarea {
    width: 100%;
    padding: 10px 14px;
    border: none;
    border-radius: 12px;
    font-size: 14px;
    background: #fff;
    color: var(--text-primary);
    outline: none;
    transition: all 0.18s var(--ease-paper);
    font-family: inherit;
    box-shadow: 0 2px 6px rgba(74, 63, 53, 0.06);
    position: relative;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
    box-shadow: 0 4px 16px rgba(232, 145, 90, 0.15), 0 2px 6px rgba(74, 63, 53, 0.06);
    transform: translateY(-1px);
}
.form-textarea { resize: vertical; min-height: 200px; line-height: 1.6; }
.form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238a7d6f' stroke-width='2.5'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

.editor-toolbar {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px 12px;
    background: var(--bg-main);
    border: none;
    border-radius: 12px 12px 0 0;
    flex-wrap: wrap;
    box-shadow: 0 2px 6px rgba(74, 63, 53, 0.04);
}

.toolbar-btn {
    background: var(--bg-card);
    border: none;
    border-radius: 6px;
    padding: 6px 10px;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 700;
    font-family: var(--font-cartoon);
    transition: all 0.18s var(--ease-paper);
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    box-shadow: 0 1px 3px rgba(74, 63, 53, 0.06);
}

.toolbar-btn:hover {
    color: var(--accent-orange);
    background: rgba(232, 145, 90, 0.08);
    transform: translateY(-2px);
}

.toolbar-divider {
    width: 1px;
    height: 24px;
    background: rgba(212, 197, 169, 0.4);
    margin: 0 6px;
}

.editor-textarea {
    min-height: 300px;
    transition: all 0.18s var(--ease-paper);
    border-radius: 0 0 12px 12px;
}

.editor-textarea.drag-over {
    background: #f0f8f0;
    box-shadow: 0 0 16px rgba(123, 196, 127, 0.2), 0 4px 16px rgba(232, 145, 90, 0.15);
}

.label-icon {
    width: 16px;
    height: 16px;
    margin-right: 4px;
    vertical-align: middle;
}

.option-icon {
    width: 14px;
    height: 14px;
    margin-right: 4px;
    vertical-align: middle;
}

.preview-label-icon {
    width: 16px;
    height: 16px;
    margin-right: 4px;
    vertical-align: middle;
}

.btn-icon {
    width: 16px;
    height: 16px;
    margin-right: 4px;
    vertical-align: middle;
}

.editor-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px;
    border-top: none;
    position: relative;
}

.editor-footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: repeating-linear-gradient(90deg, var(--accent-orange) 0px, var(--accent-orange) 6px, transparent 6px, transparent 12px);
    opacity: 0.3;
}

.btn-primary {
    background: var(--accent-orange);
    color: #fff;
    border: none;
    padding: 10px 24px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 700;
    font-family: var(--font-cartoon);
    cursor: pointer;
    transition: all 0.18s var(--ease-paper);
    box-shadow: 0 3px 12px rgba(232, 145, 90, 0.3);
}
.btn-primary:hover { background: #d4804a; transform: translateY(-3px); box-shadow: 0 6px 20px rgba(232, 145, 90, 0.4); }
.btn-primary:active { transform: translateY(1px); box-shadow: 0 1px 4px rgba(232, 145, 90, 0.2); }

.btn-secondary {
    background: var(--bg-card);
    color: var(--text-secondary);
    border: none;
    padding: 10px 24px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.18s var(--ease-paper);
    box-shadow: 0 2px 6px rgba(74, 63, 53, 0.06);
}
.btn-secondary:hover { color: var(--accent-orange); transform: translateY(-2px); box-shadow: 0 4px 12px rgba(232, 145, 90, 0.12); }

.my-articles-modal, .notifications-modal { max-width: 700px; }

.article-status {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    margin-top: 8px;
}
.article-status.pending { background: rgba(245, 217, 138, 0.2); color: #d4a017; }
.article-status.approved { background: rgba(123, 196, 127, 0.15); color: var(--accent-green); }
.article-status.rejected { background: rgba(224, 122, 106, 0.15); color: var(--accent-coral); }

.notification-item-card {
    background: var(--bg-card);
    border: none;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    transition: all 0.18s var(--ease-paper);
    box-shadow: var(--shadow-soft);
}
.notification-item-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); }
.notification-item-card.unread { box-shadow: var(--shadow-card), -3px 0 0 var(--accent-orange); }
.notification-title { font-weight: 700; font-size: 14px; margin-bottom: 6px; }
.notification-message { font-size: 13px; color: var(--text-secondary); line-height: 1.6; }
.notification-time { font-size: 11px; color: var(--text-secondary); margin-top: 8px; opacity: 0.7; }

/* ========================
   Mobile Responsive Design
   ======================== */

/* Tablet (768px - 1024px) */
@media (max-width: 1024px) {
    .cartoon-main {
        flex-direction: column;
        padding: 0 20px;
        gap: 20px;
    }
    .cartoon-main.three-column {
        flex-direction: column;
        max-width: 1100px;
    }
    .sidebar-left,
    .sidebar-right {
        width: 100%;
        position: static;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 16px;
    }
    .sidebar-chalkboard {
        width: 100%;
        position: static;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 16px;
    }
    .chalkboard-panel { flex: 1; min-width: 280px; }
    .stationery-card { flex: 1; min-width: 200px; }
    .quote-card { flex: 1; min-width: 200px; }
    .diary-card { flex-direction: column; }
    .diary-cover { width: 100%; height: 180px; }
    .paper-plane, .paper-star, .paper-cloud, .paper-leaf, .paper-bird { display: none; }
    .modal-body { padding: 30px 20px 30px 40px; }
    .back-to-top { bottom: 20px; right: 20px; width: 48px; height: 48px; }
}

/* Mobile (<= 768px) */
@media (max-width: 768px) {
    .cartoon-header {
        top: 0;
        padding-top: 5px;
    }
    .cartoon-header::after {
        height: 4px;
        bottom: -4px;
    }
    .header-inner {
        height: 52px;
        padding: 0 12px;
    }
    .logo-text { font-size: 18px; }
    .cartoon-nav { gap: 8px; }
    .nav-tab {
        padding: 6px 12px;
        font-size: 13px;
    }
    .cartoon-main {
        padding: 0 12px;
        gap: 16px;
    }
    .sidebar-chalkboard {
        flex-direction: column;
        gap: 12px;
    }
    .chalkboard-panel,
    .stationery-card,
    .quote-card {
        min-width: auto;
        width: 100%;
    }
    .chalkboard-body {
        min-height: 100px;
        padding: 12px;
    }
    .chalk-text { font-size: 13px; }
    .quote-card { min-height: 100px; padding: 16px; }
    .quote-text { font-size: 14px; }
    .stationery-stats { gap: 12px; }
    .stat-item { padding: 10px; }
    .stat-num { font-size: 20px; }

    .search-bar { margin-bottom: 16px; }
    .search-bar-inner { padding: 3px 12px; }
    .search-input { padding: 8px 0; font-size: 15px; }
    .tag-row {
        gap: 8px;
        margin-bottom: 16px;
        flex-wrap: wrap;
    }
    .tag-btn {
        padding: 6px 12px;
        font-size: 13px;
    }

    .diary-list { gap: 16px; }
    .diary-card {
        flex-direction: column;
        min-height: auto;
        border-radius: 14px;
    }
    .diary-cover {
        width: 100%;
        height: 200px;
        border-radius: 14px 14px 0 0;
    }
    .diary-info { padding: 14px 16px; }
    .diary-title { font-size: 16px; margin-bottom: 6px; }
    .diary-desc { font-size: 13px; }
    .diary-meta { margin-top: 10px; gap: 6px; }
    .diary-tag-badge { padding: 3px 8px; font-size: 11px; }
    .diary-time { font-size: 11px; }

    .load-more-btn {
        padding: 10px 24px;
        font-size: 14px;
    }

    .modal-notebook {
        max-width: 95%;
        max-height: 85vh;
        border-radius: 16px;
        padding: 16px;
    }
    .modal-body {
        padding: 20px 12px 20px 32px;
        font-size: 15px;
    }
    .modal-body h2 {
        font-size: 20px !important;
        margin-bottom: 12px !important;
    }
    .modal-body img {
        max-height: 250px;
        border-radius: 8px;
    }
    .modal-spiral { width: 24px; }
    .modal-spiral span { width: 14px; height: 14px; }
    .modal-toolbar { top: 12px; right: 12px; }
    .modal-tool-btn {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }

    .lightbox-overlay { padding: 10px; }
    .lightbox-overlay img { max-height: 70vh; }
    .lightbox-close-btn {
        top: 10px;
        right: 10px;
        width: 36px;
        height: 36px;
    }
    .lightbox-reset-btn {
        top: 10px;
        right: 54px;
        width: 36px;
        height: 36px;
        font-size: 18px;
    }

    .cartoon-footer { padding: 20px 16px; font-size: 13px; }

    .toast-msg {
        padding: 12px 24px;
        font-size: 13px;
        max-width: 90vw;
        text-align: center;
    }

    .search-page-title { font-size: 20px; }
    .search-go-btn {
        padding: 8px 16px;
        font-size: 13px;
    }
    .search-result-item { padding: 14px; }
    .search-result-title { font-size: 15px; }
    .search-result-desc { font-size: 13px; }
}

/* Small Mobile (<= 480px) */
@media (max-width: 480px) {
    .header-inner {
        height: 48px;
        flex-wrap: wrap;
        gap: 4px;
    }
    .logo-text { font-size: 16px; }
    .cartoon-nav {
        gap: 6px;
        flex-wrap: wrap;
        justify-content: flex-end;
    }
    .nav-tab {
        padding: 4px 10px;
        font-size: 12px;
        border-radius: 16px;
    }
    .user-area {
        gap: 4px;
    }
    .admin-name {
        font-size: 11px;
        max-width: 60px;
    }

    .cartoon-main { padding: 0 8px; }

    .chalkboard-top-bar { padding: 4px 10px; }
    .chalkboard-title { font-size: 13px; }
    .chalkboard-body { padding: 10px; min-height: 80px; }
    .chalk-text { font-size: 12px; }

    .tag-row { gap: 6px; }
    .tag-btn {
        padding: 5px 10px;
        font-size: 12px;
    }
    .tag-icon { width: 14px; height: 14px; }

    .diary-cover { height: 180px; }
    .diary-info { padding: 12px 14px; }
    .diary-title { font-size: 15px; }
    .diary-desc {
        font-size: 12px;
        -webkit-line-clamp: 2;
    }

    .modal-notebook {
        max-width: 98%;
        max-height: 90vh;
        padding: 12px;
        border-radius: 12px;
    }
    .modal-body {
        padding: 16px 10px 16px 28px;
        font-size: 14px;
        line-height: 1.7;
    }
    .modal-body h2 {
        font-size: 18px !important;
    }
    .modal-body img {
        max-height: 200px;
        margin: 8px 0;
    }
    .modal-spiral { width: 20px; }
    .modal-spiral span { width: 12px; height: 12px; }

    .back-to-top {
        width: 40px;
        height: 40px;
        bottom: 16px;
        right: 16px;
    }
}
