/* ===== 个人工作台 · Tailwind CSS 定制 ====== */

/* Chart.js 容器 */
.chart-wrap { position: relative; height: 260px; }

/* 日历网格 - Tailwind 难以处理的复杂布局 */
.calendar-cell { min-height: 80px; }
.calendar-cell.other-month { opacity: 0.4; background: rgba(0,0,0,.02); }

/* 通知 toast */
.toast-notification {
    position: fixed; bottom: 24px; right: 24px; z-index: 9999;
    background: white; border-radius: 12px; padding: 14px 20px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.12);
    max-width: 360px; animation: slideUp 0.3s ease;
}
@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* 响应式 */
@media (max-width: 768px) {
    .calendar-cell { min-height: 60px; }
}

/* ===== 笔记卡片下拉菜单（修复竖排排版问题） ===== */
.dropdown > div:last-child {
    min-width: 150px !important;
    width: max-content;
}
.dropdown > div:last-child > a,
.dropdown > div:last-child > form > button {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    white-space: nowrap !important;
    line-height: 1.4 !important;
}
.dropdown > div:last-child > a .bi,
.dropdown > div:last-child > form > button .bi {
    flex-shrink: 0;
    width: 1em;
    height: 1em;
    font-size: 14px;
}

/* ===== Markdown 排版（.md / .md-render） ===== */
.md, .md-render { line-height: 1.7; word-break: break-word; }
.md > :first-child, .md-render > :first-child { margin-top: 0; }
.md > :last-child, .md-render > :last-child { margin-bottom: 0; }
.md h1, .md-render h1 { font-size: 1.6em; font-weight: 700; margin: 1.2em 0 .6em; line-height: 1.3; }
.md h2, .md-render h2 { font-size: 1.35em; font-weight: 700; margin: 1.1em 0 .5em; line-height: 1.3; }
.md h3, .md-render h3 { font-size: 1.15em; font-weight: 600; margin: 1em 0 .5em; }
.md h4, .md-render h4 { font-size: 1.05em; font-weight: 600; margin: .9em 0 .4em; }
.md p, .md-render p { margin: .6em 0; }
.md ul, .md-render ul { list-style: disc; padding-left: 1.4em; margin: .6em 0; }
.md ol, .md-render ol { list-style: decimal; padding-left: 1.4em; margin: .6em 0; }
.md li, .md-render li { margin: .25em 0; }
.md a, .md-render a { color: #28b894; text-decoration: underline; text-underline-offset: 2px; }
.md a:hover, .md-render a:hover { opacity: .8; }
.md blockquote, .md-render blockquote { border-left: 3px solid #28b894; padding: .2em .9em; margin: .8em 0; color: #5b6472; background: #f6f8f9; border-radius: 0 .4em .4em 0; }
.md code, .md-render code { background: #f1f3f5; padding: .12em .38em; border-radius: .35em; font-size: .88em; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.md pre, .md-render pre { background: #1f2430; color: #e6e8ee; padding: .9em 1em; border-radius: .6em; overflow-x: auto; margin: .8em 0; }
.md pre code, .md-render pre code { background: transparent; color: inherit; padding: 0; font-size: .85em; }
.md table, .md-render table { border-collapse: collapse; width: 100%; margin: .8em 0; font-size: .92em; }
.md th, .md-render th, .md td, .md-render td { border: 1px solid #e3e8ee; padding: .45em .7em; text-align: left; }
.md th, .md-render th { background: #f6f8f9; font-weight: 600; }
.md img, .md-render img { max-width: 100%; border-radius: .5em; margin: .5em 0; }
.md hr, .md-render hr { border: none; border-top: 1px solid #e3e8ee; margin: 1.2em 0; }
.md del, .md-render del { opacity: .6; }

/* ===== 表单控件统一风格（select / 日期） ===== */
select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%238a92a6'%3E%3Cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right .55rem center;
    background-size: .95em;
    padding-right: 2.1rem !important;
    cursor: pointer;
}
/* flatpickr 接管后的日期/时间输入框：右侧日历图标 */
.flatpickr-input {
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%238a92a6'%3E%3Cpath d='M14 0H2a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2zM1 3.857C1 3.384 1.448 3 2 3h12c.552 0 1 .384 1 .857v10.286c0 .473-.448.857-1 .857H2c-.552 0-1-.384-1-.857V3.857z'/%3E%3Cpath d='M6.5 7a1 1 0 1 0 0-2 1 1 0 0 0 0 2zm3 0a1 1 0 1 0 0-2 1 1 0 0 0 0 2zm3 0a1 1 0 1 0 0-2 1 1 0 0 0 0 2zm-9 3a1 1 0 1 0 0-2 1 1 0 0 0 0 2zm3 0a1 1 0 1 0 0-2 1 1 0 0 0 0 2zm3 0a1 1 0 1 0 0-2 1 1 0 0 0 0 2zm3 0a1 1 0 1 0 0-2 1 1 0 0 0 0 2zm-9 3a1 1 0 1 0 0-2 1 1 0 0 0 0 2zm3 0a1 1 0 1 0 0-2 1 1 0 0 0 0 2zm3 0a1 1 0 1 0 0-2 1 1 0 0 0 0 2z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right .55rem center;
    background-size: 1em;
    cursor: pointer;
}

/* ===== Flatpickr 主题（项目主色 #28b894） ===== */
.flatpickr-calendar {
    border-radius: .75rem;
    border: 1px solid #e3e8ee;
    box-shadow: 0 10px 30px rgba(15,23,42,.12);
}
.flatpickr-day.selected,
.flatpickr-day.selected:hover,
.flatpickr-day.startRange,
.flatpickr-day.startRange:hover,
.flatpickr-day.endRange,
.flatpickr-day.endRange:hover {
    background: #28b894;
    border-color: #28b894;
    box-shadow: none;
}
.flatpickr-day.today { border-color: #28b894; }
.flatpickr-day.today:hover { border-color: #28b894; background: rgba(40,184,148,.15); color: inherit; }
.flatpickr-day:hover { background: rgba(40,184,148,.12); border-color: transparent; }
.flatpickr-day.flatpickr-disabled,
.flatpickr-day.prevMonthDay,
.flatpickr-day.nextMonthDay { color: #b6bdc9; }
.flatpickr-current-month input.cur-year { font-weight: 600; }
.flatpickr-months .flatpickr-prev-month:hover svg,
.flatpickr-months .flatpickr-next-month:hover svg { fill: #28b894; }
.flatpickr-time .flatpickr-am-pm:hover,
.flatpickr-time input:hover { background: rgba(40,184,148,.1); }
.flatpickr-time input:hover { background: rgba(40,184,148,.1); }

/* ===== Alpine.js：初始化前隐藏 x-show 元素（防闪烁/防全开） ===== */
[x-cloak]{display:none!important;}
