/* ============================================
   Coconut Diary — American Retro Style
   ============================================ */

:root {
    /* 核心配色 - 参考图片提取 */
    --bg-primary: #f4f1de;        /* 做旧米黄纸张 */
    --bg-dark: #1a1a2e;           /* 深墨蓝 */
    --bg-card: #fefae0;           /* 暖白卡片 */
    --accent-rust: #bc6c25;       /* 铁锈赭石 */
    --accent-red: #c73e1d;        /* 砖红 */
    --accent-green: #2d6a4f;      /* 墨绿 */
    --accent-blue: #4a4e69;       /* 灰蓝 */
    --accent-orange: #e07a5f;     /* 暖橙 */
    --text-primary: #1a1a2e;
    --text-secondary: #4a4e69;
    --text-muted: #9a9ab0;
    --border: #d4a373;
    --shadow: rgba(26, 26, 46, 0.12);

    /* 字体 */
    --font-serif: 'Playfair Display', Georgia, serif;
    --font-sans: 'Inter', -apple-system, sans-serif;
    --font-mono: 'Space Mono', monospace;

    /* 动画 */
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    font-family: var(--font-sans);
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.6;
}

/* ============================================
   背景层 & 装饰贴纸
   ============================================ */
.bg-layer {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.paper-texture {
    position: absolute;
    inset: 0;
    background: 
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 2px,
            rgba(188, 108, 37, 0.03) 2px,
            rgba(188, 108, 37, 0.03) 4px
        );
    opacity: 0.6;
}

/* 背景装饰贴纸 - 大面积淡色 */
.bg-sticker {
    position: absolute;
    background-size: cover;
    background-position: center;
    opacity: 0.06;
    filter: grayscale(40%) sepia(20%);
    border-radius: 4px;
    transition: opacity 0.6s ease;
}

.bg-fish { width: 280px; height: 380px; top: 5%; left: -5%; transform: rotate(-12deg); }
.bg-vinyl { width: 220px; height: 320px; top: 15%; right: -3%; transform: rotate(8deg); }
.bg-penfield1 { width: 200px; height: 280px; top: 50%; left: -4%; transform: rotate(5deg); }
.bg-penfield2 { width: 180px; height: 260px; top: 60%; right: -2%; transform: rotate(-6deg); }
.bg-match { width: 160px; height: 200px; bottom: 10%; left: 5%; transform: rotate(10deg); }
.bg-coffee { width: 200px; height: 260px; bottom: 5%; right: 8%; transform: rotate(-8deg); }
.bg-rolls { width: 180px; height: 240px; top: 30%; left: 10%; transform: rotate(3deg); opacity: 0.04; }
.bg-rijks { width: 160px; height: 220px; top: 70%; right: 15%; transform: rotate(-4deg); opacity: 0.04; }
.bg-penfield3 { width: 200px; height: 280px; top: 20%; left: -3%; transform: rotate(6deg); }
.bg-illustrated { width: 180px; height: 250px; bottom: 15%; right: -2%; transform: rotate(-7deg); }
.bg-saturday { width: 160px; height: 220px; top: 60%; left: 5%; transform: rotate(4deg); }
.bg-collier { width: 200px; height: 280px; top: 10%; left: -4%; transform: rotate(-5deg); }
.bg-panam { width: 180px; height: 260px; bottom: 10%; right: -3%; transform: rotate(8deg); }
.bg-outing { width: 200px; height: 260px; top: 50%; right: 5%; transform: rotate(-6deg); }
.bg-harpers { width: 220px; height: 300px; top: 30%; left: -5%; transform: rotate(10deg); }
.bg-poster { width: 180px; height: 250px; bottom: 20%; right: 5%; transform: rotate(-4deg); }

/* ============================================
   导航栏
   ============================================ */
.top-nav {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 2rem;
    background: rgba(244, 241, 222, 0.92);
    backdrop-filter: blur(12px);
    border-bottom: 2px solid var(--border);
    transition: all 0.3s var(--ease-out);
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-serif);
    font-size: 1.5rem;
    font-weight: 900;
    color: var(--accent-rust);
    letter-spacing: -0.02em;
}

.brand-icon { font-size: 1.3rem; filter: grayscale(20%); }

.nav-links {
    display: flex;
    gap: 0.25rem;
}

.nav-link {
    padding: 0.5rem 1.25rem;
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: 6px;
    transition: all 0.25s var(--ease-out);
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 2px;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--accent-rust);
    transition: all 0.3s var(--ease-out);
    transform: translateX(-50%);
}

.nav-link:hover {
    color: var(--accent-rust);
}

.nav-link:hover::after {
    width: 60%;
}

.nav-link.active {
    color: var(--accent-rust);
    font-weight: 600;
}

.nav-link.active::after {
    width: 60%;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-primary);
}

.mobile-menu {
    display: none;
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    background: var(--bg-primary);
    border-bottom: 2px solid var(--border);
    padding: 1rem;
    z-index: 99;
    flex-direction: column;
    gap: 0.5rem;
    transform: translateY(-100%);
    opacity: 0;
    transition: all 0.3s var(--ease-out);
}

.mobile-menu.open {
    transform: translateY(0);
    opacity: 1;
}

.mobile-menu a {
    padding: 0.75rem 1rem;
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 500;
    border-radius: 8px;
    transition: background 0.2s;
}

.mobile-menu a:hover {
    background: rgba(188, 108, 37, 0.1);
}

/* ============================================
   主内容区
   ============================================ */
.main-content {
    position: relative;
    z-index: 1;
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

/* ============================================
   页面头部
   ============================================ */
.page-header {
    position: relative;
    padding: 3rem 0 2rem;
    margin-bottom: 2rem;
    border-bottom: 3px double var(--border);
}

.page-title {
    font-family: var(--font-serif);
    font-size: 3.5rem;
    font-weight: 900;
    line-height: 1.1;
    color: var(--text-primary);
    letter-spacing: -0.03em;
}

.title-line {
    display: block;
}

.title-line.accent {
    color: var(--accent-rust);
    font-style: italic;
}

.page-subtitle {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 0.75rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.header-badge {
    position: absolute;
    top: 2rem;
    right: 0;
    padding: 0.4rem 1rem;
    border: 2px solid var(--accent-rust);
    border-radius: 4px;
    transform: rotate(3deg);
    transition: transform 0.3s var(--ease-spring);
}

.header-badge:hover {
    transform: rotate(0deg) scale(1.05);
}

.badge-text {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--accent-rust);
    letter-spacing: 0.15em;
}

/* 头部装饰贴纸 */
.header-sticker {
    position: absolute;
    background-size: cover;
    background-position: center;
    border-radius: 4px;
    box-shadow: 0 4px 20px var(--shadow);
    transition: all 0.4s var(--ease-spring);
}

.header-sticker:hover {
    transform: scale(1.08) rotate(2deg);
    z-index: 10;
}

.sticker-tape {
    width: 100px;
    height: 130px;
    top: -1rem;
    left: -1rem;
    transform: rotate(-15deg);
    opacity: 0.9;
}

.sticker-calendar {
    width: 90px;
    height: 120px;
    top: 0;
    right: 8rem;
    transform: rotate(8deg);
    opacity: 0.85;
}

.sticker-stats {
    width: 85px;
    height: 110px;
    top: 0.5rem;
    right: 7rem;
    transform: rotate(-6deg);
    opacity: 0.85;
}

.sticker-canvas {
    width: 90px;
    height: 120px;
    top: 0;
    right: 7rem;
    transform: rotate(10deg);
    opacity: 0.85;
}

/* ============================================
   操作栏 & 筛选
   ============================================ */
.action-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

/* 按钮 */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-family: var(--font-sans);
    font-size: 0.9rem;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.25s var(--ease-out);
    text-decoration: none;
}

.btn-primary {
    background: var(--accent-rust);
    color: white;
    box-shadow: 0 4px 14px rgba(188, 108, 37, 0.35);
}

.btn-primary:hover {
    background: #a05a1f;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(188, 108, 37, 0.45);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border: 2px solid var(--border);
}

.btn-ghost:hover {
    background: rgba(188, 108, 37, 0.08);
    border-color: var(--accent-rust);
    color: var(--accent-rust);
}

.btn-sm { padding: 0.5rem 1rem; font-size: 0.85rem; }

.btn-icon { font-size: 1.1rem; }

.btn-arrow {
    transition: transform 0.3s var(--ease-spring);
}

.btn:hover .btn-arrow {
    transform: translateY(3px);
}

/* 筛选标签 */
.filter-tabs {
    display: flex;
    gap: 0.5rem;
    background: rgba(212, 163, 115, 0.15);
    padding: 0.35rem;
    border-radius: 10px;
}

.tab {
    padding: 0.5rem 1rem;
    background: transparent;
    border: none;
    border-radius: 6px;
    font-family: var(--font-sans);
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.25s var(--ease-out);
}

.tab:hover {
    color: var(--accent-rust);
}

.tab.active {
    background: var(--bg-card);
    color: var(--accent-rust);
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

/* ============================================
   日记卡片网格
   ============================================ */
.diary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.diary-card {
    position: relative;
    background: var(--bg-card);
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid rgba(212, 163, 115, 0.3);
    box-shadow: 
        0 2px 8px rgba(26, 26, 46, 0.06),
        0 8px 24px rgba(26, 26, 46, 0.04);
    transition: all 0.4s var(--ease-out);
    opacity: 0;
    transform: translateY(20px);
    overflow: hidden;
}

.diary-card.visible {
    opacity: 1;
    transform: translateY(0);
}

.diary-card:hover {
    transform: translateY(-6px) rotate(0.5deg);
    box-shadow: 
        0 12px 32px rgba(26, 26, 46, 0.1),
        0 4px 12px rgba(26, 26, 46, 0.06);
    border-color: rgba(188, 108, 37, 0.5);
}

.diary-card.card-featured {
    grid-row: span 2;
}

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

/* 卡片装饰贴纸 */
.card-sticker {
    position: absolute;
    background-size: cover;
    background-position: center;
    border-radius: 4px;
    box-shadow: 0 3px 12px var(--shadow);
    transition: all 0.4s var(--ease-spring);
    z-index: 2;
}

.card-sticker-top {
    width: 60px;
    height: 80px;
    top: -10px;
    right: 20px;
    transform: rotate(12deg);
}

.card-sticker-right {
    width: 55px;
    height: 75px;
    top: 30px;
    right: -15px;
    transform: rotate(-8deg);
}

.card-sticker-left {
    width: 55px;
    height: 75px;
    top: 40px;
    left: -12px;
    transform: rotate(10deg);
}

.card-sticker-bottom {
    width: 60px;
    height: 80px;
    bottom: 20px;
    right: 15px;
    transform: rotate(-15deg);
}

.diary-card:hover .card-sticker {
    transform: scale(1.1) rotate(0deg);
}

/* 胶带装饰 */
.card-tape {
    position: absolute;
    top: -8px;
    left: 30%;
    width: 80px;
    height: 24px;
    background: rgba(188, 108, 37, 0.25);
    transform: rotate(-3deg);
    border-radius: 2px;
    backdrop-filter: blur(2px);
}

.card-tape::before {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        90deg,
        transparent,
        transparent 3px,
        rgba(255,255,255,0.3) 3px,
        rgba(255,255,255,0.3) 6px
    );
}

.tape-orange { background: rgba(224, 122, 95, 0.3); }
.tape-blue { background: rgba(74, 78, 105, 0.25); }
.tape-green { background: rgba(45, 106, 79, 0.25); }
.tape-red { background: rgba(199, 62, 29, 0.25); }
.tape-yellow { background: rgba(188, 108, 37, 0.25); }

/* 卡片头部 */
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.card-date {
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 1;
}

.date-day {
    font-family: var(--font-serif);
    font-size: 2.2rem;
    font-weight: 900;
    color: var(--accent-rust);
}

.date-month {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 0.15em;
    margin-top: 0.2rem;
}

.card-mood {
    font-size: 1.5rem;
    filter: grayscale(20%);
    transition: transform 0.3s var(--ease-spring);
}

.diary-card:hover .card-mood {
    transform: scale(1.2) rotate(-10deg);
}

/* 卡片照片 */
.card-photo {
    width: 100%;
    height: 180px;
    background-size: cover;
    background-position: center;
    border-radius: 8px;
    margin-bottom: 1rem;
    filter: sepia(15%) contrast(1.05);
    transition: all 0.4s ease;
}

.card-photo:hover {
    filter: sepia(5%) contrast(1.1);
}

.wide-photo { height: 220px; }

/* 卡片内容 */
.card-title {
    font-family: var(--font-serif);
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.card-preview {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 0.75rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 0.75rem;
}

.tag {
    padding: 0.2rem 0.6rem;
    background: rgba(188, 108, 37, 0.1);
    color: var(--accent-rust);
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 4px;
    font-family: var(--font-mono);
    transition: all 0.2s ease;
}

.tag:hover {
    background: rgba(188, 108, 37, 0.2);
    transform: translateY(-1px);
}

/* 语音波形 */
.voice-wave {
    display: flex;
    align-items: center;
    gap: 3px;
    height: 24px;
    margin-bottom: 0.75rem;
}

.voice-wave span {
    width: 3px;
    background: var(--accent-rust);
    border-radius: 2px;
    animation: wave 1.2s ease-in-out infinite;
}

.voice-wave span:nth-child(1) { height: 8px; animation-delay: 0s; }
.voice-wave span:nth-child(2) { height: 16px; animation-delay: 0.1s; }
.voice-wave span:nth-child(3) { height: 12px; animation-delay: 0.2s; }
.voice-wave span:nth-child(4) { height: 20px; animation-delay: 0.3s; }
.voice-wave span:nth-child(5) { height: 10px; animation-delay: 0.4s; }
.voice-wave span:nth-child(6) { height: 18px; animation-delay: 0.5s; }
.voice-wave span:nth-child(7) { height: 14px; animation-delay: 0.6s; }
.voice-wave span:nth-child(8) { height: 8px; animation-delay: 0.7s; }

@keyframes wave {
    0%, 100% { transform: scaleY(0.6); }
    50% { transform: scaleY(1); }
}

/* 卡片底部 */
.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 0.75rem;
    border-top: 1px dashed rgba(212, 163, 115, 0.4);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* 加载更多 */
.load-more {
    text-align: center;
    padding: 2rem 0;
}

/* 浮动按钮 */
.fab {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 56px;
    height: 56px;
    background: var(--accent-rust);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    text-decoration: none;
    box-shadow: 0 6px 20px rgba(188, 108, 37, 0.4);
    transition: all 0.3s var(--ease-spring);
    z-index: 50;
}

.fab:hover {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 8px 28px rgba(188, 108, 37, 0.5);
}

/* ============================================
   编辑器页面
   ============================================ */
.editor-page { background: var(--bg-primary); }

.editor-main { max-width: 1000px; }

.editor-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 2rem 0;
    border-bottom: 3px double var(--border);
    margin-bottom: 2rem;
    position: relative;
}

.editor-sticker {
    position: absolute;
    background-size: cover;
    background-position: center;
    border-radius: 4px;
    box-shadow: 0 4px 16px var(--shadow);
    transition: all 0.4s var(--ease-spring);
}

.editor-sticker:hover {
    transform: scale(1.08);
}

.sticker-left {
    width: 80px;
    height: 110px;
    top: -0.5rem;
    left: -1rem;
    transform: rotate(-10deg);
}

.date-display {
    display: flex;
    align-items: baseline;
    gap: 1rem;
}

.date-large {
    font-family: var(--font-serif);
    font-size: 4rem;
    font-weight: 900;
    color: var(--accent-rust);
    line-height: 1;
}

.date-info {
    display: flex;
    flex-direction: column;
}

.date-month-year {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--text-muted);
    letter-spacing: 0.1em;
}

.date-weekday {
    font-family: var(--font-serif);
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
}

.editor-actions {
    display: flex;
    gap: 0.75rem;
}

/* 编辑器布局 */
.editor-layout {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 2rem;
}

.editor-sidebar {
    position: sticky;
    top: 100px;
    height: fit-content;
}

.sidebar-sticker {
    position: absolute;
    width: 70px;
    height: 95px;
    background-size: cover;
    background-position: center;
    border-radius: 4px;
    top: -1rem;
    right: -0.5rem;
    transform: rotate(12deg);
    box-shadow: 0 3px 12px var(--shadow);
    transition: all 0.4s var(--ease-spring);
}

.sidebar-sticker:hover {
    transform: scale(1.1) rotate(5deg);
}

.tool-section {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 1.25rem;
    margin-bottom: 1rem;
    border: 1px solid rgba(212, 163, 115, 0.25);
    position: relative;
}

.tool-title {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    margin-bottom: 0.75rem;
}

.mood-picker, .weather-picker {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
}

.mood-btn, .weather-btn {
    width: 100%;
    aspect-ratio: 1;
    background: rgba(212, 163, 115, 0.1);
    border: 2px solid transparent;
    border-radius: 10px;
    font-size: 1.3rem;
    cursor: pointer;
    transition: all 0.25s var(--ease-spring);
    display: flex;
    align-items: center;
    justify-content: center;
}

.mood-btn:hover, .weather-btn:hover {
    background: rgba(188, 108, 37, 0.15);
    transform: scale(1.1);
}

.mood-btn.active, .weather-btn.active {
    border-color: var(--accent-rust);
    background: rgba(188, 108, 37, 0.2);
    transform: scale(1.05);
}

.tag-input-wrap {
    display: flex;
    gap: 0.4rem;
}

.tag-input {
    flex: 1;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: transparent;
    font-family: var(--font-sans);
    font-size: 0.85rem;
    outline: none;
    transition: border-color 0.2s;
}

.tag-input:focus {
    border-color: var(--accent-rust);
}

.tag-add {
    width: 36px;
    height: 36px;
    background: var(--accent-rust);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.2s;
}

.tag-add:hover {
    background: #a05a1f;
    transform: scale(1.1);
}

.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.5rem;
}

.editor-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.25rem 0.6rem;
    background: rgba(188, 108, 37, 0.12);
    color: var(--accent-rust);
    font-size: 0.8rem;
    border-radius: 4px;
    font-family: var(--font-mono);
}

.editor-tag button {
    background: none;
    border: none;
    color: var(--accent-rust);
    cursor: pointer;
    font-size: 0.9rem;
    padding: 0;
    line-height: 1;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.editor-tag button:hover {
    opacity: 1;
}

/* 编辑内容区 */
.editor-content {
    position: relative;
    background: var(--bg-card);
    border-radius: 16px;
    padding: 2rem;
    border: 1px solid rgba(212, 163, 115, 0.3);
}

.content-sticker {
    position: absolute;
    width: 70px;
    height: 95px;
    background-size: cover;
    background-position: center;
    border-radius: 4px;
    top: -0.5rem;
    right: -0.5rem;
    transform: rotate(-8deg);
    box-shadow: 0 4px 16px var(--shadow);
    transition: all 0.4s var(--ease-spring);
    z-index: 2;
}

.content-sticker:hover {
    transform: scale(1.1) rotate(0deg);
}

.editor-title {
    width: 100%;
    padding: 0.75rem 0;
    border: none;
    border-bottom: 2px solid var(--border);
    background: transparent;
    font-family: var(--font-serif);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    outline: none;
    margin-bottom: 1rem;
    transition: border-color 0.3s;
}

.editor-title:focus {
    border-color: var(--accent-rust);
}

.editor-title::placeholder {
    color: var(--text-muted);
    opacity: 0.6;
}

.editor-textarea {
    width: 100%;
    min-height: 300px;
    padding: 0.75rem 0;
    border: none;
    background: transparent;
    font-family: var(--font-sans);
    font-size: 1rem;
    line-height: 1.8;
    color: var(--text-primary);
    outline: none;
    resize: vertical;
}

.editor-textarea::placeholder {
    color: var(--text-muted);
    opacity: 0.5;
}

/* 媒体附件 */
.media-attachments {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin: 1rem 0;
}

.media-item {
    width: 100px;
    height: 100px;
    background-size: cover;
    background-position: center;
    border-radius: 8px;
    position: relative;
    filter: sepia(10%);
    transition: all 0.3s ease;
}

.media-item:hover {
    filter: sepia(0%);
    transform: scale(1.05);
}

.media-remove {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 24px;
    height: 24px;
    background: var(--accent-red);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.media-remove:hover {
    transform: scale(1.2);
}

/* 语音录制 */
.voice-recorder {
    background: rgba(212, 163, 115, 0.1);
    border-radius: 12px;
    padding: 1.25rem;
    margin: 1rem 0;
    display: flex;
    align-items: center;
    gap: 1rem;
    border: 1px dashed var(--border);
}

.voice-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.2rem;
    background: var(--accent-rust);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-family: var(--font-sans);
    font-weight: 600;
    transition: all 0.3s var(--ease-out);
}

.voice-btn:hover {
    background: #a05a1f;
    transform: translateY(-2px);
}

.voice-btn.recording {
    background: var(--accent-red);
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(199, 62, 29, 0.4); }
    50% { box-shadow: 0 0 0 12px rgba(199, 62, 29, 0); }
}

.voice-timer {
    font-family: var(--font-mono);
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-secondary);
}

.voice-wave-record {
    display: flex;
    align-items: center;
    gap: 3px;
    height: 30px;
    opacity: 0.3;
    transition: opacity 0.3s;
}

.voice-wave-record.active {
    opacity: 1;
}

.voice-wave-record span {
    width: 3px;
    background: var(--accent-rust);
    border-radius: 2px;
    animation: wave 0.8s ease-in-out infinite;
}

.voice-wave-record span:nth-child(1) { height: 10px; animation-delay: 0s; }
.voice-wave-record span:nth-child(2) { height: 20px; animation-delay: 0.1s; }
.voice-wave-record span:nth-child(3) { height: 15px; animation-delay: 0.2s; }
.voice-wave-record span:nth-child(4) { height: 25px; animation-delay: 0.3s; }
.voice-wave-record span:nth-child(5) { height: 12px; animation-delay: 0.4s; }

/* 编辑器工具栏 */
.editor-toolbar {
    display: flex;
    gap: 0.5rem;
    padding-top: 1rem;
    border-top: 1px dashed var(--border);
    margin-top: 1rem;
}

.toolbar-btn {
    width: 40px;
    height: 40px;
    background: rgba(212, 163, 115, 0.1);
    border: 1px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s var(--ease-out);
}

.toolbar-btn:hover {
    background: rgba(188, 108, 37, 0.15);
    border-color: var(--accent-rust);
    transform: translateY(-2px);
}

/* ============================================
   日历页面
   ============================================ */
.calendar-header { margin-bottom: 1rem; }

.calendar-nav {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.cal-nav-btn {
    width: 40px;
    height: 40px;
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text-secondary);
    transition: all 0.25s var(--ease-out);
}

.cal-nav-btn:hover {
    background: var(--accent-rust);
    color: white;
    border-color: var(--accent-rust);
    transform: scale(1.1);
}

.cal-current {
    text-align: center;
}

.cal-month {
    display: block;
    font-family: var(--font-serif);
    font-size: 1.8rem;
    font-weight: 900;
    color: var(--text-primary);
}

.cal-year {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-muted);
    letter-spacing: 0.1em;
}

.calendar-layout {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 2rem;
}

.cal-sidebar {
    position: sticky;
    top: 100px;
    height: fit-content;
}

.cal-sidebar .sidebar-sticker {
    width: 65px;
    height: 90px;
    top: -0.5rem;
    right: -0.3rem;
    transform: rotate(10deg);
}

.cal-stat-card {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 1.25rem;
    margin-bottom: 1rem;
    border: 1px solid rgba(212, 163, 115, 0.25);
    text-align: center;
    transition: all 0.3s var(--ease-out);
}

.cal-stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px var(--shadow);
}

.stat-number {
    display: block;
    font-family: var(--font-serif);
    font-size: 2.5rem;
    font-weight: 900;
    color: var(--accent-rust);
    line-height: 1;
}

.stat-label {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--text-muted);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-top: 0.3rem;
}

.cal-mood-chart {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 1.25rem;
    border: 1px solid rgba(212, 163, 115, 0.25);
}

.cal-mood-chart h4 {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    margin-bottom: 0.75rem;
}

.mood-bar {
    display: flex;
    height: 8px;
    border-radius: 4px;
    overflow: hidden;
}

.mood-seg {
    transition: width 0.6s var(--ease-out);
}

.mood-seg.happy { background: var(--accent-rust); }
.mood-seg.calm { background: var(--accent-green); }
.mood-seg.excited { background: var(--accent-orange); }
.mood-seg.sad { background: var(--accent-blue); }

.calendar-body {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 1.5rem;
    border: 1px solid rgba(212, 163, 115, 0.3);
}

.cal-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.cal-weekdays span {
    text-align: center;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: 0.5rem;
}

.cal-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.5rem;
}

.cal-day {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.25s var(--ease-out);
    position: relative;
    background: rgba(212, 163, 115, 0.05);
}

.cal-day.empty {
    background: transparent;
    cursor: default;
}

.cal-day:not(.empty):hover {
    background: rgba(188, 108, 37, 0.12);
    transform: scale(1.08);
}

.cal-day.today {
    background: var(--accent-rust);
    color: white;
}

.cal-day.today .day-num {
    color: white;
    font-weight: 700;
}

.cal-day.has-entry {
    background: rgba(188, 108, 37, 0.1);
    border: 1px solid rgba(188, 108, 37, 0.2);
}

.cal-day.has-entry:hover {
    background: rgba(188, 108, 37, 0.2);
    border-color: var(--accent-rust);
}

.day-num {
    font-family: var(--font-serif);
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.day-mood {
    font-size: 0.9rem;
    margin-top: 0.2rem;
    filter: grayscale(20%);
}

/* ============================================
   统计页面
   ============================================ */
.stats-overview {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.25rem;
    margin-bottom: 2.5rem;
}

.stat-card {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 1.5rem;
    text-align: center;
    border: 1px solid rgba(212, 163, 115, 0.25);
    transition: all 0.35s var(--ease-out);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--accent-rust);
    transform: scaleX(0);
    transition: transform 0.4s var(--ease-out);
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 32px var(--shadow);
}

.stat-card:hover::before {
    transform: scaleX(1);
}

.stat-card .stat-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    display: block;
    filter: grayscale(20%);
    transition: all 0.3s var(--ease-spring);
}

.stat-card:hover .stat-icon {
    transform: scale(1.2) rotate(-5deg);
    filter: grayscale(0%);
}

.stat-card .stat-value {
    font-family: var(--font-serif);
    font-size: 2.2rem;
    font-weight: 900;
    color: var(--text-primary);
    line-height: 1;
}

.stat-card .stat-label {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--text-muted);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-top: 0.4rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.stats-block {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 1.5rem;
    border: 1px solid rgba(212, 163, 115, 0.25);
    position: relative;
    transition: all 0.3s var(--ease-out);
}

.stats-block:hover {
    box-shadow: 0 8px 24px var(--shadow);
}

.stats-block.block-wide {
    grid-column: span 2;
}

.block-sticker {
    position: absolute;
    width: 55px;
    height: 75px;
    background-size: cover;
    background-position: center;
    border-radius: 4px;
    top: -0.5rem;
    right: 1rem;
    transform: rotate(-8deg);
    box-shadow: 0 3px 12px var(--shadow);
    transition: all 0.4s var(--ease-spring);
    z-index: 2;
}

.block-sticker:hover {
    transform: scale(1.1) rotate(0deg);
}

.block-title {
    font-family: var(--font-serif);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1.25rem;
}

/* 心情趋势图 */
.chart-container {
    position: relative;
    height: 200px;
}

.mood-trend-chart {
    position: relative;
    height: 160px;
    border-bottom: 2px solid var(--border);
    border-left: 2px solid var(--border);
}

.trend-line {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 100%;
    background: linear-gradient(
        to top,
        rgba(188, 108, 37, 0.1) 0%,
        rgba(188, 108, 37, 0.05) 50%,
        transparent 100%
    );
}

.trend-points {
    position: absolute;
    inset: 0;
}

.trend-point {
    position: absolute;
    width: 12px;
    height: 12px;
    background: var(--accent-rust);
    border-radius: 50%;
    border: 3px solid var(--bg-card);
    box-shadow: 0 2px 8px rgba(188, 108, 37, 0.3);
    transition: all 0.3s var(--ease-spring);
    cursor: pointer;
}

.trend-point:hover {
    transform: scale(1.5);
    box-shadow: 0 4px 16px rgba(188, 108, 37, 0.5);
}

.chart-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 0.5rem;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* 标签云 */
.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    align-items: center;
    min-height: 160px;
}

.cloud-tag {
    padding: 0.4rem 0.9rem;
    background: rgba(188, 108, 37, 0.1);
    color: var(--accent-rust);
    border-radius: 6px;
    font-family: var(--font-mono);
    cursor: pointer;
    transition: all 0.3s var(--ease-spring);
    opacity: 0;
    transform: scale(0.8);
}

.cloud-tag.visible {
    opacity: 1;
    transform: scale(1);
}

.cloud-tag:hover {
    background: var(--accent-rust);
    color: white;
    transform: scale(1.15) rotate(-2deg);
}

.cloud-tag.size-sm { font-size: 0.75rem; }
.cloud-tag.size-md { font-size: 0.9rem; font-weight: 600; }
.cloud-tag.size-lg { font-size: 1.1rem; font-weight: 700; }
.cloud-tag.size-xl { font-size: 1.4rem; font-weight: 900; }

/* 习惯图表 */
.habit-chart {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.habit-row {
    display: grid;
    grid-template-columns: 60px 1fr 40px;
    align-items: center;
    gap: 1rem;
}

.habit-day {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.habit-bar {
    height: 10px;
    background: rgba(212, 163, 115, 0.15);
    border-radius: 5px;
    overflow: hidden;
}

.habit-bar span {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, var(--accent-rust), var(--accent-orange));
    border-radius: 5px;
    transition: width 0.8s var(--ease-out);
}

.habit-count {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--accent-rust);
    text-align: right;
}

/* 心情分布 */
.mood-distribution {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.mood-item {
    display: grid;
    grid-template-columns: 36px 1fr 50px;
    align-items: center;
    gap: 0.75rem;
}

.mood-emoji {
    font-size: 1.3rem;
    text-align: center;
    filter: grayscale(20%);
    transition: all 0.3s var(--ease-spring);
}

.mood-item:hover .mood-emoji {
    transform: scale(1.3) rotate(-10deg);
    filter: grayscale(0%);
}

.mood-progress {
    height: 8px;
    background: rgba(212, 163, 115, 0.15);
    border-radius: 4px;
    overflow: hidden;
}

.mood-progress span {
    display: block;
    height: 100%;
    background: var(--accent-rust);
    border-radius: 4px;
    transition: width 0.8s var(--ease-out);
}

.mood-pct {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-align: right;
}

/* ============================================
   画布页面
   ============================================ */
.canvas-layout {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 1.5rem;
    height: calc(100vh - 200px);
    min-height: 500px;
}

.canvas-toolbar {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 1.25rem;
    border: 1px solid rgba(212, 163, 115, 0.25);
    overflow-y: auto;
    position: relative;
}

.toolbar-sticker {
    position: absolute;
    width: 55px;
    height: 75px;
    background-size: cover;
    background-position: center;
    border-radius: 4px;
    top: -0.5rem;
    right: -0.3rem;
    transform: rotate(12deg);
    box-shadow: 0 3px 12px var(--shadow);
    transition: all 0.4s var(--ease-spring);
}

.toolbar-sticker:hover {
    transform: scale(1.1) rotate(5deg);
}

.tool-group {
    margin-bottom: 1.25rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px dashed rgba(212, 163, 115, 0.3);
}

.tool-group:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.canvas-tool {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    width: 100%;
    padding: 0.5rem 0.75rem;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    font-family: var(--font-sans);
    font-size: 0.85rem;
    color: var(--text-secondary);
    transition: all 0.25s var(--ease-out);
    margin-bottom: 0.3rem;
}

.canvas-tool:hover {
    background: rgba(188, 108, 37, 0.08);
    color: var(--accent-rust);
}

.canvas-tool.active {
    background: rgba(188, 108, 37, 0.15);
    border-color: var(--accent-rust);
    color: var(--accent-rust);
    font-weight: 600;
}

.tool-icon {
    font-size: 1.1rem;
    width: 24px;
    text-align: center;
}

.color-palette {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
}

.color-btn {
    width: 100%;
    aspect-ratio: 1;
    border: 3px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.25s var(--ease-spring);
}

.color-btn:hover {
    transform: scale(1.15);
}

.color-btn.active {
    border-color: var(--text-primary);
    transform: scale(1.1);
    box-shadow: 0 2px 8px var(--shadow);
}

.canvas-area {
    position: relative;
    background: var(--bg-card);
    border-radius: 16px;
    border: 1px solid rgba(212, 163, 115, 0.3);
    overflow: hidden;
    box-shadow: inset 0 0 40px rgba(212, 163, 115, 0.05);
}

.canvas-sticker {
    position: absolute;
    background-size: cover;
    background-position: center;
    border-radius: 4px;
    box-shadow: 0 4px 16px var(--shadow);
    opacity: 0.7;
    transition: all 0.4s var(--ease-spring);
    z-index: 1;
    pointer-events: none;
}

.canvas-sticker:hover {
    opacity: 1;
    transform: scale(1.05);
}

.sticker-tl { width: 70px; height: 95px; top: 10px; left: 10px; transform: rotate(-10deg); }
.sticker-tr { width: 70px; height: 95px; top: 10px; right: 10px; transform: rotate(8deg); }
.sticker-bl { width: 70px; height: 95px; bottom: 10px; left: 10px; transform: rotate(6deg); }
.sticker-br { width: 70px; height: 95px; bottom: 10px; right: 10px; transform: rotate(-8deg); }

.drawing-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    cursor: crosshair;
    z-index: 2;
}

.canvas-stickers-layer {
    position: absolute;
    inset: 0;
    z-index: 3;
    pointer-events: none;
}

.canvas-sticker-item {
    position: absolute;
    width: 100px;
    height: 130px;
    background-size: cover;
    background-position: center;
    border-radius: 6px;
    box-shadow: 0 4px 20px var(--shadow);
    cursor: move;
    pointer-events: auto;
    transition: all 0.3s var(--ease-spring);
    border: 2px solid rgba(255,255,255,0.5);
}

.canvas-sticker-item:hover {
    transform: scale(1.1) rotate(0deg) !important;
    z-index: 10;
    box-shadow: 0 8px 32px var(--shadow);
}

/* ============================================
   页脚
   ============================================ */
.site-footer {
    position: relative;
    text-align: center;
    padding: 3rem 2rem;
    margin-top: 3rem;
    border-top: 3px double var(--border);
}

.footer-sticker {
    position: absolute;
    width: 80px;
    height: 110px;
    background-size: cover;
    background-position: center;
    border-radius: 4px;
    top: -2rem;
    left: 50%;
    transform: translateX(-50%) rotate(-5deg);
    box-shadow: 0 4px 16px var(--shadow);
    transition: all 0.4s var(--ease-spring);
}

.footer-sticker:hover {
    transform: translateX(-50%) scale(1.1) rotate(0deg);
}

.site-footer p {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-muted);
    letter-spacing: 0.1em;
}

/* ============================================
   响应式设计
   ============================================ */
@media (max-width: 900px) {
    .diary-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .diary-card.card-wide {
        grid-column: span 2;
    }
    .editor-layout,
    .calendar-layout,
    .canvas-layout {
        grid-template-columns: 1fr;
    }
    .editor-sidebar,
    .cal-sidebar,
    .canvas-toolbar {
        position: static;
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 1rem;
    }
    .stats-overview {
        grid-template-columns: repeat(2, 1fr);
    }
    .stats-grid {
        grid-template-columns: 1fr;
    }
    .stats-block.block-wide {
        grid-column: span 1;
    }
    .page-title {
        font-size: 2.5rem;
    }
}

@media (max-width: 600px) {
    .nav-links { display: none; }
    .menu-toggle { display: block; }
    .mobile-menu { display: flex; }
    .main-content { padding: 1rem; }
    .diary-grid {
        grid-template-columns: 1fr;
    }
    .diary-card.card-wide {
        grid-column: span 1;
    }
    .diary-card.card-featured {
        grid-row: span 1;
    }
    .stats-overview {
        grid-template-columns: repeat(2, 1fr);
    }
    .page-title {
        font-size: 2rem;
    }
    .header-badge { display: none; }
    .header-sticker,
    .card-sticker,
    .editor-sticker,
    .content-sticker,
    .sidebar-sticker,
    .block-sticker,
    .canvas-sticker {
        display: none;
    }
    .bg-sticker {
        display: none;
    }
    .fab {
        bottom: 1rem;
        right: 1rem;
        width: 48px;
        height: 48px;
    }
}

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

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

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

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-rust);
}

/* ============================================
   选择高亮
   ============================================ */
::selection {
    background: rgba(188, 108, 37, 0.25);
    color: var(--text-primary);
}
