/**
 * 朝夕心记 - diary.css
 * 样式参考：心晴手账、信封投递等同级功能
 * 使用项目 CSS 变量：--primary-bg, --secondary-bg, --accent-color, --text-primary, --text-secondary, --border-color, --radius, --font-family
 */

/* ================================================================
   迷你日历弹窗
   ================================================================ */
.mini-calendar-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: miniCalFadeIn 0.2s ease;
}

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

.mini-calendar-card {
    background: var(--secondary-bg);
    border-radius: 18px;
    padding: 20px;
    width: 85%;
    max-width: 320px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    animation: miniCalPopIn 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes miniCalPopIn {
    from { opacity: 0; transform: scale(0.85); }
    to { opacity: 1; transform: scale(1); }
}

.mini-cal-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.mini-cal-nav-btn {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    transition: all 0.2s ease;
}

.mini-cal-nav-btn:hover {
    background: rgba(0, 0, 0, 0.1);
    color: var(--text-primary);
}

.mini-cal-nav-btn:active {
    transform: scale(0.9);
}

.mini-cal-nav-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}

.mini-cal-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    margin-bottom: 6px;
}

.mini-cal-weekdays div {
    text-align: center;
    font-size: 11px;
    color: var(--text-secondary);
    padding: 4px 0;
    font-weight: 500;
}

.mini-cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 3px;
}

.mini-cal-day {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-size: 13px;
    color: var(--text-primary);
    transition: all 0.15s ease;
    cursor: pointer;
    gap: 2px;
}

.mini-cal-day:not(.empty):hover {
    background: rgba(0, 0, 0, 0.06);
}

.mini-cal-day.mini-cal-today {
    background: var(--accent-color);
    color: #fff;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* 小圆点指示器 */
.mini-cal-dots {
    display: flex;
    gap: 2px;
    height: 6px;
    align-items: center;
}

.mini-cal-dot {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    flex-shrink: 0;
}

.dot-todo { background: #4d96ff; }
.dot-habit { background: #6bcb77; }
.dot-anniversary { background: #fd79a8; }
.dot-period { background: #B85450; }

.mini-cal-today .mini-cal-dot {
    opacity: 0.8;
    background: #fff;
}

/* 图例 */
.mini-cal-legend {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.mini-cal-legend-item {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 10px;
    color: var(--text-secondary);
}

.mini-cal-legend-item .mini-cal-dot {
    width: 5px;
    height: 5px;
}

.mini-cal-close-btn {
    display: block;
    width: 100%;
    margin-top: 16px;
    padding: 10px;
    border: none;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-secondary);
    font-size: 13px;
    font-family: var(--font-family);
    cursor: pointer;
    transition: all 0.2s ease;
}

.mini-cal-close-btn:hover {
    background: rgba(0, 0, 0, 0.1);
    color: var(--text-primary);
}

/* ================================================================
   日期详情弹窗
   ================================================================ */
.mini-cal-detail-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 3100;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: miniCalFadeIn 0.2s ease;
}

.mini-cal-detail-card {
    background: var(--secondary-bg);
    border-radius: 18px;
    width: 85%;
    max-width: 340px;
    max-height: 70vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
    animation: miniCalPopIn 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    display: flex;
    flex-direction: column;
}

.mini-cal-detail-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

.mini-cal-detail-date {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.mini-cal-detail-close {
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    transition: all 0.2s ease;
}

.mini-cal-detail-close:hover {
    background: rgba(255, 107, 107, 0.1);
    color: #ff6b6b;
}

.mini-cal-detail-body {
    padding: 12px 20px 20px;
    overflow-y: auto;
}

.mini-cal-detail-group {
    margin-bottom: 14px;
}

.mini-cal-detail-group:last-child {
    margin-bottom: 0;
}

.mini-cal-detail-group-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
    padding-bottom: 4px;
    border-bottom: 1px dashed var(--border-color);
}

.mini-cal-detail-section {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 0;
}

.mini-cal-detail-icon {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.04);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    flex-shrink: 0;
}

.mini-cal-detail-content {
    flex: 1;
    min-width: 0;
}

.mini-cal-detail-label {
    font-size: 14px;
    color: var(--text-primary);
    font-weight: 500;
    line-height: 1.3;
}

.mini-cal-detail-sub {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.mini-cal-detail-empty {
    text-align: center;
    padding: 30px 0;
    color: var(--text-secondary);
    font-size: 14px;
}

/* ========== 标签页切换栏 ========== */
.diary-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 16px;
    background: var(--secondary-bg);
    border-radius: 12px;
    padding: 4px;
}

.diary-tab-btn {
    flex: 1;
    padding: 8px 6px;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.25s ease;
    font-family: var(--font-family);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.diary-tab-btn:hover {
    background: rgba(var(--accent-color-rgb, 255, 107, 107), 0.08);
    color: var(--text-primary);
}

.diary-tab-btn.active {
    background: rgba(var(--accent-color-rgb, 255, 107, 107), 0.16);
    color: var(--accent-color);
    font-weight: 600;
}

.diary-tab-btn i {
    font-size: 13px;
}

/* ========== 面板容器 ========== */
.diary-panel {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
    padding-right: 4px;
}

/* 待办面板内部布局 */
.diary-todo-panel,
.diary-habit-panel {
    display: flex;
    flex-direction: column;
}

/* 待办二级分类标签 */
.diary-sub-tabs {
    display: flex;
    gap: 6px;
    padding: 8px 0 12px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 8px;
    overflow-x: auto;
    flex-shrink: 0;
    position: sticky;
    top: 0;
    background: var(--secondary-bg);
    z-index: 5;
}

.diary-sub-tabs::-webkit-scrollbar {
    display: none;
}

.diary-sub-tab-btn {
    padding: 6px 12px;
    border: none;
    border-radius: 20px;
    background: var(--border-color);
    color: var(--text-secondary);
    font-size: 12px;
    font-family: var(--font-family);
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.diary-sub-tab-btn:hover {
    background: var(--accent-color);
    color: #fff;
}

.diary-sub-tab-btn.active {
    background: var(--accent-color);
    color: #fff;
}

.diary-todo-scroll-area {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

#diary-todo-compose {
    display: none;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

#diary-todo-compose .diary-todo-scroll-area {
    padding-bottom: 12px;
}

.diary-todo-compose-actions {
    flex-shrink: 0;
    padding: 12px 0 0;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 8px;
}

/* ========== 习惯打卡面板（仿制待办） ========== */
.diary-habit-scroll-area {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

#diary-habit-compose {
    display: none;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

#diary-habit-compose .diary-habit-scroll-area {
    padding-bottom: 12px;
}

.diary-habit-compose-paper {
    background: linear-gradient(135deg, #fff9f0 0%, #fff5f5 100%);
    border-radius: 16px;
    padding: 20px;
    border: 1px solid rgba(255, 182, 193, 0.3);
    box-shadow: 0 4px 16px rgba(255, 182, 193, 0.15);
}

.diary-habit-compose-heading {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #ff8fa3;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px dashed rgba(255, 143, 163, 0.3);
}

.diary-habit-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.diary-habit-form-field label {
    display: block;
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 6px;
    font-weight: 500;
}

.diary-habit-form-field select {
    width: 100%;
    padding: 10px 12px;
    border: 1.5px solid var(--border-color);
    border-radius: 10px;
    background: var(--primary-bg);
    color: var(--text-primary);
    font-size: 13px;
    font-family: var(--font-family);
    outline: none;
    cursor: pointer;
}

.diary-habit-compose-actions {
    flex-shrink: 0;
    padding: 12px 0 0;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 8px;
}

/* ========== 朝夕心记整体布局（参考信封投递） ========== */
.diary-modal-wrapper {
    display: flex;
    flex-direction: column;
    max-height: 80vh;
    overflow: hidden;
}

.diary-modal-header {
    flex-shrink: 0;
    margin-bottom: 12px;
}

.diary-tabs {
    flex-shrink: 0;
}

.diary-panel {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

/* 底部按钮区域 */
.diary-modal-wrapper > .modal-buttons {
    flex-shrink: 0;
    margin-top: auto;
}

.diary-panel::-webkit-scrollbar {
    width: 3px;
}

.diary-panel::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

/* ========== 空状态 ========== */
.diary-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    color: var(--text-secondary);
    font-size: 14px;
}

/* ========== 分区标签 ========== */
.diary-section-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.diary-section-label i {
    font-size: 12px;
    color: var(--accent-color);
}

/* ========== 通用输入框 ========== */
.diary-input {
    width: 100%;
    padding: 9px 14px;
    border: 1.5px solid var(--border-color);
    border-radius: 10px;
    font-size: 13px;
    background: var(--primary-bg);
    color: var(--text-primary);
    outline: none;
    box-sizing: border-box;
    font-family: var(--font-family);
    transition: border-color 0.2s ease;
}

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

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

/* ========== 通用添加栏 ========== */
.diary-add-bar {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.diary-add-bar .diary-input {
    flex: 1;
    min-width: 0;
}

.diary-add-bar select {
    padding: 9px 10px;
    border: 1.5px solid var(--border-color);
    border-radius: 10px;
    background: var(--primary-bg);
    color: var(--text-primary);
    font-size: 13px;
    outline: none;
    font-family: var(--font-family);
    cursor: pointer;
}

.diary-add-btn {
    padding: 9px 16px;
    border: none;
    border-radius: 10px;
    background: var(--accent-color);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    font-family: var(--font-family);
    transition: all 0.2s ease;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 4px;
}

.diary-add-btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.diary-add-btn:active {
    transform: scale(0.97);
}

/* ================================================================
   一、待办事项
   ================================================================ */
.diary-todo-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: var(--primary-bg);
    border-radius: 12px;
    margin-bottom: 8px;
    border: 1px solid var(--border-color);
    transition: all 0.25s ease;
    position: relative;
}

.diary-todo-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.diary-todo-item.done {
    opacity: 0.6;
}

.diary-todo-check {
    width: 22px;
    height: 22px;
    min-width: 22px;
    border-radius: 50%;
    border: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.25s ease;
    font-size: 11px;
    color: transparent;
}

.diary-todo-check:hover {
    border-color: var(--accent-color);
    background: rgba(var(--accent-color-rgb, 255, 107, 107), 0.1);
}

.diary-todo-item.done .diary-todo-check {
    background: var(--accent-color);
    border-color: var(--accent-color);
    color: #fff;
}

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

.diary-todo-text {
    font-size: 14px;
    color: var(--text-primary);
    word-break: break-word;
}

.diary-todo-text.done {
    text-decoration: line-through;
    color: var(--text-secondary);
}

.diary-todo-meta {
    display: flex;
    gap: 10px;
    margin-top: 4px;
    font-size: 11px;
    color: var(--text-secondary);
}

.diary-todo-priority {
    font-weight: 600;
}

.diary-todo-due {
    display: flex;
    align-items: center;
    gap: 3px;
}

.diary-todo-actions {
    display: flex;
    gap: 4px;
}

.diary-todo-edit,
.diary-todo-delete {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    cursor: pointer;
    color: var(--text-secondary);
    opacity: 0;
    transition: all 0.2s ease;
    font-size: 12px;
}

.diary-todo-item:hover .diary-todo-edit,
.diary-todo-item:hover .diary-todo-delete {
    opacity: 1;
}

.diary-todo-edit:hover {
    background: rgba(77, 150, 255, 0.1);
    color: #4d96ff;
}

.diary-todo-delete:hover {
    background: rgba(255, 107, 107, 0.1);
    color: #ff6b6b;
}

/* ========== 待办创建表单（信封式） ========== */
#diary-todo-compose {
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

.diary-todo-compose-paper {
    background: var(--primary-bg);
    border-radius: 14px;
    padding: 16px;
    border: 1px solid var(--border-color);
}

.diary-todo-compose-heading {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 15px;
    color: var(--text-primary);
    margin-bottom: 14px;
}

.diary-todo-compose-heading i {
    color: var(--accent-color);
}

.diary-todo-compose-actions {
    display: flex;
    gap: 8px;
    margin-top: auto;
}

.diary-todo-bottom-bar {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid var(--border-color);
}

.diary-todo-expand-btn {
    width: 100%;
    padding: 12px;
    border: 2px dashed var(--border-color);
    border-radius: 10px;
    background: transparent;
    color: var(--text-secondary);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.25s ease;
    font-family: var(--font-family);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.diary-todo-expand-btn:hover {
    border-color: var(--accent-color);
    color: var(--accent-color);
    background: rgba(var(--accent-color-rgb, 255, 107, 107), 0.05);
}

.diary-todo-expand-btn i {
    font-size: 18px;
}

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

.diary-todo-form-row {
    display: flex;
    gap: 10px;
}

.diary-todo-form-field {
    flex: 1;
}

.diary-todo-form-field label {
    display: block;
    font-size: 11px;
    color: var(--text-secondary);
    margin-bottom: 5px;
    font-weight: 500;
}

.diary-todo-form-field select {
    width: 100%;
    padding: 9px 10px;
    border: 1.5px solid var(--border-color);
    border-radius: 10px;
    background: var(--primary-bg);
    color: var(--text-primary);
    font-size: 13px;
    outline: none;
    font-family: var(--font-family);
    cursor: pointer;
    box-sizing: border-box;
}

.diary-todo-form-field select:focus {
    border-color: var(--accent-color);
}

/* ========== 提醒开关和选项 ========== */
.diary-todo-reminder-toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.diary-todo-reminder-toggle-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.diary-todo-switch {
    position: relative;
    display: inline-block;
    width: 42px;
    height: 24px;
    cursor: pointer;
}

.diary-todo-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.diary-todo-switch-slider {
    position: absolute;
    inset: 0;
    background: var(--border-color);
    border-radius: 24px;
    transition: all 0.25s ease;
}

.diary-todo-switch-slider::before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    left: 3px;
    bottom: 3px;
    background: #fff;
    border-radius: 50%;
    transition: all 0.25s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

.diary-todo-switch input:checked + .diary-todo-switch-slider {
    background: var(--accent-color);
}

.diary-todo-switch input:checked + .diary-todo-switch-slider::before {
    transform: translateX(18px);
}

/* 提醒标签（列表中显示） */
.diary-todo-reminder-tag {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 10px;
    color: var(--accent-color);
    opacity: 0.8;
}

.diary-todo-reminder-tag i {
    font-size: 10px;
}

/* 分类标签样式 */
.diary-todo-category {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 500;
    margin-right: 6px;
}

/* ================================================================
   二、习惯打卡
   ================================================================ */
.diary-habit-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px;
    background: var(--primary-bg);
    border-radius: 12px;
    margin-bottom: 8px;
    border: 1px solid var(--border-color);
    transition: all 0.25s ease;
}

.diary-habit-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.diary-habit-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
}

.diary-habit-icon {
    width: 40px;
    height: 40px;
    min-width: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.diary-habit-detail {
    min-width: 0;
}

.diary-habit-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.diary-habit-streak {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 2px;
    display: flex;
    align-items: center;
    gap: 3px;
}

.diary-habit-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.diary-habit-check {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.3, 0.64, 1);
    font-size: 16px;
    color: var(--text-secondary);
}

.diary-habit-check:hover {
    border-color: #6bcb77;
    background: rgba(107, 203, 119, 0.1);
}

.diary-habit-check.checked {
    background: #6bcb77;
    border-color: #6bcb77;
    color: #fff;
    animation: diaryPop 0.3s ease;
}

@keyframes diaryPop {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.diary-habit-delete {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    cursor: pointer;
    color: var(--text-secondary);
    opacity: 0;
    transition: all 0.2s ease;
    font-size: 11px;
}

.diary-habit-item:hover .diary-habit-delete {
    opacity: 1;
}

.diary-habit-delete:hover {
    background: rgba(255, 107, 107, 0.1);
    color: #ff6b6b;
}

/* ================================================================
   三、月经记录
   ================================================================ */
/* ================================================================
   月经记录面板 - 复刻设计
   ================================================================ */
.diary-period-status {
    text-align: center;
    padding: 12px 0 10px;
}

.diary-period-status-sub {
    font-size: 11px;
    color: #8a8a8a;
    margin-bottom: 2px;
}

.diary-period-status-main {
    font-size: 20px;
    font-weight: 700;
    color: #4a4a4a;
    line-height: 1.3;
}

.diary-period-status-main .highlight-num {
    color: #B85450;
    font-size: 24px;
}

/* 月份日历块 */
.diary-period-month-block {
    margin-bottom: 10px;
}

/* 月份导航栏 */
.diary-period-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 4px;
    margin-bottom: 10px;
}

.diary-period-nav-btn {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    transition: all 0.2s ease;
}

.diary-period-nav-btn:hover {
    background: rgba(184, 84, 80, 0.1);
    color: #B85450;
}

.diary-period-nav-btn:active {
    transform: scale(0.92);
}

.diary-period-nav-title {
    font-size: 14px;
    font-weight: 600;
    color: #4a4a4a;
}

/* 日历网格 - 无星期标题 */
.diary-period-cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 3px;
    padding: 0 2px;
}

.diary-period-cal-day {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    font-size: 12px;
    color: #4a4a4a;
    cursor: pointer;
    transition: all 0.15s ease;
    position: relative;
    line-height: 1;
}

.diary-period-cal-day.empty {
    cursor: default;
}

.diary-period-cal-day:not(.empty):hover {
    transform: scale(1.08);
}

/* 实际经期 - 深红底白字 */
.diary-period-cal-day.period-actual {
    background: #B85450 !important;
    color: #fff !important;
    font-weight: 600;
}

/* 预测经期 - 浅红底深灰字 */
.diary-period-cal-day.period-predicted {
    background: #E8A0A0;
    color: #4a4a4a;
}

/* 今天 - 黑框标记 */
.diary-period-cal-day.period-today {
    border: 2px solid #333 !important;
    font-weight: 700;
}

/* 普通日期 */
.diary-period-cal-day:not(.period-actual):not(.period-predicted):not(.period-today):not(.period-ovulation-period):not(.empty) {
    background: rgba(0, 0, 0, 0.03);
    color: #8a8a8a;
}

/* 排卵期 - 蓝色数字 */
.diary-period-cal-day.period-ovulation-period {
    background: rgba(100, 149, 237, 0.1);
    color: #4a7fd4;
}

/* 排卵日小花标记 */
.period-ovulation-flower {
    position: absolute;
    bottom: 1px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 7px;
    line-height: 1;
}

/* ================================================================
   经期提醒弹窗
   ================================================================ */
.period-reminder-notification {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(135deg, #fff0f3 0%, #f0f4ff 100%);
    border-radius: 24px;
    padding: 28px 32px;
    min-width: 300px;
    max-width: 380px;
    box-shadow:
0 20px 60px rgba(255, 182, 193, 0.25),
0 8px 24px rgba(0, 0, 0, 0.06),
inset 0 1px 0 rgba(255, 255, 255, 0.8);
    border: 2px solid rgba(255, 255, 255, 0.6);
    text-align: center;
    z-index: 9999;
    animation: periodReminderPop 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes periodReminderPop {
    0% { opacity: 0; transform: translate(-50%, -50%) scale(0.5); }
    70% { transform: translate(-50%, -50%) scale(1.05); }
    100% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

.period-reminder-notification.hiding {
    animation: periodReminderFade 0.3s ease forwards;
}

@keyframes periodReminderFade {
    to { opacity: 0; transform: translate(-50%, -50%) scale(0.9); }
}

.period-reminder-icon {
    font-size: 40px;
    margin-bottom: 12px;
    animation: periodIconFloat 2s ease-in-out infinite alternate;
}

@keyframes periodIconFloat {
    from { transform: translateY(0); }
    to { transform: translateY(-4px); }
}

.period-reminder-title {
    font-size: 18px;
    font-weight: 700;
    color: #B85450;
    margin-bottom: 10px;
}

.period-reminder-hint {
    font-size: 14px;
    color: #718096;
    margin-bottom: 14px;
    line-height: 1.5;
}

.period-reminder-partner {
    color: #ff8fa3;
    font-weight: 600;
}

.period-reminder-me {
    color: #6bcb77;
    font-weight: 600;
}

.period-reminder-quote {
    font-size: 13px;
    color: #8a8a8a;
    font-style: italic;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 12px;
    margin-bottom: 18px;
    line-height: 1.6;
    border-left: 3px solid #E8A0A0;
}

.period-reminder-close {
    padding: 10px 28px;
    border: none;
    border-radius: 20px;
    background: linear-gradient(135deg, #ffdde1 0%, #ee9ca7 100%);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    font-family: var(--font-family);
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(238, 156, 167, 0.3);
}

.period-reminder-close:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 6px 16px rgba(238, 156, 167, 0.4);
}

.period-reminder-close:active {
    transform: scale(0.95);
}

/* 装饰 */
.period-reminder-notification::before,
.period-reminder-notification::after {
    position: absolute;
    font-size: 16px;
    opacity: 0.5;
    animation: periodStarTwinkle 2s ease infinite;
}

.period-reminder-notification::before {
    content: "💗";
    top: 14px;
    left: 18px;
    animation-delay: 0s;
}

.period-reminder-notification::after {
    content: "🌷";
    bottom: 14px;
    right: 18px;
    animation-delay: 1s;
}

@keyframes periodStarTwinkle {
    0%, 100% { opacity: 0.3; transform: scale(0.8); }
    50% { opacity: 0.7; transform: scale(1.2); }
}

/* 经期编辑弹窗 */
.diary-period-editor-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 100001;
    display: flex;
    align-items: center;
    justify-content: center;
}

.diary-period-editor-card {
    background: var(--secondary-bg);
    border-radius: 16px;
    padding: 20px;
    width: 80%;
    max-width: 300px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    border: 2px solid #333;
}

.diary-period-editor-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    text-align: center;
    margin-bottom: 12px;
}

/* 周期信息卡片 - 简化版 */
.diary-period-info-card {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-bottom: 16px;
}

.diary-period-info-item {
    background: var(--primary-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 10px 8px;
    text-align: center;
}

.diary-period-info-value {
    font-size: 18px;
    font-weight: 700;
    color: #B85450;
    line-height: 1.2;
}

.diary-period-info-label {
    font-size: 10px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.period-dot.flow-dot-heavy {
    background: #ff4757;
}

/* 经量选择 */
.diary-flow-option {
    cursor: pointer;
    flex: 1;
}

.diary-flow-option input {
    display: none;
}

.diary-flow-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 10px 8px;
    border-radius: 10px;
    border: 1.5px solid var(--border-color);
    font-size: 12px;
    color: var(--text-secondary);
    transition: all 0.2s ease;
}

.diary-flow-option input:checked + .flow-light {
    border-color: #ffb7c3;
    background: rgba(255, 183, 195, 0.15);
    color: #ff6b9d;
}

.diary-flow-option input:checked + .flow-medium {
    border-color: #ff6b6b;
    background: rgba(255, 107, 107, 0.15);
    color: #ff4757;
}

.diary-flow-option input:checked + .flow-heavy {
    border-color: #ff4757;
    background: rgba(255, 71, 87, 0.15);
    color: #ff2020;
}

/* ================================================================
   四、纪念日
   ================================================================ */
.diary-anniversary-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px;
    background: var(--primary-bg);
    border-radius: 12px;
    margin-bottom: 8px;
    border: 1px solid var(--border-color);
    transition: all 0.25s ease;
    position: relative;
}

.diary-anniversary-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.diary-ann-info {
    flex: 1;
    min-width: 0;
}

.diary-ann-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.diary-ann-tag {
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 20px;
    font-weight: 600;
}

.diary-ann-date {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 3px;
}

.diary-ann-days {
    text-align: center;
    min-width: 50px;
}

.diary-ann-number {
    font-size: 22px;
    font-weight: 700;
    color: var(--accent-color);
    line-height: 1.1;
}

.type-countdown .diary-ann-number {
    color: #4d96ff;
}

.diary-ann-unit {
    font-size: 10px;
    color: var(--text-secondary);
}

.diary-ann-delete {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--secondary-bg);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: all 0.2s ease;
    font-size: 10px;
    color: var(--text-secondary);
}

.diary-anniversary-item:hover .diary-ann-delete {
    opacity: 1;
}

.diary-ann-delete:hover {
    background: rgba(255, 107, 107, 0.15);
    color: #ff6b6b;
    border-color: rgba(255, 107, 107, 0.3);
}

/* ================================================================
   编辑弹窗
   ================================================================ */
.diary-editor-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    animation: fadeIn 0.2s ease;
}

.diary-editor-card {
    background: var(--secondary-bg);
    border-radius: 20px;
    padding: 22px 20px;
    width: min(340px, 92vw);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.28);
    border: 1px solid var(--border-color);
    animation: modalContentSlideIn 0.3s ease forwards;
}

.diary-editor-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    text-align: center;
    margin-bottom: 4px;
}

/* ================================================================
   响应式 & 暗色适配
   ================================================================ */
@media (max-width: 360px) {
    .diary-period-info-card {
grid-template-columns: repeat(2, 1fr);
    }

    .diary-tab-btn {
font-size: 11px;
padding: 7px 4px;
    }

    .diary-tab-btn span {
display: none;
    }
}

/* 暗色模式微调 */
html[data-theme="dark"] .diary-todo-item,
html[data-theme="dark"] .diary-habit-item,
html[data-theme="dark"] .diary-anniversary-item {
    border-color: rgba(255, 255, 255, 0.06);
}

html[data-theme="dark"] .diary-period-cal-day.period-today {
    border-color: #fff !important;
}

html[data-theme="dark"] .diary-period-cal-day.period-actual {
    background: #8a3a37;
}

html[data-theme="dark"] .diary-period-cal-day.period-predicted {
    background: rgba(184, 84, 80, 0.25);
    color: #ccc;
}

html[data-theme="dark"] .diary-period-cal-day:not(.period-actual):not(.period-predicted):not(.period-today):not(.empty) {
    background: rgba(255, 255, 255, 0.05);
    color: #888;
}

html[data-theme="dark"] .diary-period-status-main {
    color: #ddd;
}

html[data-theme="dark"] .diary-period-cal-day.period-ovulation-period {
    background: rgba(100, 149, 237, 0.15);
    color: #7ab3ff;
}

html[data-theme="dark"] .diary-period-start-btn {
    background: #8a3a37;
}

/* ================================================================
   待办提醒通知弹窗 - 可爱清新风格
   ================================================================ */
.todo-reminder-notification {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(135deg, #fff5f7 0%, #f0f9ff 100%);
    border-radius: 24px;
    padding: 28px 32px;
    min-width: 320px;
    max-width: 420px;
    box-shadow: 
0 20px 60px rgba(255, 182, 193, 0.3),
0 8px 24px rgba(0, 0, 0, 0.08),
inset 0 1px 0 rgba(255, 255, 255, 0.8);
    border: 2px solid rgba(255, 255, 255, 0.6);
    text-align: center;
    z-index: 9999;
    animation: todoReminderPopIn 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes todoReminderPopIn {
    0% {
opacity: 0;
transform: translate(-50%, -50%) scale(0.5) rotate(-5deg);
    }
    70% {
transform: translate(-50%, -50%) scale(1.05) rotate(2deg);
    }
    100% {
opacity: 1;
transform: translate(-50%, -50%) scale(1) rotate(0deg);
    }
}

.todo-reminder-notification.hiding {
    animation: todoReminderPopOut 0.3s ease forwards;
}

@keyframes todoReminderPopOut {
    from {
opacity: 1;
transform: translate(-50%, -50%) scale(1);
    }
    to {
opacity: 0;
transform: translate(-50%, -50%) scale(0.8);
    }
}

.todo-reminder-icon {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    font-size: 36px;
    background: linear-gradient(135deg, rgba(255,255,255,0.9) 0%, rgba(255,255,255,0.6) 100%);
    box-shadow: 
0 4px 12px rgba(0,0,0,0.08),
inset 0 2px 4px rgba(255,255,255,0.8);
    animation: todoReminderIconBounce 0.6s ease infinite alternate;
}

@keyframes todoReminderIconBounce {
    from {
transform: translateY(0) scale(1);
    }
    to {
transform: translateY(-4px) scale(1.05);
    }
}

.todo-reminder-title {
    font-size: 14px;
    font-weight: 600;
    color: #ff8fa3;
    margin-bottom: 12px;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.todo-reminder-title::before {
    content: "✨ ";
}

.todo-reminder-title::after {
    content: " ✨";
}

.todo-reminder-hint {
    font-size: 14px;
    color: #718096;
    margin-bottom: 8px;
    line-height: 1.5;
}

.todo-reminder-partner {
    color: #ff8fa3;
    font-weight: 600;
}

.todo-reminder-me {
    color: #6bcb77;
    font-weight: 600;
}

.todo-reminder-text {
    font-size: 18px;
    color: #4a5568;
    font-weight: 500;
    line-height: 1.6;
    word-break: break-word;
    margin-bottom: 16px;
    padding: 0 8px;
}

.todo-reminder-repeat {
    display: inline-block;
    font-size: 12px;
    color: #a0aec0;
    background: rgba(255, 255, 255, 0.6);
    padding: 6px 14px;
    border-radius: 20px;
    margin-bottom: 20px;
}

.todo-reminder-close {
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 50%;
    background: linear-gradient(135deg, #ffdde1 0%, #ee9ca7 100%);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    margin: 0 auto;
    font-size: 16px;
    box-shadow: 0 4px 12px rgba(238, 156, 167, 0.4);
}

.todo-reminder-close:hover {
    transform: scale(1.1) rotate(90deg);
    box-shadow: 0 6px 16px rgba(238, 156, 167, 0.5);
}

.todo-reminder-close:active {
    transform: scale(0.95);
}

/* 按钮组 */
.todo-reminder-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 8px;
}

.todo-reminder-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.3s ease;
    font-family: var(--font-family);
}

.todo-reminder-done {
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
    color: #2d3748;
    box-shadow: 0 4px 12px rgba(168, 237, 234, 0.4);
}

.todo-reminder-done:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 6px 16px rgba(168, 237, 234, 0.5);
}

.todo-reminder-later {
    background: rgba(255, 255, 255, 0.6);
    color: #a0aec0;
    border: 1px solid rgba(160, 174, 192, 0.3);
}

.todo-reminder-later:hover {
    background: rgba(255, 255, 255, 0.8);
    color: #718096;
    transform: translateY(-2px);
}

/* 装饰小星星 */
.todo-reminder-notification::before,
.todo-reminder-notification::after {
    content: "⭐";
    position: absolute;
    font-size: 20px;
    opacity: 0.6;
    animation: todoReminderStarTwinkle 1.5s ease infinite;
}

.todo-reminder-notification::before {
    top: 16px;
    left: 20px;
    animation-delay: 0s;
}

.todo-reminder-notification::after {
    bottom: 16px;
    right: 20px;
    animation-delay: 0.75s;
}

@keyframes todoReminderStarTwinkle {
    0%, 100% {
opacity: 0.4;
transform: scale(0.8);
    }
    50% {
opacity: 0.8;
transform: scale(1.2);
    }
}
}

/* ========== 同心记账样式 ========== */

/* 整体布局 */
.accounting-modal-wrapper {
    display: flex;
    flex-direction: column;
    max-height: 80vh;
    overflow: hidden;
}

.accounting-modal-header {
    flex-shrink: 0;
    margin-bottom: 12px;
}

/* 月份切换区域 */
.accounting-header-stats {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 12px;
    padding: 8px 0;
}

.accounting-month-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: var(--secondary-bg);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.accounting-month-btn:hover {
    background: var(--accent-color);
    color: #fff;
    border-color: var(--accent-color);
}

.accounting-month-display {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    min-width: 100px;
    text-align: center;
}

/* 统计汇总栏 */
.accounting-summary-bar {
    display: flex;
    justify-content: space-around;
    padding: 12px 8px;
    background: var(--secondary-bg);
    border-radius: 12px;
    margin-bottom: 12px;
    border: 1px solid var(--border-color);
}

.accounting-summary-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.accounting-summary-label {
    font-size: 11px;
    color: var(--text-secondary);
    font-weight: 500;
}

.accounting-summary-value {
    font-size: 14px;
    font-weight: 700;
    font-family: var(--font-family);
}

.accounting-summary-value.expense {
    color: #e74c3c;
}

.accounting-summary-value.income {
    color: #2ecc71;
}

.accounting-summary-value.balance {
    color: var(--accent-color);
}

/* 标签页 */
.accounting-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 12px;
    background: var(--secondary-bg);
    border-radius: 12px;
    padding: 4px;
}

.accounting-tab-btn {
    flex: 1;
    padding: 10px 8px;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    font-family: var(--font-family);
}

.accounting-tab-btn.active {
    background: var(--primary-bg);
    color: var(--accent-color);
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.accounting-tab-btn:hover:not(.active) {
    color: var(--text-primary);
}

/* 面板区域 */
.accounting-panel {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

.accounting-scroll-area {
    max-height: 45vh;
    overflow-y: auto;
}

.accounting-panel::-webkit-scrollbar {
    width: 3px;
}

.accounting-panel::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

/* 空状态 */
.accounting-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    color: var(--text-secondary);
    font-size: 14px;
    text-align: center;
}

/* 日期分组 */
.accounting-date-group {
    margin-bottom: 16px;
}

.accounting-date-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 4px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 8px;
}

.accounting-date-text {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
}

.accounting-date-total {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
}

/* 记录项 */
.accounting-record-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--secondary-bg);
    border-radius: 12px;
    margin-bottom: 8px;
    border: 1px solid var(--border-color);
    transition: all 0.2s;
}

.accounting-record-item:hover {
    border-color: var(--accent-color);
    transform: translateY(-1px);
}

.accounting-record-icon {
    width: 40px;
    height: 40px;
    min-width: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.accounting-record-info {
    flex: 1;
    min-width: 0;
}

.accounting-record-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.accounting-record-note {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.accounting-record-amount {
    font-size: 15px;
    font-weight: 700;
    font-family: var(--font-family);
}

.accounting-record-amount.expense {
    color: #e74c3c;
}

.accounting-record-amount.income {
    color: #2ecc71;
}

.accounting-record-actions {
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.2s;
}

.accounting-record-item:hover .accounting-record-actions {
    opacity: 1;
}

.accounting-action-btn {
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 8px;
    background: var(--primary-bg);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    transition: all 0.2s;
}

.accounting-action-btn:hover {
    background: var(--accent-color);
    color: #fff;
}

.accounting-action-btn.danger:hover {
    background: #e74c3c;
}

/* 表单样式 */
/* 添加/编辑记录弹窗 */
.accounting-form-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    animation: accountingFormFadeIn 0.2s ease;
}

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

.accounting-form-popup {
    background: var(--primary-bg);
    border-radius: 20px;
    padding: 22px 20px 20px;
    width: min(340px, 90vw);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
    border: 1px solid var(--border-color);
    animation: accountingFormSlideUp 0.25s ease;
}

@keyframes accountingFormSlideUp {
    from { opacity: 0; transform: translateY(30px) scale(0.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.accounting-form-popup-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
}

.accounting-form-popup-header span {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    font-family: var(--font-family);
}

.accounting-form-popup-close {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    border: none;
    background: var(--secondary-bg);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: all 0.2s;
}

.accounting-form-popup-close:hover {
    background: rgba(231, 76, 60, 0.15);
    color: #e74c3c;
}

.accounting-form-popup-save {
    width: 100%;
    margin-top: 6px;
    padding: 11px;
    font-size: 14px;
    border-radius: 12px;
}

.accounting-form-field {
    margin-bottom: 12px;
}

.accounting-form-field label {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.accounting-input {
    width: 100%;
    padding: 10px 12px;
    border: 1.5px solid var(--border-color);
    border-radius: 10px;
    font-size: 14px;
    background: var(--primary-bg);
    color: var(--text-primary);
    outline: none;
    box-sizing: border-box;
    font-family: var(--font-family);
    transition: border-color 0.2s;
}

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

.accounting-select {
    width: 100%;
    padding: 10px 12px;
    border: 1.5px solid var(--border-color);
    border-radius: 10px;
    font-size: 14px;
    background: var(--primary-bg);
    color: var(--text-primary);
    outline: none;
    font-family: var(--font-family);
    cursor: pointer;
}


/* 统计面板 */
.accounting-stats-summary {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.accounting-stats-card {
    flex: 1;
    padding: 14px 10px;
    border-radius: 12px;
    text-align: center;
    border: 1px solid var(--border-color);
}

.accounting-stats-card.expense {
    background: rgba(231, 76, 60, 0.1);
    border-color: rgba(231, 76, 60, 0.2);
}

.accounting-stats-card.income {
    background: rgba(46, 204, 113, 0.1);
    border-color: rgba(46, 204, 113, 0.2);
}

.accounting-stats-card.balance.positive {
    background: rgba(39, 174, 96, 0.1);
    border-color: rgba(39, 174, 96, 0.2);
}

.accounting-stats-card.balance.negative {
    background: rgba(231, 76, 60, 0.1);
    border-color: rgba(231, 76, 60, 0.2);
}

.accounting-stats-label {
    font-size: 11px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.accounting-stats-value {
    font-size: 14px;
    font-weight: 700;
    font-family: var(--font-family);
}

.accounting-stats-card.expense .accounting-stats-value {
    color: #e74c3c;
}

.accounting-stats-card.income .accounting-stats-value {
    color: #2ecc71;
}

.accounting-stats-card.balance .accounting-stats-value {
    color: var(--accent-color);
}

.accounting-stats-section {
    margin-bottom: 16px;
}

.accounting-stats-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
}

.accounting-stats-labels {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.accounting-stats-label-item {
    position: relative;
    padding: 10px 12px;
    background: var(--secondary-bg);
    border-radius: 10px;
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.accounting-stats-label-bar {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    opacity: 0.15;
    transition: width 0.3s ease;
}

.accounting-stats-label-content {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
}

.accounting-stats-label-icon {
    font-size: 16px;
}

.accounting-stats-label-name {
    flex: 1;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
}

.accounting-stats-label-amount {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    font-family: var(--font-family);
}

.accounting-stats-label-percent {
    font-size: 11px;
    color: var(--text-secondary);
    min-width: 40px;
    text-align: right;
}

/* 标签管理 */
.accounting-labels-section {
    margin-bottom: 20px;
}

.accounting-labels-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.accounting-labels-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.accounting-label-card {
    position: relative;
    padding: 14px 10px;
    background: var(--secondary-bg);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}

.accounting-label-card:hover {
    border-color: var(--accent-color);
    transform: translateY(-2px);
}

.accounting-label-card.add {
    border-style: dashed;
    color: var(--text-secondary);
}

.accounting-label-card.add:hover {
    color: var(--accent-color);
}

.accounting-label-icon {
    font-size: 24px;
    margin-bottom: 6px;
}

.accounting-label-name {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.accounting-label-edit-btn {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 22px;
    height: 22px;
    border-radius: 6px;
    background: var(--primary-bg);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    opacity: 0;
    transition: all 0.2s;
}

.accounting-label-card:hover .accounting-label-edit-btn {
    opacity: 1;
}

.accounting-label-edit-btn:hover {
    background: var(--accent-color);
    color: #fff;
}

/* 标签编辑弹窗 */
.accounting-label-form-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.accounting-label-form-content {
    background: var(--primary-bg);
    border-radius: 20px;
    padding: 20px;
    width: min(320px, 90vw);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.28);
    border: 1px solid var(--border-color);
}

.accounting-label-form-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 16px;
    text-align: center;
}

.accounting-label-form-field {
    margin-bottom: 12px;
}

.accounting-label-form-field label {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.accounting-label-form-field input {
    width: 100%;
    padding: 10px 12px;
    border: 1.5px solid var(--border-color);
    border-radius: 10px;
    font-size: 14px;
    background: var(--secondary-bg);
    color: var(--text-primary);
    outline: none;
    box-sizing: border-box;
    font-family: var(--font-family);
}

.accounting-label-form-actions {
    display: flex;
    gap: 8px;
    margin-top: 16px;
}

/* 响应式 */
@media (max-width: 360px) {
    .accounting-labels-grid {
grid-template-columns: repeat(2, 1fr);
    }
    
    .accounting-summary-bar {
flex-wrap: wrap;
gap: 8px;
    }
    
    .accounting-summary-item {
flex: 1;
min-width: 80px;
    }
}
