@import url('./calc-common.css');

/* ========== 心情打卡记录 ========== */
.md-layout {
    display: grid;
    grid-template-columns: 380px minmax(0, 1fr);
    gap: 20px;
    margin-bottom: 24px;
    align-items: start;
}
.md-card {
    background: var(--c-bg-card);
    border: 1px solid var(--c-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    padding: 22px;
}
.md-chart-card { min-height: 420px; }
.md-chart-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    min-height: 380px;
    text-align: center;
    color: var(--c-text-muted);
    font-size: 13.5px;
    line-height: 1.8;
}
.md-chart-empty .emoji { font-size: 46px; opacity: 0.75; }
.md-chart-body { animation: calcFade 0.28s ease; }

/* 心情五档选择 */
.md-mood-seg {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 6px;
}
.md-mood-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 10px 2px 8px;
    border-radius: 12px;
    border: 1px solid var(--c-border);
    background: var(--c-surface-soft);
    color: var(--c-text-sub);
    font-family: inherit;
    cursor: pointer;
    transition: all 0.16s ease;
}
.md-mood-btn .face { font-size: 22px; line-height: 1; filter: grayscale(0.55); transition: all 0.16s ease; }
.md-mood-btn .txt { font-size: 11.5px; font-weight: 600; }
.md-mood-btn:hover { border-color: rgba(124, 77, 215, 0.45); transform: translateY(-1px); }
.md-mood-btn:hover .face { filter: grayscale(0); }
.md-mood-btn.active {
    border-color: #7c4dd7;
    background: rgba(124, 77, 215, 0.1);
    color: #7c4dd7;
    box-shadow: 0 2px 10px rgba(124, 77, 215, 0.18);
}
.md-mood-btn.active .face { filter: grayscale(0); transform: scale(1.12); }

/* 备注 */
.md-textarea {
    width: 100%;
    display: block;
    border: 1px solid var(--c-border);
    border-radius: 10px;
    background: var(--c-surface-soft);
    color: var(--c-text);
    font-family: inherit;
    font-size: 13.5px;
    line-height: 1.6;
    padding: 10px 12px;
    resize: vertical;
    min-height: 70px;
}
.md-textarea:focus {
    outline: none;
    border-color: #7c4dd7;
    box-shadow: 0 0 0 3px rgba(124, 77, 215, 0.14);
}

/* 统计指标 */
.md-chart-head {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    gap: 10px;
    margin-bottom: 16px;
}
.md-stat {
    padding: 12px 14px;
    border-radius: 12px;
    background: var(--c-surface-soft);
    border: 1px solid var(--c-border);
    text-align: center;
}
.md-stat .k {
    display: block;
    font-size: 11.5px;
    color: var(--c-text-muted);
    margin-bottom: 4px;
}
.md-stat .v {
    font-size: 17px;
    font-weight: 800;
    color: var(--c-text);
    word-break: break-all;
}
.md-stat .v small { font-size: 11.5px; font-weight: 600; color: var(--c-text-muted); }

/* 图表区域 */
.md-canvas-wrap {
    position: relative;
    border: 1px solid var(--c-border);
    border-radius: 14px;
    background: var(--c-surface-soft);
    padding: 12px;
}
#mdCanvas {
    display: block;
    width: 100%;
    height: 280px;
}
.md-legend {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px 16px;
    margin-top: 10px;
    font-size: 12px;
    color: var(--c-text-sub);
}

/* 历史记录 */
.md-list-card {
    background: var(--c-bg-card);
    border: 1px solid var(--c-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    padding: 22px;
    margin-bottom: 24px;
}
.md-list-head { margin-bottom: 14px; }
.md-list-head .calc-title { margin-bottom: 4px; }
.md-note-cell {
    max-width: 360px;
    font-size: 12.5px;
    color: var(--c-text-sub);
    line-height: 1.55;
    white-space: pre-wrap;
    word-break: break-word;
}
.md-del-btn {
    padding: 5px 12px;
    border-radius: 8px;
    border: 1px solid rgba(124, 77, 215, 0.3);
    background: rgba(124, 77, 215, 0.08);
    color: #7c4dd7;
    font-family: inherit;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.16s ease;
}
.md-del-btn:hover {
    background: rgba(124, 77, 215, 0.16);
    border-color: rgba(124, 77, 215, 0.5);
}

/* 提示声明 */
.md-disclaim {
    font-size: 12px;
    line-height: 1.85;
    color: var(--c-text-muted);
    background: var(--c-surface-soft);
    border: 1px solid var(--c-border);
    border-radius: 12px;
    padding: 14px 16px;
    margin-bottom: 26px;
}
.md-disclaim b { color: var(--c-text-sub); }

/* 黑夜模式适配 */
[data-theme="dark"] .md-stat,
[data-theme="dark"] .md-canvas-wrap,
[data-theme="dark"] .md-disclaim { background: rgba(255,255,255,0.03); }
[data-theme="dark"] .md-mood-btn.active {
    background: rgba(151, 105, 240, 0.16);
    border-color: #9769f0;
    color: #b794f6;
}
[data-theme="dark"] .md-mood-btn:hover { border-color: rgba(151, 105, 240, 0.5); }
[data-theme="dark"] .md-textarea:focus {
    border-color: #9769f0;
    box-shadow: 0 0 0 3px rgba(151, 105, 240, 0.18);
}
[data-theme="dark"] .md-del-btn {
    background: rgba(151, 105, 240, 0.15);
    border-color: rgba(151, 105, 240, 0.35);
    color: #b794f6;
}
[data-theme="dark"] .md-del-btn:hover {
    background: rgba(151, 105, 240, 0.25);
}

/* 响应式 */
@media (max-width: 1000px) {
    .md-layout { grid-template-columns: 1fr; }
    .md-chart-card { min-height: auto; }
    .md-chart-empty { min-height: 170px; }
}
@media (max-width: 620px) {
    .md-card, .md-list-card { padding: 18px; }
    .md-chart-head { grid-template-columns: repeat(2, 1fr); }
    #mdCanvas { height: 220px; }
    .md-mood-btn { padding: 8px 2px 6px; }
    .md-mood-btn .face { font-size: 20px; }
}
