:root {
    --border-color: #d9534f;
    --year-color: #d9534f;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: #333;
    line-height: 1.4;
    min-height: 100vh;
    background-color: #f5f5f5;
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    transition: background 0.3s ease;
}

/* 背景图案样式 */
body.pattern-solid {
    background: #f5f5f5;
}

body.pattern-gradient1 {
    background:
        radial-gradient(circle at 20% 30%, rgba(102, 126, 234, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(118, 75, 162, 0.3) 0%, transparent 50%),
        linear-gradient(135deg, #a8b4f0 0%, #b8a8d8 50%, #c4b8e0 100%);
}

body.pattern-gradient2 {
    background:
        radial-gradient(circle at 30% 20%, rgba(240, 147, 251, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 70% 80%, rgba(245, 87, 108, 0.3) 0%, transparent 50%),
        linear-gradient(135deg, #f5c4f8 0%, #f8a8b8 50%, #fab8c8 100%);
}

body.pattern-gradient3 {
    background:
        radial-gradient(circle at 25% 25%, rgba(78, 205, 196, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 75% 75%, rgba(69, 183, 209, 0.3) 0%, transparent 50%),
        linear-gradient(135deg, #a8e8e0 0%, #b8e0f0 50%, #c8e8f5 100%);
}

body.pattern-gradient4 {
    background: linear-gradient(135deg, #ff9a9e 0%, #fecfef 100%);
}

body.pattern-gradient5 {
    background: linear-gradient(135deg, #84fab0 0%, #8fd3f4 100%);
}

body.pattern-gradient6 {
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
}

body.pattern-gradient7 {
    background: linear-gradient(135deg, #fccb90 0%, #d57eeb 100%);
}

body.pattern-gradient8 {
    background: linear-gradient(135deg, #a18cd1 0%, #fbc2eb 100%);
}

/* 颜色选择面板样式 */
.color-section {
    margin-bottom: 6px;
}

.color-section:last-child {
    margin-bottom: 0;
}

.color-section h4 {
    margin-bottom: 5px !important;
    font-size: 10px !important;
}

/* 渐变色按钮样式 */
.gradient-buttons {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 3px;
}

/* 预设颜色样式 */
.preset-colors {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 3px;
}

.gradient-btn {
    width: 100%;
    aspect-ratio: 1;
    border: 2px solid #fff;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    background: linear-gradient(135deg, #e0e0e0 0%, #f0f0f0 100%);
}

.gradient-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.gradient-btn.active {
    border-color: #667eea;
}

.gradient-btn[data-gradient="gradient1"] {
    background:
        radial-gradient(circle at 30% 30%, rgba(102, 126, 234, 0.4) 0%, transparent 60%),
        linear-gradient(135deg, #a8b4f0 0%, #b8a8d8 50%, #c4b8e0 100%);
}

.gradient-btn[data-gradient="gradient2"] {
    background:
        radial-gradient(circle at 30% 30%, rgba(240, 147, 251, 0.4) 0%, transparent 60%),
        linear-gradient(135deg, #f5c4f8 0%, #f8a8b8 50%, #fab8c8 100%);
}

.gradient-btn[data-gradient="gradient3"] {
    background:
        radial-gradient(circle at 30% 30%, rgba(78, 205, 196, 0.4) 0%, transparent 60%),
        linear-gradient(135deg, #a8e8e0 0%, #b8e0f0 50%, #c8e8f5 100%);
}

.gradient-btn[data-gradient="gradient4"] {
    background: linear-gradient(135deg, #ff9a9e 0%, #fecfef 100%);
}

.gradient-btn[data-gradient="gradient5"] {
    background: linear-gradient(135deg, #84fab0 0%, #8fd3f4 100%);
}

.gradient-btn[data-gradient="gradient6"] {
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
}

.gradient-btn[data-gradient="gradient7"] {
    background: linear-gradient(135deg, #fccb90 0%, #d57eeb 100%);
}

.gradient-btn[data-gradient="gradient8"] {
    background: linear-gradient(135deg, #a18cd1 0%, #fbc2eb 100%);
}

body.pattern-dots {
    background-color: #f5f5f5;
    background-image: radial-gradient(circle, #ddd 1px, transparent 1px);
    background-size: 20px 20px;
}

body.pattern-lines {
    background: repeating-linear-gradient(
        45deg,
        #f5f5f5,
        #f5f5f5 10px,
        #e0e0e0 10px,
        #e0e0e0 11px
    );
}

body.pattern-stars {
    background-color: #1a1a2e;
    background-image: 
        radial-gradient(2px 2px at 20px 30px, #fff, transparent),
        radial-gradient(2px 2px at 40px 70px, #fff, transparent),
        radial-gradient(2px 2px at 50px 160px, #fff, transparent),
        radial-gradient(2px 2px at 90px 40px, #fff, transparent),
        radial-gradient(2px 2px at 130px 80px, #fff, transparent),
        radial-gradient(2px 2px at 160px 120px, #fff, transparent);
    background-size: 200px 200px;
}

body.pattern-circles {
    background: radial-gradient(circle at 50% 50%, rgba(102, 126, 234, 0.1) 0%, transparent 50%),
                radial-gradient(circle at 20% 30%, rgba(240, 147, 251, 0.1) 0%, transparent 40%),
                radial-gradient(circle at 80% 70%, rgba(78, 205, 196, 0.1) 0%, transparent 40%);
    background-color: #fafafa;
}

body.pattern-waves {
    background: repeating-radial-gradient(
        circle at 0 0,
        transparent 0,
        #f0f0f0 10px,
        transparent 11px,
        transparent 20px
    ), repeating-linear-gradient(
        #e8e8e8,
        #e8e8e8
    );
    background-color: #f5f5f5;
}

body.pattern-hexagon {
    background-color: #f5f5f5;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='49' viewBox='0 0 28 49'%3E%3Cg fill-rule='evenodd'%3E%3Cg fill='%23dddddd' fill-opacity='0.4'%3E%3Cpath d='M13.99 9.25l13 7.5v15l-13 7.5L1 31.75v-15l12.99-7.5zM3 17.9v12.7l10.99 6.34 11-6.35V17.9l-11-6.34L3 17.9zM0 15l12.98-7.5V0h-2v6.35L0 12.69v2.3zm0 18.5L12.98 41v8h-2v-6.85L0 35.81v-2.3zM15 0v7.5L27.99 15H28v-2.31h-.01L17 6.35V0h-2zm0 49v-8l12.99-7.5H28v2.31h-.01L17 42.15V49h-2z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

body.pattern-noise {
    background-color: #f5f5f5;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.15'/%3E%3C/svg%3E");
}

body.pattern-grid {
    background-color: #f5f5f5;
    background-image:
        linear-gradient(#e0e0e0 1px, transparent 1px),
        linear-gradient(90deg, #e0e0e0 1px, transparent 1px);
    background-size: 30px 30px;
}

/* 精美背景图片 */
body.pattern-sunset {
    background: linear-gradient(135deg, #ff6b6b 0%, #feca57 50%, #ff9ff3 100%);
    background-size: cover;
    background-attachment: fixed;
}

body.pattern-ocean {
    background: linear-gradient(180deg, #00d2ff 0%, #3a7bd5 50%, #1e3c72 100%);
    background-size: cover;
    background-attachment: fixed;
}

body.pattern-forest {
    background: linear-gradient(135deg, #134e5e 0%, #71b280 100%);
    background-size: cover;
    background-attachment: fixed;
}

body.pattern-aurora {
    background: linear-gradient(135deg, #00f260 0%, #0575e6 50%, #021b79 100%);
    background-size: 400% 400%;
    animation: auroraFlow 15s ease infinite;
}

@keyframes auroraFlow {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

body.pattern-cherry {
    background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 30%, #ff6b9d 70%, #c44569 100%);
    background-size: cover;
    background-attachment: fixed;
}

body.pattern-midnight {
    background: linear-gradient(135deg, #0f0c29 0%, #302b63 50%, #24243e 100%);
    background-size: cover;
    background-attachment: fixed;
}

body.pattern-sakura {
    background-color: #ffeef8;
    background-image:
        radial-gradient(circle at 20% 30%, rgba(255, 182, 193, 0.4) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(255, 192, 203, 0.3) 0%, transparent 40%),
        radial-gradient(circle at 50% 50%, rgba(255, 218, 225, 0.5) 0%, transparent 60%);
    background-size: cover;
}

body.pattern-mountain {
    background: linear-gradient(to bottom, #87CEEB 0%, #E0F6FF 30%, #98D8C8 60%, #5D8A66 100%);
    background-size: cover;
    background-attachment: fixed;
}

/* Unsplash 开源图片背景 */
body.pattern-unsplash-nature {
    background-image: url('https://images.unsplash.com/photo-1506905925346-21bda4d32df4?w=1920&h=1080&fit=crop');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
}

body.pattern-unsplash-ocean {
    background-image: url('https://images.unsplash.com/photo-1505118380757-91f5f5632de0?w=1920&h=1080&fit=crop');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
}

body.pattern-unsplash-forest {
    background-image: url('https://images.unsplash.com/photo-1448375240586-882707db888b?w=1920&h=1080&fit=crop');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
}

body.pattern-unsplash-sunset {
    background-image: url('https://images.unsplash.com/photo-1495616811223-4d98c6e9c869?w=1920&h=1080&fit=crop');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
}

body.pattern-unsplash-starry {
    background-image: url('https://images.unsplash.com/photo-1519681393784-d120267933ba?w=1920&h=1080&fit=crop');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
}

body.pattern-unsplash-flowers {
    background-image: url('https://images.unsplash.com/photo-1490750967868-88aa4486c946?w=1920&h=1080&fit=crop');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
}

body.pattern-unsplash-city {
    background-image: url('https://images.unsplash.com/photo-1477959858617-67f85cf4f1df?w=1920&h=1080&fit=crop');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
}

body.pattern-unsplash-abstract {
    background-image: url('https://images.unsplash.com/photo-1541701494587-cb58502866ab?w=1920&h=1080&fit=crop');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
}

body.pattern-unsplash-beach {
    background-image: url('https://images.unsplash.com/photo-1507525428034-b723cf961d3e?w=1920&h=1080&fit=crop');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
}

body.pattern-unsplash-lake {
    background-image: url('https://images.unsplash.com/photo-1439066615861-d1af74d74000?w=1920&h=1080&fit=crop');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
}

body.pattern-unsplash-desert {
    background-image: url('https://images.unsplash.com/photo-1509316785289-025f5b846b35?w=1920&h=1080&fit=crop');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
}

body.pattern-unsplash-waterfall {
    background-image: url('https://images.unsplash.com/photo-1432405972618-c60b0225b8f9?w=1920&h=1080&fit=crop');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
}

body.pattern-unsplash-road {
    background-image: url('https://images.unsplash.com/photo-1469854523086-cc02fe5d8800?w=1920&h=1080&fit=crop');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
}

body.pattern-unsplash-rain {
    background-image: url('https://images.unsplash.com/photo-1515694346937-94d85e41e6f0?w=1920&h=1080&fit=crop');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
}

body.pattern-unsplash-space {
    background-image: url('https://images.unsplash.com/photo-1451187580459-43490279c0fa?w=1920&h=1080&fit=crop');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 10px;
    position: relative;
}

/* 背景图案选择器 */
.bg-pattern-picker {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 50px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    z-index: 100;
    overflow: hidden;
    transition: all 0.3s ease;
}

.bg-pattern-picker.collapsed {
    width: 50px;
    height: 50px;
    border-radius: 50%;
}

.bg-pattern-picker.expanded {
    border-radius: 10px;
    width: auto;
    min-width: 220px;
}

.picker-header {
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-weight: 600;
    transition: all 0.3s ease;
    width: 50px;
    height: 50px;
    border-radius: 50%;
}

.bg-pattern-picker.expanded .picker-header {
    width: 100%;
    height: auto;
    border-radius: 0;
    padding: 6px 10px;
    font-size: 13px;
    justify-content: center;
}

.picker-header:hover {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
    transform: scale(1.05);
}

.toggle-icon {
    font-size: 20px;
    display: block;
    transition: transform 0.3s ease;
}

.bg-pattern-picker.expanded .toggle-icon {
    transform: rotate(180deg);
}

.picker-content {
    padding: 8px 10px;
    transition: all 0.3s ease;
    max-height: 500px;
    overflow: hidden;
    opacity: 1;
}

.bg-pattern-picker.collapsed .picker-content {
    max-height: 0;
    padding: 0 12px;
    opacity: 0;
}

.pattern-tabs {
    display: flex;
    gap: 3px;
    margin-bottom: 6px;
}

.tab-btn {
    flex: 1;
    padding: 4px 8px;
    border: none;
    background: #f0f0f0;
    border-radius: 5px;
    cursor: pointer;
    font-size: 10px;
    color: #666;
    transition: all 0.3s ease;
}

.tab-btn:hover {
    background: #e0e0e0;
}

.tab-btn.active {
    background: #667eea;
    color: white;
}

.pattern-panel {
    display: none;
}

.pattern-panel.active {
    display: block;
}

/* 纯色选择面板 */
#customColor {
    width: 100%;
    height: 40px;
    border: 2px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
    margin-bottom: 8px;
    padding: 0;
}

.preset-colors {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 3px;
}

.color-preset {
    width: 100%;
    aspect-ratio: 1;
    border: 2px solid transparent;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.color-preset:hover {
    transform: scale(1.1);
    border-color: #667eea;
}

.color-preset.active {
    border-color: #667eea;
}

/* 模板选择面板 */
.template-buttons {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 3px;
}

.template-btn {
    width: 100%;
    aspect-ratio: 1;
    border: 2px solid #ddd;
    background: white;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    color: #666;
}

.template-btn:hover {
    border-color: #667eea;
    transform: scale(1.05);
}

.template-btn.active {
    border-color: #667eea;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.template-btn.image-btn {
    font-size: 18px;
    border: 2px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

.template-btn.image-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.template-btn.image-btn.active {
    border-color: #fff;
    box-shadow: 0 0 0 2px #667eea, 0 4px 12px rgba(0,0,0,0.3);
}

/* 年份标题和导航 */
.year-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 30px;
    margin-bottom: 25px;
    position: relative;
    flex-wrap: wrap;
}

/* 全局按钮容器 - 固定在页面右上角 */
.global-buttons {
    position: fixed !important;
    right: 20px !important;
    top: 20px !important;
    display: flex;
    gap: 10px;
    align-items: center;
    z-index: 1000;
}

/* 全局加载数据按钮 */
.global-load-btn {
    padding: 10px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    letter-spacing: 0.5px;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
}

.global-load-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.global-load-btn:active {
    transform: scale(0.98);
}

/* 下拉箭头 */
.dropdown-arrow {
    font-size: 10px;
    transition: transform 0.3s ease;
}

.global-load-btn.active .dropdown-arrow {
    transform: rotate(180deg);
}

/* 下拉菜单 */
.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    min-width: 160px;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1000;
}

.dropdown-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* 下拉菜单项 */
.dropdown-item {
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #333;
    font-size: 14px;
    font-weight: 500;
}

.dropdown-item:hover {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    color: #667eea;
}

.dropdown-item:active {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.2) 0%, rgba(118, 75, 162, 0.2) 100%);
}

.dropdown-icon {
    font-size: 16px;
}

.year-arrow {
    background: transparent;
    border: none;
    font-size: 48px;
    font-weight: 300;
    color: #FF6B6B;
    cursor: pointer;
    padding: 0 10px;
    transition: all 0.3s ease;
    line-height: 1;
    opacity: 0.6;
}

.year-arrow:hover {
    color: #98FB98;
    transform: scale(1.2);
    opacity: 1;
}

/* 年份标题 - 彩色动态渐变 */
.year-title {
    text-align: center;
    font-size: 68px;
    font-weight: 700;
    margin: 0;
    letter-spacing: 12px;
    font-family: 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(90deg, #FF6B6B, #FFA07A, #FFD700, #98FB98, #87CEEB, #DDA0DD, #FF6B6B);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: colorShift 3s linear infinite;
    user-select: none;
    position: relative;
    text-shadow: none;
    transition: opacity 0.3s ease;
}

.year-title.paused {
    opacity: 0.6;
}

@keyframes colorShift {
    0% { background-position: 0% center; }
    100% { background-position: 200% center; }
}

/* 日历容器 */
.calendar-container {
    padding: 10px;
    background: transparent;
    display: flex;
    align-items: center;
    gap: 20px;
}

/* 侧边年份箭头 */
.side-arrow {
    background: transparent;
    border: none;
    font-size: 48px;
    color: #999;
    cursor: pointer;
    padding: 0 10px;
    transition: all 0.2s ease;
    flex-shrink: 0;
    line-height: 1;
}

.side-arrow:hover {
    color: #666;
    transform: scale(1.05);
}

.side-arrow:active {
    transform: scale(0.95);
}

/* 月份网格 - 4列 */
.months-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    flex: 1;
}

/* 月份容器 - 便签样式 */
.month-container {
    background: #ffffff;
    border-radius: 2px;
    padding: 0;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.2), 0 1px 4px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: visible;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    min-height: 20px;
}

.month-container:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2), 0 2px 6px rgba(0, 0, 0, 0.1);
}

/* 月份标题 */
.month-title {
    padding: 6px 8px;
    text-align: center;
    color: white;
    font-weight: bold;
    font-size: 13px;
    letter-spacing: 1px;
    text-transform: uppercase;
    border-radius: 2px 2px 0 0;
}

/* 不同月份的颜色 - 12种不同颜色 */
.month-container[data-month="1"] .month-title { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); }
.month-container[data-month="2"] .month-title { background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%); }
.month-container[data-month="3"] .month-title { background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%); }
.month-container[data-month="4"] .month-title { background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%); }
.month-container[data-month="5"] .month-title { background: linear-gradient(135deg, #fa709a 0%, #fee140 100%); }
.month-container[data-month="6"] .month-title { background: linear-gradient(135deg, #30cfd0 0%, #330867 100%); }
.month-container[data-month="7"] .month-title { background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%); }
.month-container[data-month="8"] .month-title { background: linear-gradient(135deg, #ff9a9e 0%, #fecfef 100%); }
.month-container[data-month="9"] .month-title { background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%); }
.month-container[data-month="10"] .month-title { background: linear-gradient(135deg, #a1c4fd 0%, #c2e9fb 100%); }
.month-container[data-month="11"] .month-title { background: linear-gradient(135deg, #d4fc79 0%, #96e6a1 100%); }
.month-container[data-month="12"] .month-title { background: linear-gradient(135deg, #84fab0 0%, #8fd3f4 100%); }

/* 星期标题 */
.weekday-header {
    display: flex;
    padding: 2px 1px 1px;
    font-weight: 600;
    font-size: 8px;
    color: #999;
    text-transform: uppercase;
}

.weekday {
    flex: 1;
    text-align: center;
    padding: 0;
    font-size: 8px;
}

.weekday:last-child {
    border-right: none;
}

/* 日历网格 */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0;
    padding: 0;
}

/* 日历日期 */
.calendar-day {
    height: 30px !important;
    min-height: 30px !important;
    max-height: 30px !important;
    padding: 2px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 9px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    border-radius: 0 !important;
    color: #333;
    background: transparent;
    box-sizing: border-box !important;
}

.calendar-day:nth-child(7n) {
    border-right: none;
}

.calendar-day:nth-last-child(-n+7) {
    border-bottom: none;
}

.calendar-day:hover {
    background-color: #f0f0f0;
    transform: scale(1.1);
}

.calendar-day.other-month {
    color: #ccc;
    cursor: default;
}

.calendar-day.today {
    color: #333;
}

.calendar-day.has-record {
    background-color: #e8f5e9;
    border: 2px solid #66bb6a;
    font-weight: 700;
    color: #2e7d32;
    box-shadow: 0 2px 8px rgba(102, 187, 106, 0.25);
    border-radius: 50%;
}
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.5);
}

.modal-content {
    background-color: #ffffff;
    margin: 10% auto;
    padding: 0;
    border: none;
    width: 85%;
    max-width: 700px;
    border-radius: 2px;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.2), 0 1px 4px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 15px;
    background: linear-gradient(135deg, #ff9a9e 0%, #fecfef 100%);
    color: white;
    font-weight: bold;
    font-size: 14px;
    letter-spacing: 0.5px;
}

.modal-header h3 {
    margin: 0;
    color: white;
}

/* 弹窗标题输入框样式 */
.modal-title-input {
    flex: 1;
    background: transparent;
    border: none;
    border-bottom: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    font-size: 14px;
    font-weight: bold;
    padding: 4px 8px;
    margin-right: 10px;
    outline: none;
    transition: all 0.2s ease;
}

.modal-title-input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.modal-title-input:focus {
    border-bottom-color: rgba(255, 255, 255, 0.8);
    background: rgba(255, 255, 255, 0.1);
}

.modal-header button {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: white;
    opacity: 0.8;
    padding: 0;
    line-height: 1;
}

.modal-header button:hover {
    opacity: 1;
}

/* 思维导图标题显示样式 */
.modal-title-display {
    flex: 1;
    font-size: 18px;
    font-weight: bold;
    color: white;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.modal-title-display:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* 编辑模式下的输入框样式 */
.modal-title-input {
    flex: 1;
    background: transparent;
    border: none;
    border-bottom: 2px solid white;
    color: white;
    font-size: 18px;
    font-weight: bold;
    outline: none;
    padding: 4px 8px;
}

.modal-body {
    padding: 15px;
}

.record-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.record-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.record-item label {
    font-weight: bold;
    font-size: 11px;
    color: #666;
}

.record-item textarea {
    width: 100%;
    min-height: 80px;
    max-height: 300px;
    padding: 8px;
    border: 1px solid #e0e0e0;
    border-radius: 2px;
    resize: none;
    font-family: inherit;
    font-size: 12px;
    box-sizing: border-box;
    transition: border-color 0.2s ease;
    overflow-y: hidden;
}

.record-item textarea.expanded {
    overflow-y: auto;
}

/* 美化滚动条 */
.record-item textarea::-webkit-scrollbar {
    width: 6px;
}

.record-item textarea::-webkit-scrollbar-track {
    background: transparent;
}

.record-item textarea::-webkit-scrollbar-thumb {
    background-color: rgba(0, 0, 0, 0.15);
    border-radius: 3px;
    transition: background-color 0.2s;
}

.record-item textarea::-webkit-scrollbar-thumb:hover {
    background-color: rgba(0, 0, 0, 0.25);
}

/* 适配 Firefox */
.record-item textarea {
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.15) transparent;
}

.record-item textarea:focus {
    outline: none;
    border-color: var(--month-gradient-color, #ff9a9e);
}

.record-actions {
    display: flex;
    gap: 6px;
    margin-top: 8px;
}

.record-btn {
    padding: 4px 10px;
    border: none;
    border-radius: 2px;
    font-size: 10px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #fafafa;
    color: white;
    letter-spacing: 0.3px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.record-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15);
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    padding: 16px 20px;
    margin-top: 0;
    background: linear-gradient(to top, #f8f9fa 0%, #ffffff 100%);
    border-top: 2px solid #e0e3e8;
    gap: 12px;
    flex-shrink: 0;
}

/* 导出按钮样式 */
.export-btn {
    padding: 4px 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 2px;
    cursor: pointer;
    font-size: 10px;
    font-weight: 500;
    transition: all 0.2s ease;
    letter-spacing: 0.3px;
    box-shadow: 0 2px 6px rgba(102, 126, 234, 0.3);
}

.export-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(102, 126, 234, 0.4);
}

.export-btn:active {
    transform: translateY(0);
}

/* 导入按钮样式 */
.import-btn {
    padding: 4px 16px;
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
    color: white;
    border: none;
    border-radius: 2px;
    cursor: pointer;
    font-size: 10px;
    font-weight: 500;
    transition: all 0.2s ease;
    letter-spacing: 0.3px;
    box-shadow: 0 2px 6px rgba(67, 233, 123, 0.3);
}

.import-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(67, 233, 123, 0.4);
}

.import-btn:active {
    transform: translateY(0);
}

/* 统一的保存按钮样式 */
#saveMindmap,
#saveTable,
#saveRecord {
    padding: 10px 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 3px 10px rgba(102, 126, 234, 0.4);
    letter-spacing: 0.5px;
}

#saveMindmap:hover,
#saveTable:hover,
#saveRecord:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.5);
    filter: brightness(1.1);
}

#saveMindmap:active,
#saveTable:active,
#saveRecord:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.4);
}

/* 自定义确认弹窗 */
.confirm-modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.5);
}

.confirm-content {
    background-color: #ffffff;
    margin: 15% auto;
    padding: 0;
    border: none;
    width: 85%;
    max-width: 380px;
    border-radius: 2px;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.2), 0 1px 4px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.confirm-header {
    padding: 6px 12px;
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
    color: white;
    font-weight: bold;
    font-size: 11px;
    letter-spacing: 0.5px;
}

.confirm-body {
    padding: 12px 15px;
    font-size: 11px;
    color: #666;
    line-height: 1.6;
}

.confirm-body p {
    margin: 0 0 5px 0;
}

.confirm-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 8px 12px 12px;
    border-top: 1px solid #e0e0e0;
}

.confirm-footer button {
    padding: 5px 18px;
    border: none;
    border-radius: 2px;
    font-size: 11px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.confirm-footer .confirm-btn-yes {
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
    color: white;
    box-shadow: 0 2px 6px rgba(168, 237, 234, 0.3);
}

.confirm-footer .confirm-btn-yes:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(168, 237, 234, 0.4);
}

.confirm-footer .confirm-btn-no {
    background: #f0f0f0;
    color: #666;
}

.confirm-footer .confirm-btn-no:hover {
    background: #e0e0e0;
}

.confirm-footer .confirm-btn-back {
    background: #87ceeb;
    color: white;
    box-shadow: 0 2px 6px rgba(135, 206, 235, 0.3);
}

.confirm-footer .confirm-btn-back:hover {
    background: #6bb9d9;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(135, 206, 235, 0.4);
}

/* 思维导图确认弹窗样式（与编辑面板一致） */
.mindmap-confirm-modal {
    display: none;
    position: fixed;
    z-index: 3000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.5);
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.mindmap-confirm-content {
    background-color: #ffffff;
    margin: 20% auto;
    padding: 0;
    border: none;
    width: 90%;
    max-width: 420px;
    border-radius: 4px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25), 0 2px 8px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    animation: slideIn 0.25s ease;
}

@keyframes slideIn {
    from { transform: translateY(-30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.mindmap-confirm-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 18px;
    background: linear-gradient(135deg, #ff9a9e 0%, #fecfef 100%);
    color: white;
    font-weight: bold;
    font-size: 14px;
    letter-spacing: 0.5px;
}

.mindmap-confirm-header span {
    flex: 1;
}

.mindmap-confirm-close {
    background: none;
    border: none;
    font-size: 26px;
    cursor: pointer;
    color: white;
    opacity: 0.85;
    padding: 0;
    line-height: 1;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.mindmap-confirm-close:hover {
    opacity: 1;
    background: rgba(255,255,255,0.2);
    transform: rotate(90deg);
}

.mindmap-confirm-body {
    padding: 20px 18px;
    font-size: 14px;
    color: #444;
    line-height: 1.8;
    text-align: center;
}

.mindmap-confirm-body p {
    margin: 0;
    word-break: break-all;
}

.mindmap-confirm-footer {
    display: flex;
    justify-content: center;
    gap: 12px;
    padding: 14px 18px 18px;
    border-top: 1px solid #f0f0f0;
}

.mindmap-confirm-btn {
    padding: 8px 28px;
    border: none;
    border-radius: 4px;
    font-size: 13px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 80px;
}

.mindmap-confirm-btn-yes {
    background: linear-gradient(135deg, #ff9a9e 0%, #fecfef 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(255, 154, 158, 0.35);
}

.mindmap-confirm-btn-yes:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(255, 154, 158, 0.5);
}

.mindmap-confirm-btn-yes:active {
    transform: translateY(0);
}

.mindmap-confirm-btn-no {
    background: #f5f5f5;
    color: #888;
    border: 1px solid #e0e0e0;
}

.mindmap-confirm-btn-no:hover {
    background: #ebebeb;
    color: #666;
    border-color: #d0d0d0;
}

.mindmap-confirm-btn-no:active {
    background: #e0e0e0;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .months-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .record-form {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .months-grid {
        grid-template-columns: 1fr;
    }
    
    .calendar-container {
        padding: 15px;
    }
    
    .year-selector h2 {
        font-size: 24px;
    }
}

/* ===== 富文本编辑器样式 ===== */

/* Quill 编辑器容器 */
.record-item .quill-editor {
    min-height: 120px;
    border: 1px solid #e0e0e0;
    border-radius: 2px;
}

.record-item .ql-toolbar {
    border: none;
    border-bottom: 1px solid #e0e0e0;
    background: #fafafa;
}

.record-item .ql-container {
    border: none;
    font-size: 13px;
}

.record-item .ql-editor {
    min-height: 100px;
    max-height: 400px;
    overflow-y: auto;
}

/* 附件区域样式 */
.attachment-area {
    margin-top: 8px;
    padding: 8px;
    background: #f9f9f9;
    border: 1px dashed #ddd;
    border-radius: 2px;
}

/* 统一的附件按钮样式（附件、链接、思维导图、表格） */
.attachment-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.attachment-area .attach-btn,
.attachment-area .link-btn,
.attachment-area .mindmap-btn,
.attachment-area .table-btn {
    padding: 8px 14px;
    border: 1px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* 附件按钮 - 淡蓝紫色渐变背景 */
.attachment-area .attach-btn {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.08) 0%, rgba(118, 75, 162, 0.08) 100%);
    color: #5a67d8;
    border-color: rgba(102, 126, 234, 0.2);
}

.attachment-area .attach-btn:hover {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.15) 0%, rgba(118, 75, 162, 0.15) 100%);
    border-color: rgba(102, 126, 234, 0.4);
    color: #4c51bf;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.2);
}

/* 链接按钮 - 淡青蓝色渐变背景 */
.attachment-area .link-btn {
    background: linear-gradient(135deg, rgba(79, 172, 254, 0.08) 0%, rgba(0, 242, 254, 0.08) 100%);
    color: #3182ce;
    border-color: rgba(79, 172, 254, 0.2);
}

.attachment-area .link-btn:hover {
    background: linear-gradient(135deg, rgba(79, 172, 254, 0.15) 0%, rgba(0, 242, 254, 0.15) 100%);
    border-color: rgba(79, 172, 254, 0.4);
    color: #2b6cb0;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(79, 172, 254, 0.2);
}

/* 思维导图按钮 - 淡粉紫色渐变背景 */
.attachment-area .mindmap-btn {
    background: linear-gradient(135deg, rgba(240, 147, 251, 0.08) 0%, rgba(245, 87, 108, 0.08) 100%);
    color: #b83280;
    border-color: rgba(240, 147, 251, 0.2);
}

.attachment-area .mindmap-btn:hover {
    background: linear-gradient(135deg, rgba(240, 147, 251, 0.15) 0%, rgba(245, 87, 108, 0.15) 100%);
    border-color: rgba(240, 147, 251, 0.4);
    color: #97266d;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(240, 147, 251, 0.2);
}

/* 表格按钮 - 淡绿青色渐变背景 */
.attachment-area .table-btn {
    background: linear-gradient(135deg, rgba(67, 233, 123, 0.08) 0%, rgba(56, 249, 215, 0.08) 100%);
    color: #2f855a;
    border-color: rgba(67, 233, 123, 0.2);
}

.attachment-area .table-btn:hover {
    background: linear-gradient(135deg, rgba(67, 233, 123, 0.15) 0%, rgba(56, 249, 215, 0.15) 100%);
    border-color: rgba(67, 233, 123, 0.4);
    color: #276749;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(67, 233, 123, 0.2);
}

/* 按钮激活效果 */
.attachment-area .attach-btn:active,
.attachment-area .link-btn:active,
.attachment-area .mindmap-btn:active,
.attachment-area .table-btn:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* 链接输入框样式 */
.link-input-container {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 2px;
    transition: all 0.3s ease;
    animation: slideDown 0.2s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        max-height: 0;
        margin-top: 0;
    }
    to {
        opacity: 1;
        max-height: 50px;
        margin-top: 8px;
    }
}

.link-input-field {
    flex: 1;
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 2px;
    font-size: 12px;
    outline: none;
    transition: border-color 0.2s;
}

.link-input-field:focus {
    border-color: #667eea;
}

.link-confirm-btn,
.link-cancel-btn {
    padding: 6px 12px;
    border: none;
    border-radius: 2px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s;
}

.link-confirm-btn {
    background: #667eea;
    color: white;
}

.link-confirm-btn:hover {
    background: #5568d3;
}

.link-cancel-btn {
    background: #e0e0e0;
    color: #666;
}

.link-cancel-btn:hover {
    background: #d0d0d0;
}

.attachment-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
}

.attachment-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    background: linear-gradient(135deg, rgba(67, 233, 123, 0.08) 0%, rgba(56, 249, 215, 0.08) 100%);
    border: 1px solid rgba(67, 233, 123, 0.25);
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    color: #2f855a;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

/* 思维导图附件样式 */
.attachment-item[data-type="mindmap"],
.attachment-item[data-type="application/mindmap"],
.attachment-item[data-type="application/json"] {
    background: linear-gradient(135deg, rgba(240, 147, 251, 0.08) 0%, rgba(245, 87, 108, 0.08) 100%);
    border-color: rgba(240, 147, 251, 0.25);
    color: #b83280;
}

.attachment-item[data-type="mindmap"]:hover,
.attachment-item[data-type="application/mindmap"]:hover,
.attachment-item[data-type="application/json"]:hover {
    background: linear-gradient(135deg, rgba(240, 147, 251, 0.15) 0%, rgba(245, 87, 108, 0.15) 100%);
    border-color: rgba(240, 147, 251, 0.4);
    color: #97266d;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(240, 147, 251, 0.2);
}

/* 表格附件样式 */
.attachment-item[data-type="table"],
.attachment-item[data-type="application/table"] {
    background: linear-gradient(135deg, rgba(67, 233, 123, 0.08) 0%, rgba(56, 249, 215, 0.08) 100%);
    border-color: rgba(67, 233, 123, 0.25);
    color: #2f855a;
}

.attachment-item[data-type="table"]:hover,
.attachment-item[data-type="application/table"]:hover {
    background: linear-gradient(135deg, rgba(67, 233, 123, 0.15) 0%, rgba(56, 249, 215, 0.15) 100%);
    border-color: rgba(67, 233, 123, 0.4);
    color: #276749;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(67, 233, 123, 0.2);
}

/* 图片附件样式 */
.attachment-item[data-type^="image/"] {
    background: linear-gradient(135deg, rgba(79, 172, 254, 0.08) 0%, rgba(0, 242, 254, 0.08) 100%);
    border-color: rgba(79, 172, 254, 0.25);
    color: #2b6cb0;
}

.attachment-item[data-type^="image/"]:hover {
    background: linear-gradient(135deg, rgba(79, 172, 254, 0.15) 0%, rgba(0, 242, 254, 0.15) 100%);
    border-color: rgba(79, 172, 254, 0.4);
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(79, 172, 254, 0.2);
}

.attachment-item .remove-attachment {
    cursor: pointer;
    color: inherit;
    opacity: 0.6;
    font-size: 16px;
    font-weight: bold;
    line-height: 1;
    padding: 0 2px;
    margin-left: 2px;
    transition: all 0.2s ease;
}

.attachment-item .remove-attachment:hover {
    opacity: 1;
    color: #d9534f;
    transform: scale(1.2);
}

/* ===== 思维导图样式 ===== */

/* 弹窗布局 */
/* ===== 思维导图弹窗样式 ===== */
.mindmap-modal .modal-content {
    width: 90%;
    max-width: 1000px;
    height: 80vh;
    display: flex;
    flex-direction: column;
}

.mindmap-body {
    flex: 1;
    padding: 0;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

/* ===== 表格弹窗样式 ===== */
.table-modal .modal-content {
    width: 90%;
    max-width: 1000px;
    height: 80vh;
    display: flex;
    flex-direction: column;
}

.table-body {
    flex: 1;
    padding: 0;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

/* ===== 统一的工具栏样式 ===== */
.mindmap-toolbar,
.table-toolbar {
    padding: 12px 16px;
    background: linear-gradient(to bottom, #f8f9fa 0%, #f0f1f3 100%);
    display: flex;
    flex-direction: row;
    gap: 10px;
    border-bottom: 2px solid #e0e3e8;
    flex-shrink: 0;
    align-items: center;
    flex-wrap: wrap;
}

/* 工具栏行 */
.toolbar-row {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

/* 统一的工具栏按钮样式 */
.mindmap-toolbar button,
.table-toolbar button {
    padding: 8px 16px;
    border: 1px solid #d0d5dd;
    background: white;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    color: #333;
}

.mindmap-toolbar button:hover,
.table-toolbar button:hover {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: #667eea;
    color: white;
    box-shadow: 0 3px 8px rgba(102, 126, 234, 0.3);
    transform: translateY(-1px);
}

.mindmap-toolbar button:active,
.table-toolbar button:active {
    transform: translateY(0);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

/* 撤销/重做按钮禁用状态 */
.mindmap-toolbar button:disabled,
.table-toolbar button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

.mindmap-toolbar button:disabled:hover,
.table-toolbar button:disabled:hover {
    background: white;
    border-color: #d0d5dd;
    color: #333;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    transform: none;
}

/* 思维导图容器 */
#mindmapContainer {
    flex: 1;
    min-height: 500px;
    height: 100%;
    width: 100%;
    position: relative;
    background: linear-gradient(135deg, #fafbfc 0%, #f5f7fa 100%);
    overflow: hidden;
}

/* 表格容器 */
.table-container {
    flex: 1;
    min-height: 300px;
    max-height: 600px;
    overflow: auto;
    padding: 20px;
    background: linear-gradient(135deg, #fafbfc 0%, #f5f7fa 100%);
    position: relative;
}

#tableEditor {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

#tableEditor td {
    border: 1px solid #e0e3e8;
    padding: 10px 12px;
    min-width: 100px;
    min-height: 36px;
    font-size: 14px;
    transition: all 0.2s ease;
}

#tableEditor td:focus {
    outline: none;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
    border-color: #667eea;
    box-shadow: inset 0 0 0 2px rgba(102, 126, 234, 0.3);
}

#tableEditor tr:hover td {
    background: rgba(102, 126, 234, 0.03);
}

/* 表格之间的分隔行 */
#tableEditor tr.table-separator {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    /* 允许响应鼠标事件 */
    cursor: pointer;
    transition: all 0.2s ease;
}

#tableEditor tr.table-separator td {
    height: 30px !important;
    background: linear-gradient(to bottom, 
        rgba(102, 126, 234, 0.05) 0%, 
        rgba(118, 75, 162, 0.08) 50%, 
        rgba(102, 126, 234, 0.05) 100%) !important;
    border: none !important;
    padding: 0 !important;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    /* 允许响应鼠标事件 */
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
}

/* 鼠标悬停分隔符时 */
#tableEditor tr.table-separator:hover td {
    background: linear-gradient(to bottom, 
        rgba(102, 126, 234, 0.1) 0%, 
        rgba(118, 75, 162, 0.15) 50%, 
        rgba(102, 126, 234, 0.1) 100%) !important;
}

#tableEditor tr.table-separator td::after {
    content: '';
    display: block;
    width: 80%;
    height: 2px;
    margin: 0 auto;
    background: linear-gradient(to right, 
        transparent 0%, 
        rgba(102, 126, 234, 0.3) 20%, 
        rgba(118, 75, 162, 0.4) 50%, 
        rgba(102, 126, 234, 0.3) 80%, 
        transparent 100%);
    border-radius: 1px;
    pointer-events: none;
}

/* 行间隙 */
#tableEditor tr.table-gap-row {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    /* 允许响应鼠标事件 */
    cursor: pointer;
    transition: all 0.2s ease;
}

#tableEditor tr.table-gap-row td {
    height: 15px !important;
    background: linear-gradient(to bottom, 
        rgba(102, 126, 234, 0.03) 0%, 
        rgba(118, 75, 162, 0.05) 50%, 
        rgba(102, 126, 234, 0.03) 100%) !important;
    border: none !important;
    padding: 0 !important;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    /* 允许响应鼠标事件 */
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
}

/* 鼠标悬停行间隙时 */
#tableEditor tr.table-gap-row:hover td {
    background: linear-gradient(to bottom, 
        rgba(102, 126, 234, 0.08) 0%, 
        rgba(118, 75, 162, 0.12) 50%, 
        rgba(102, 126, 234, 0.08) 100%) !important;
}

#tableEditor tr.table-gap-row td::after {
    content: '';
    display: block;
    width: 90%;
    height: 1px;
    margin: 0 auto;
    background: linear-gradient(to right, 
        transparent 0%, 
        rgba(102, 126, 234, 0.2) 30%, 
        rgba(118, 75, 162, 0.25) 50%, 
        rgba(102, 126, 234, 0.2) 70%, 
        transparent 100%);
    border-radius: 1px;
    pointer-events: none;
}

/* 合并图标（行间隙） */
.merge-icon-row {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.4);
    transition: all 0.2s ease;
    color: white;
    font-size: 16px;
    font-weight: bold;
    pointer-events: auto;
}

#tableEditor tr.table-gap-row:hover .merge-icon-row {
    display: flex;
}

/* 分隔符悬停时显示合并图标 */
#tableEditor tr.table-separator:hover .merge-icon-row {
    display: flex;
}

.merge-icon-row:hover {
    transform: translate(-50%, -50%) scale(1.15);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.6);
}

/* 列间隙 */
#tableEditor td.table-gap-column {
    width: 15px !important;
    min-width: 15px !important;
    max-width: 15px !important;
    background: linear-gradient(to right, 
        rgba(102, 126, 234, 0.03) 0%, 
        rgba(118, 75, 162, 0.05) 50%, 
        rgba(102, 126, 234, 0.03) 100%) !important;
    border: none !important;
    padding: 0 !important;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    /* 允许响应鼠标事件 */
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
}

/* 鼠标悬停列间隙时 */
#tableEditor td.table-gap-column:hover {
    background: linear-gradient(to right, 
        rgba(102, 126, 234, 0.08) 0%, 
        rgba(118, 75, 162, 0.12) 50%, 
        rgba(102, 126, 234, 0.08) 100%) !important;
}

#tableEditor td.table-gap-column::after {
    content: '';
    display: block;
    width: 1px;
    height: 80%;
    margin: auto 0;
    background: linear-gradient(to bottom, 
        transparent 0%, 
        rgba(102, 126, 234, 0.2) 30%, 
        rgba(118, 75, 162, 0.25) 50%, 
        rgba(102, 126, 234, 0.2) 70%, 
        transparent 100%);
    border-radius: 1px;
    pointer-events: none;
}

/* 合并图标（列间隙） */
.merge-icon-column {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.4);
    transition: all 0.2s ease;
    color: white;
    font-size: 16px;
    font-weight: bold;
    pointer-events: auto;
}

#tableEditor td.table-gap-column:hover .merge-icon-column {
    display: flex;
}

.merge-icon-column:hover {
    transform: translate(-50%, -50%) scale(1.15);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.6);
}

/* 分割线标识 */
.table-split-indicator {
    position: absolute;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.4);
    transition: all 0.2s ease;
    color: white;
    font-size: 14px;
    font-weight: bold;
    opacity: 0;
    pointer-events: none;
}

.table-split-indicator.visible {
    opacity: 1;
    pointer-events: auto;
}

.table-split-indicator:hover {
    transform: scale(1.2);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.6);
}

.table-split-indicator:active {
    transform: scale(0.95);
}

/* 水平分割线标识（行与行之间） */
.table-split-indicator.row-split {
    top: -12px;
}

/* 垂直分割线标识（列与列之间） */
.table-split-indicator.column-split {
    left: -12px;
}

/* 选中的单元格样式 */
#tableEditor td.selected-cell {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.15) 0%, rgba(118, 75, 162, 0.15) 100%) !important;
    border-color: #667eea !important;
    box-shadow: inset 0 0 0 2px rgba(102, 126, 234, 0.5);
    position: relative;
}

#tableEditor td.selected-cell::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border: 2px solid #667eea;
    pointer-events: none;
}

/* ===== 记录项布局调整 ===== */

.record-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.record-item label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 500;
    color: #555;
    font-size: 13px;
}

/* 拆分表格内联选项 */
.split-options-inline {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 6px 12px;
    background: linear-gradient(135deg, #f5f7fa 0%, #e8ecf1 100%);
    border-radius: 8px;
    border: 2px solid #d0d7de;
    animation: fadeInSplit 0.2s ease;
}

/* 合并表格内联选项 */
.merge-options-inline {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 6px 12px;
    background: linear-gradient(135deg, #f5f7fa 0%, #e8ecf1 100%);
    border-radius: 8px;
    border: 2px solid #d0d7de;
    animation: fadeInSplit 0.2s ease;
}

.merge-inline-group {
    display: flex;
    align-items: center;
    gap: 4px;
}

.merge-inline-group label {
    font-size: 13px;
    color: #495057;
    font-weight: 500;
    white-space: nowrap;
}

.merge-inline-group input[type="number"] {
    padding: 4px 8px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 13px;
    text-align: center;
}

.merge-inline-group input[type="number"]:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.2);
}

.merge-inline-group select {
    padding: 4px 8px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 13px;
    background: white;
    cursor: pointer;
}

.merge-inline-group select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.2);
}

.btn-merge-confirm {
    padding: 6px 16px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.15) 0%, rgba(118, 75, 162, 0.15) 100%);
    color: #5a67d8;
    border: 1px solid rgba(102, 126, 234, 0.3);
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-merge-confirm:hover {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.25) 0%, rgba(118, 75, 162, 0.25) 100%);
    border-color: rgba(102, 126, 234, 0.5);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2);
}

.btn-merge-cancel {
    padding: 6px 16px;
    background: rgba(233, 236, 239, 0.6);
    color: #495057;
    border: 1px solid rgba(206, 212, 218, 0.6);
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-merge-cancel:hover {
    background: rgba(222, 226, 230, 0.8);
    border-color: rgba(173, 181, 189, 0.8);
}

@keyframes fadeInSplit {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.split-inline-group {
    display: flex;
    align-items: center;
    gap: 4px;
}

.split-inline-group label {
    font-size: 13px;
    color: #495057;
    font-weight: 500;
    white-space: nowrap;
}

.split-inline-group input[type="number"] {
    padding: 4px 8px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 13px;
    text-align: center;
}

.split-inline-group input[type="number"]:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.2);
}

.split-inline-group select {
    padding: 4px 8px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 13px;
    background: white;
    cursor: pointer;
}

.split-inline-group select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.2);
}

.btn-split-confirm {
    padding: 6px 16px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.15) 0%, rgba(118, 75, 162, 0.15) 100%);
    color: #5a67d8;
    border: 1px solid rgba(102, 126, 234, 0.3);
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-split-confirm:hover {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.25) 0%, rgba(118, 75, 162, 0.25) 100%);
    border-color: rgba(102, 126, 234, 0.5);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2);
}

.btn-split-cancel {
    padding: 6px 16px;
    background: rgba(233, 236, 239, 0.6);
    color: #495057;
    border: 1px solid rgba(206, 212, 218, 0.6);
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-split-cancel:hover {
    background: rgba(222, 226, 230, 0.8);
    border-color: rgba(173, 181, 189, 0.8);
}

/* Toast 通知动画 */
@keyframes toastSlideIn {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

@keyframes toastSlideOut {
    from {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
    to {
        opacity: 0;
        transform: translateX(-50%) translateY(-20px);
    }
}
