:root {
    --bg: #fff8f2;
    --card: rgba(255, 255, 255, 0.82);
    --text: #45312f;
    --primary: #ff6f8f;
    --secondary: #ffb38a;
    --line: rgba(255, 143, 173, 0.28);
    --shadow: 0 18px 45px rgba(186, 72, 88, 0.18);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Noto Sans SC", sans-serif;
    color: var(--text);
    background: radial-gradient(circle at 10% 20%, #ffe6ea, #fff8f2 50%, #fff2e1 100%);
    min-height: 100vh;
}

.container {
    width: min(1160px, 94%);
    margin: 0 auto;
    padding: 42px 0 60px;
    position: relative;
    z-index: 2;
}

.hero {
    display: flex;
    gap: 24px;
    align-items: center;
    margin-bottom: 26px;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 28px;
    padding: 22px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(6px);
}

.hero-with-calendar {
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
}

.hero-main {
    display: flex;
    gap: 18px;
    align-items: center;
    flex: 1 1 54%;
    min-width: 0;
}

.hero-calendar {
    flex: 1 1 46%;
    min-width: 0;
}

.hero-calendar h2 {
    margin: 0 0 8px;
    font-size: 1.12rem;
}

.hero-calendar-layout {
    display: grid;
    grid-template-columns: 258px minmax(0, 1fr);
    gap: 10px;
    align-items: start;
}

.hero-calendar-tip {
    margin: 0 2px 6px;
    color: #9b7a80;
    font-size: 0.88rem;
}

.hero-story-preview {
    display: grid;
    gap: 8px;
}

.hero-story-item {
    border: 1px dashed #f2acbe;
    border-radius: 10px;
    padding: 8px 10px;
    background: #fffefb;
}

.hero-story-item h3 {
    margin: 0;
    color: #a34064;
    font-size: 0.94rem;
}

.hero-story-item p {
    margin: 4px 0 0;
    font-size: 0.88rem;
    color: #6a4f48;
}

.hero-image {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: 24px;
    border: 3px solid #ffd3df;
}

h1 {
    margin: 0;
    font-family: "ZCOOL KuaiLe", cursive;
    font-size: clamp(2rem, 4vw, 2.7rem);
    color: #dc4e76;
}

.subtitle {
    margin: 8px 0 0;
    font-size: 1.02rem;
}

.btn-link {
    display: inline-block;
    margin-top: 12px;
    text-decoration: none;
    color: #fff;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    border-radius: 999px;
    padding: 8px 14px;
    font-weight: 700;
}

.btn-link.secondary {
    margin-left: 8px;
    background: linear-gradient(90deg, #ff8aa6, #ffc58f);
}

.grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 16px;
}

.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 24px;
    padding: 20px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(4px);
}

h2 {
    margin-top: 0;
    color: #e1567d;
}

ul {
    margin: 0;
    padding-left: 20px;
    line-height: 1.8;
}

ul li {
    margin-bottom: 8px;
}

.item-time {
    margin-left: 8px;
    color: #9b7a80;
    font-size: 0.8rem;
}

.editable-list {
    display: grid;
    gap: 10px;
}

.edit-row,
.add-row {
    display: grid;
    gap: 8px;
}

.inline-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.btn-small {
    padding: 8px 14px;
    font-size: 0.86rem;
}

.btn-danger {
    background: linear-gradient(90deg, #ff6d78, #ff8a66);
}

.item-input {
    resize: vertical;
}

.leave-message h2 {
    margin-bottom: 10px;
}

.message-form {
    display: grid;
    gap: 10px;
}

.input-field {
    width: 100%;
    border: 1px solid #f1b2c3;
    border-radius: 14px;
    padding: 12px 14px;
    font-size: 0.95rem;
    background: #fffdfa;
}

button {
    border: none;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    color: #fff;
    font-size: 0.96rem;
    font-weight: 700;
    padding: 11px 16px;
    width: fit-content;
    cursor: pointer;
}

.message-list {
    margin-top: 14px;
    display: grid;
    gap: 10px;
}

.message-item {
    border: 1px dashed #f2acbe;
    border-radius: 12px;
    padding: 10px 12px;
    background: #fffefb;
}

.message-item span {
    margin-left: 8px;
    color: #9b7a80;
    font-size: 0.83rem;
}

.message-item p {
    margin: 7px 0 2px;
}

.story-module-header p {
    margin: -2px 0 12px;
    color: #9b7a80;
}

.story-module-layout {
    display: grid;
    grid-template-columns: minmax(280px, 360px) 1fr;
    gap: 16px;
}

.story-calendar {
    border: 1px dashed #f2acbe;
    border-radius: 16px;
    padding: 8px;
    background: #fffefb;
}

.story-calendar-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 10px;
}

.month-nav {
    text-decoration: none;
    color: #d85b80;
    font-weight: 700;
    font-size: 0.9rem;
}

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

.story-weekdays span {
    text-align: center;
    color: #9b7a80;
    font-size: 0.82rem;
}

.story-day {
    aspect-ratio: 1 / 1;
    min-height: 28px;
    border-radius: 9px;
    border: 1px solid #f2d2dc;
    text-decoration: none;
    color: #55403a;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    background: #fff;
    font-size: 0.8rem;
}

.story-day.is-other {
    opacity: 0.45;
}

.story-day.is-today {
    border-color: #f2a6bc;
}

.story-day.is-selected {
    background: linear-gradient(90deg, rgba(255, 111, 143, 0.2), rgba(255, 179, 138, 0.2));
    border-color: #e982a1;
    font-weight: 700;
}

.story-day.has-story em {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #e35b84;
    position: absolute;
    bottom: 5px;
    right: 6px;
}

.story-list-box h3 {
    margin: 0 0 10px;
    color: #d85b80;
}

.story-list {
    display: grid;
    gap: 10px;
}

.story-item {
    border: 1px dashed #f2acbe;
    border-radius: 12px;
    padding: 10px 12px;
    background: #fffefb;
}

.story-item h4 {
    margin: 0;
    color: #a34064;
}

.story-item p {
    margin: 6px 0;
}

.story-item small {
    color: #9b7a80;
}

.msg-name {
    max-width: 220px;
}

.empty {
    color: #9c8289;
}

.pagination {
    margin-top: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.page-link {
    text-decoration: none;
    color: #fff;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    border-radius: 999px;
    padding: 6px 12px;
    font-weight: 700;
    font-size: 0.88rem;
}

.page-info {
    color: #9b7a80;
    font-size: 0.88rem;
}

.modal {
    position: fixed;
    inset: 0;
    display: grid;
    place-items: center;
    background: rgba(48, 16, 22, 0.42);
    z-index: 99;
}

.modal.hide {
    display: none;
}

.modal-card {
    width: min(420px, 90%);
    background: #fff;
    border-radius: 24px;
    text-align: center;
    padding: 28px 22px;
    box-shadow: 0 24px 56px rgba(71, 25, 25, 0.35);
}

.modal-actions {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 14px;
}

.modal-result {
    min-height: 22px;
    margin-top: 12px;
    color: #d74f74;
    font-weight: 700;
}

.bg-shape {
    position: fixed;
    border-radius: 50%;
    filter: blur(4px);
    z-index: 0;
}

.bg-shape-1 {
    width: 230px;
    height: 230px;
    background: rgba(255, 145, 167, 0.27);
    top: -50px;
    left: -70px;
}

.bg-shape-2 {
    width: 180px;
    height: 180px;
    background: rgba(255, 203, 154, 0.28);
    right: 8%;
    top: 22%;
}

.bg-shape-3 {
    width: 260px;
    height: 260px;
    background: rgba(255, 160, 170, 0.2);
    bottom: -100px;
    right: -90px;
}

@media (max-width: 880px) {
    .grid {
        grid-template-columns: 1fr;
    }

    .hero-main {
        flex-direction: column;
        text-align: center;
    }

    .hero-with-calendar {
        flex-direction: column;
        align-items: stretch;
    }

    .hero-calendar {
        width: 100%;
    }

    .hero-calendar-layout {
        grid-template-columns: 1fr;
    }
}
