*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: "SF Pro", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
    color: #595461;
    background: linear-gradient(180deg, #FFCAD6 0%, #E3FFF9 100%);
}

.page-diandi {
    min-height: 100vh;
    max-width: 1440px;
    margin: 0 auto;
    padding: 24px 24px 56px;
}

.diandi-header,
.timeline-panel,
.todo-panel {
    width: min(1120px, 100%);
    margin-left: auto;
    margin-right: auto;
}

.diandi-header {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.diandi-back {
    width: fit-content;
    text-decoration: none;
    font-size: 16px;
    font-weight: 700;
    color: #ED688D;
}

.diandi-title-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    text-align: center;
}

.diandi-title-icon {
    width: 56px;
    height: 56px;
}

.diandi-title {
    margin: 0;
    font-size: clamp(34px, 3.2vw, 46px);
    color: #ED688D;
}

.diandi-subtitle {
    margin: 6px 0 0;
    color: #67616c;
    font-size: 16px;
    line-height: 1.5;
}

.timeline-panel,
.todo-panel {
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.56);
    box-shadow: 0 20px 40px rgba(148, 124, 137, 0.1);
    padding: 22px;
}

.timeline-panel {
    margin-bottom: 22px;
}

.stats-cards {
    width: min(1120px, 100%);
    margin: 0 auto 22px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.stats-card {
    border: none;
    border-radius: 24px;
    padding: 18px 20px;
    text-align: left;
    cursor: pointer;
    box-shadow: 0 18px 30px rgba(148, 124, 137, 0.12);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stats-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 22px 34px rgba(148, 124, 137, 0.16);
}

.stats-card--butter {
    background: #FFFBC7;
}

.stats-card--pink {
    background: #FFCAD6;
}

.stats-card--mint {
    background: #A5E1D4;
}

.stats-card-label {
    margin: 0 0 12px;
    font-size: 16px;
    font-weight: 700;
    color: #5a5560;
    line-height: 1.45;
}

.stats-card-value {
    display: flex;
    align-items: baseline;
    gap: 6px;
}

.stats-card-number {
    font-size: clamp(34px, 3.8vw, 50px);
    font-weight: 800;
    color: #ED688D;
    line-height: 1;
}

.stats-card-unit {
    font-size: 22px;
    font-weight: 700;
    color: #4DA39F;
}

.stats-card-tip {
    margin: 10px 0 0;
    font-size: 12px;
    color: rgba(90, 85, 96, 0.72);
}

.timeline-head,
.todo-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 14px;
}

.timeline-title,
.todo-title {
    margin: 0;
    font-size: 28px;
    color: #5a5560;
    line-height: 1.25;
}

.timeline-tip {
    margin: 4px 0 0;
    color: #757575;
    line-height: 1.55;
}

.timeline-head-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
}

.timeline-year-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.timeline-year-tab,
.timeline-add-btn {
    border: none;
    border-radius: 999px;
    padding: 10px 16px;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.timeline-year-tab {
    color: #67616c;
    background: rgba(255, 255, 255, 0.78);
}

.timeline-year-tab.is-active {
    color: #ED688D;
    background: rgba(255, 202, 214, 0.8);
}

.timeline-add-btn {
    color: #4DA39F;
    background: #A5E1D4;
}

.timeline-track-wrap {
    overflow-x: auto;
    padding: 22px 0 14px;
    scroll-behavior: smooth;
}

.timeline-track {
    position: relative;
    min-width: 100%;
    display: flex;
    align-items: flex-start;
    gap: 38px;
    padding: 22px 24px 18px;
}

.timeline-track::before {
    content: "";
    position: absolute;
    left: 24px;
    right: 24px;
    top: 40px;
    height: 4px;
    border-radius: 99px;
    background: rgba(153, 139, 149, 0.35);
}

.timeline-node {
    position: relative;
    border: none;
    background: transparent;
    cursor: pointer;
    min-width: 140px;
    text-align: center;
    padding: 0;
}

.timeline-node::before {
    content: "";
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: block;
    margin: 0 auto 10px;
    background: #fff;
    border: 5px solid #ED688D;
    box-shadow: 0 0 0 6px rgba(255, 202, 214, 0.66);
    position: relative;
    z-index: 1;
}

.timeline-node--mint::before {
    border-color: #4DA39F;
    box-shadow: 0 0 0 6px rgba(165, 225, 212, 0.62);
}

.timeline-node-date {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.25;
}

.timeline-node--pink .timeline-node-date {
    color: #ED688D;
}

.timeline-node--mint .timeline-node-date {
    color: #4DA39F;
}

.timeline-node-label {
    margin: 6px 0 0;
    color: #67616c;
    font-size: 14px;
    line-height: 1.4;
}

.timeline-node-desc {
    margin: 6px auto 0;
    max-width: 120px;
    font-size: 11px;
    line-height: 1.45;
    color: #807985;
}

.todo-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 16px;
}

.todo-item {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 12px;
    align-items: start;
    padding: 14px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 10px 24px rgba(148, 124, 137, 0.1);
}

.todo-check {
    margin-top: 2px;
    width: 20px;
    height: 20px;
    accent-color: #ED688D;
    cursor: pointer;
}

.todo-item-title {
    margin: 0;
    font-size: 20px;
    color: #4f4a55;
    line-height: 1.35;
}

.todo-item-desc {
    margin: 6px 0 0;
    color: #757575;
    font-size: 14px;
    line-height: 1.5;
}

.todo-item--done {
    background: rgba(200, 200, 200, 0.42);
    box-shadow: none;
    opacity: 0.9;
}

.todo-item--done .todo-item-title,
.todo-item--done .todo-item-desc {
    color: #8f8a93;
}

.todo-item-remove {
    border: none;
    border-radius: 10px;
    padding: 8px 12px;
    color: #ED688D;
    background: rgba(255, 202, 214, 0.72);
    cursor: pointer;
}

.todo-empty {
    margin: 0 0 14px;
    color: #757575;
}

.todo-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 180px;
    gap: 10px;
}

.todo-input {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid rgba(237, 104, 141, 0.22);
    border-radius: 12px;
    background: #fff;
    font: inherit;
    color: #544e59;
}

.todo-textarea {
    grid-column: 1 / -1;
    resize: vertical;
}

.todo-submit {
    grid-column: 2 / 3;
    border: none;
    border-radius: 12px;
    padding: 12px 16px;
    font: inherit;
    font-weight: 700;
    color: #4DA39F;
    background: #A5E1D4;
    cursor: pointer;
}

.timeline-modal {
    position: fixed;
    inset: 0;
    z-index: 30;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(90, 79, 91, 0.32);
}

.timeline-modal[hidden] {
    display: none;
}

.timeline-modal-card {
    width: min(560px, 100%);
    border-radius: 20px;
    padding: 20px;
    background: #fff;
    box-shadow: 0 22px 44px rgba(84, 80, 91, 0.2);
}

.timeline-modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.timeline-modal-title {
    margin: 0;
    color: #ED688D;
    font-size: 30px;
}

.timeline-modal-close {
    border: none;
    border-radius: 50%;
    width: 38px;
    height: 38px;
    cursor: pointer;
    font-size: 22px;
    color: #ED688D;
    background: rgba(255, 202, 214, 0.66);
}

.timeline-modal-date {
    margin: 12px 0 0;
    color: #4DA39F;
    font-weight: 700;
}

.timeline-modal-content {
    margin: 12px 0 0;
    color: #65606a;
    line-height: 1.8;
}

.timeline-modal-edit-actions {
    margin-top: 16px;
    display: flex;
    gap: 10px;
}

.timeline-modal-delete {
    border: none;
    border-radius: 10px;
    padding: 10px 14px;
    cursor: pointer;
    color: #fff;
    background: #ED688D;
}

.timeline-modal-actions {
    margin-top: 16px;
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

.timeline-modal-nav {
    border: none;
    border-radius: 10px;
    padding: 10px 14px;
    cursor: pointer;
    color: #5a5560;
    background: rgba(225, 225, 225, 0.5);
}

.timeline-form-modal {
    position: fixed;
    inset: 0;
    z-index: 31;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(90, 79, 91, 0.36);
}

.timeline-form-modal[hidden] {
    display: none;
}

.timeline-form-card {
    width: min(560px, 100%);
    border-radius: 20px;
    padding: 20px;
    background: #fff;
    box-shadow: 0 22px 44px rgba(84, 80, 91, 0.2);
}

.timeline-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.timeline-form-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.timeline-form-field span {
    color: #67616c;
    font-size: 14px;
    font-weight: 700;
}

.timeline-form-field input,
.timeline-form-field textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid rgba(237, 104, 141, 0.22);
    border-radius: 12px;
    background: #fff;
    font: inherit;
    color: #544e59;
}

.timeline-form-field textarea {
    resize: vertical;
}

.timeline-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

@media (max-width: 760px) {
    .page-diandi {
        padding: 20px 16px 40px;
    }

    .stats-cards {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .timeline-head,
    .todo-head {
        flex-direction: column;
        align-items: flex-start;
    }

    .timeline-head-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .todo-form {
        grid-template-columns: 1fr;
    }

    .todo-submit {
        grid-column: 1 / -1;
    }
}
