
/* =========================================
   1. 全局颜色
========================================= */

:root {
    --bg: #f5f3ec;
    --ink: #242923;
    --muted: #72766e;

    --blue: #354b9d;
    --blue-deep: #293b83;

    --line: #dcded3;
    --paper: #eeeee2;
    --pink: #ead3d5;
    --white: #fffdf7;

    --input-bg: #faf9f4;
}


/* 深色主题 */

[data-theme="dark"] {
    --bg: #181c24;
    --ink: #eeede7;
    --muted: #a0a6b3;

    --blue: #a8b9ff;
    --blue-deep: #8da2f2;

    --line: #343b48;
    --paper: #252c38;
    --pink: #d8b3c3;
    --white: #222833;

    --input-bg: #1e2430;
}


/* =========================================
   2. 基础样式
========================================= */

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 30px;
}

body {
    margin: 0;

    background: var(--bg);
    color: var(--ink);

    font-family:
        Inter,
        "Segoe UI",
        "PingFang SC",
        "Microsoft YaHei",
        sans-serif;

    -webkit-font-smoothing: antialiased;

    transition:
        background .25s,
        color .25s;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
textarea,
input {
    font: inherit;
}

button {
    cursor: pointer;
}

a:focus-visible,
button:focus-visible,
textarea:focus-visible,
input:focus-visible {
    outline: 3px solid #cd7c98;
    outline-offset: 4px;
}

.wrap {
    width: min(1240px, calc(100% - 96px));
    margin: auto;
}


/* =========================================
   3. 顶部导航
========================================= */

.nav {
    height: 106px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    border-bottom: 1px solid var(--line);
}

.brand {
    display: flex;
    gap: 12px;
    align-items: center;

    font-size: 14px;
    font-weight: 650;
}

.brand-mark {
    font-family: Georgia, serif;

    background: var(--blue);
    color: white;

    width: 34px;
    height: 34px;

    display: grid;
    place-items: center;

    font-size: 23px;
    border-radius: 50%;
}

.nav nav {
    display: flex;
    align-items: center;
    gap: 32px;

    font-size: 13px;
}

.nav nav a {
    transition: color .2s;
}

.nav nav a:hover {
    color: var(--blue);
}

#theme-toggle {
    width: 36px;
    height: 36px;

    border: 1px solid var(--line);
    border-radius: 50%;

    background: transparent;
    color: var(--ink);

    font-size: 20px;

    display: grid;
    place-items: center;

    transition:
        background .2s,
        transform .2s;
}

#theme-toggle:hover {
    background: var(--paper);
    transform: rotate(15deg);
}


/* =========================================
   4. 首页主视觉
========================================= */

.hero {
    display: grid;

    grid-template-columns: 1fr 1.08fr;
    gap: 48px;

    padding-top: 66px;
    padding-bottom: 78px;

    align-items: center;
}

.eyebrow {
    font-size: 10px;
    letter-spacing: 2.2px;
    font-weight: 650;

    color: var(--muted);
    line-height: 1.8;
}

.hero .eyebrow {
    display: flex;
    align-items: center;
    gap: 10px;
}

.hero .eyebrow > span {
    width: 6px;
    height: 6px;

    background: var(--blue);
    border-radius: 50%;
}

h1 {
    font-size: clamp(46px, 5.4vw, 72px);

    line-height: 1.2;
    font-weight: 650;
    letter-spacing: -3px;

    margin: 28px 0 25px;
}

.accent {
    color: var(--blue);
}

.intro {
    font-size: 15px;
    line-height: 1.95;

    color: var(--muted);
    margin: 0;
}

.hero-actions {
    display: flex;
    align-items: center;
    gap: 20px;

    margin: 28px 0 38px;
}

.button {
    display: flex;
    gap: 25px;
    align-items: center;

    background: var(--blue);
    color: white;

    padding: 14px 21px;
    border-radius: 3px;

    font-size: 13px;

    transition: transform .2s;
}

.button:hover {
    transform: translateY(-3px);
}

.small-note {
    font-size: 11px;
    color: var(--muted);
}

.host {
    display: flex;
    align-items: center;
    gap: 12px;
}

.host img {
    border-radius: 50%;
    object-fit: cover;

    border: 3px solid var(--white);
}

.host strong {
    font-size: 12px;
    display: block;
    margin-bottom: 5px;
}

.host span {
    font-size: 10px;
    color: var(--muted);
}


/* 主视觉图片 */

.hero-art {
    margin: 0;
    position: relative;

    align-self: stretch;
    min-height: 530px;

    padding-top: 15px;
}

.hero-art > img {
    width: 100%;
    height: calc(100% - 42px);

    object-fit: cover;
    object-position: 34% center;

    border-radius: 160px 160px 4px 4px;

    display: block;
}

.hero-art figcaption {
    display: flex;
    justify-content: space-between;
    gap: 12px;

    font-size: 9px;
    letter-spacing: 1px;

    margin-top: 16px;
    color: var(--muted);
}

.image-label {
    position: absolute;

    right: -16px;
    bottom: 76px;

    background: var(--pink);
    color: #503e47;

    padding: 20px 26px;

    font-size: 14px;
    line-height: 1.8;

    transform: rotate(5deg);

    box-shadow: 0 5px 20px #00000008;
}


/* =========================================
   5. 留言板整体
========================================= */

.guestbook {
    border-top: 1px solid var(--line);

    padding-top: 58px;
    padding-bottom: 76px;
}

.section-top {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;

    margin-bottom: 34px;
}

h2 {
    font-size: 30px;
    letter-spacing: -1px;

    font-weight: 600;
    line-height: 1.4;

    margin: 10px 0 0;
}

.section-top > p {
    font-size: 12px;
    line-height: 1.9;

    color: var(--muted);
    margin: 0 0 5px;
}


/* 左右布局 */

.guestbook-layout {
    display: grid;

    grid-template-columns: .8fr 1.2fr;
    gap: 70px;

    align-items: stretch;
}


/* =========================================
   6. 留言板左侧
========================================= */

.guestbook-aside {
    display: flex;
    flex-direction: column;

    padding: 28px 0;
}

.aside-label {
    font-size: 10px;
    letter-spacing: 2px;

    color: var(--blue);
    font-weight: 650;
}

.guestbook-aside h3 {
    font-size: 30px;
    line-height: 1.6;

    letter-spacing: -1px;

    margin: 25px 0 18px;
}

.guestbook-aside > p {
    font-size: 13px;
    line-height: 2;

    color: var(--muted);

    max-width: 340px;
    margin: 0;
}


/* 装饰卡片 */

.letter-decoration {
    display: flex;
    align-items: center;
    gap: 18px;

    margin-top: 55px;
    padding: 20px;

    background: var(--paper);
    border: 1px solid var(--line);

    transform: rotate(-2deg);
}

.letter-symbol {
    font-family: Georgia, serif;

    font-size: 42px;
    color: var(--blue);
}

.letter-decoration strong {
    display: block;

    font-size: 10px;
    letter-spacing: 1.5px;

    margin-bottom: 7px;
}

.letter-decoration div span {
    display: block;

    font-size: 10px;
    color: var(--muted);
}

.privacy-note {
    display: flex;
    align-items: center;
    gap: 9px;

    margin-top: auto;
    padding-top: 35px;

    font-size: 11px;
    color: var(--muted);
}

.privacy-dot {
    width: 7px;
    height: 7px;

    border-radius: 50%;
    background: #8eaa8c;
}


/* =========================================
   7. 留言表单卡片
========================================= */

.guestbook-card {
    background: var(--white);

    border: 1px solid var(--line);

    padding: 36px 40px;

    box-shadow: 0 12px 45px #00000006;
}

.card-heading {
    display: flex;
    justify-content: space-between;

    font-size: 10px;
    letter-spacing: 1.5px;

    color: var(--muted);

    padding-bottom: 22px;
    border-bottom: 1px solid var(--line);

    margin-bottom: 28px;
}

.card-number {
    font-family: monospace;
}


/* 输入框标题 */

.field-label {
    display: block;

    font-size: 13px;
    font-weight: 600;

    margin-bottom: 13px;
}


/* 留言文本框 */

#message-content {
    width: 100%;
    min-height: 180px;

    resize: vertical;

    background: var(--input-bg);
    color: var(--ink);

    border: 1px solid var(--line);
    border-radius: 3px;

    padding: 17px;

    font-size: 13px;
    line-height: 1.9;

    transition: border-color .2s;
}

#message-content:focus {
    border-color: var(--blue);
    outline: none;
}

#message-content::placeholder {
    color: var(--muted);
    opacity: .7;
}


/* 字数统计 */

.form-meta {
    display: flex;
    justify-content: space-between;

    margin-top: 10px;

    font-size: 10px;
    color: var(--muted);
}

#char-count {
    font-family: monospace;
}


/* 分割线 */

.form-divider {
    height: 1px;
    background: var(--line);

    margin: 27px 0;
}


/* =========================================
   8. 留言类型选择
========================================= */

.visibility-field {
    border: 0;
    padding: 0;
    margin: 0;
    min-width: 0;
}

.visibility-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.choice-card {
    position: relative;

    display: flex;
    align-items: center;
    gap: 12px;

    padding: 17px 14px;

    border: 1px solid var(--line);
    background: var(--input-bg);

    cursor: pointer;

    transition:
        border-color .2s,
        background .2s;
}

.choice-card:hover {
    border-color: var(--blue);
}


/* 单选框 */

.choice-card input {
    width: 16px;
    height: 16px;

    accent-color: var(--blue);

    flex-shrink: 0;
}


/* 选择框文字 */

.choice-content {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.choice-title {
    font-size: 12px;
    font-weight: 650;
}

.choice-desc {
    font-size: 10px;
    line-height: 1.5;

    color: var(--muted);
}


/* 选中效果 */

.choice-card:has(input:checked) {
    border-color: var(--blue);
    background: var(--paper);
}

.choice-card:focus-within {
    outline: 2px solid var(--blue);
    outline-offset: 2px;
}


/* =========================================
   9. 提交按钮
========================================= */

.submit-area {
    display: flex;
    align-items: center;
    gap: 18px;

    margin-top: 30px;
}

.submit-button {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 35px;

    border: none;
    border-radius: 3px;

    background: var(--blue);
    color: white;

    padding: 15px 22px;

    font-size: 12px;

    transition:
        background .2s,
        transform .2s;
}

.submit-button:hover:not(:disabled) {
    background: var(--blue-deep);
    transform: translateY(-2px);
}

.submit-button:disabled {
    opacity: .65;
    cursor: wait;
}

.submit-hint {
    font-size: 10px;
    color: var(--muted);
}


/* 提交状态 */

.form-status {
    min-height: 22px;

    margin: 20px 0 0;

    font-size: 11px;
    line-height: 1.8;

    color: var(--muted);
}


/* =========================================
   10. 公开留言墙
========================================= */

.message-wall {
    border-top: 1px solid var(--line);

    padding-top: 58px;
    padding-bottom: 80px;
}

.wall-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
}

.wall-count {
    font-family: monospace;

    font-size: 10px;
    letter-spacing: 1px;

    color: var(--muted);
}


/* 空白留言墙 */

.wall-empty {
    min-height: 270px;

    margin-top: 35px;

    border: 1px dashed var(--line);

    display: flex;
    flex-direction: column;

    align-items: center;
    justify-content: center;

    text-align: center;

    padding: 35px 20px;
}

.empty-symbol {
    font-family: Georgia, serif;

    font-size: 38px;
    color: var(--pink);

    margin-bottom: 12px;
}

.wall-empty h3 {
    font-size: 18px;
    font-weight: 550;

    margin: 0 0 12px;
}

.wall-empty p {
    font-size: 12px;
    line-height: 2;

    color: var(--muted);

    margin: 0;
}

.empty-caption {
    margin-top: 23px;

    font-size: 9px;
    letter-spacing: 1.5px;

    color: var(--muted);
    opacity: .7;
}


/* =========================================
   11. 页脚
========================================= */

footer {
    border-top: 1px solid var(--line);

    padding: 25px 0 32px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 20px;

    font-size: 10px;
    color: var(--muted);
}

.footer-brand {
    color: var(--blue);

    font-family: Georgia, serif;
    font-size: 22px;
}

.footer-brand span {
    font-family:
        "Microsoft YaHei",
        sans-serif;

    font-size: 11px;
    color: var(--ink);
}


/* =========================================
   12. 深色模式细节
========================================= */

[data-theme="dark"] .button,
[data-theme="dark"] .brand-mark {
    background: #5267b6;
    color: white;
}

[data-theme="dark"] .submit-button {
    background: #5267b6;
}

[data-theme="dark"] .submit-button:hover:not(:disabled) {
    background: #647bc9;
}

[data-theme="dark"] .image-label {
    color: #503e47;
}

[data-theme="dark"] .letter-decoration {
    background: #252c38;
}


/* =========================================
   13. 平板适配
========================================= */

@media (max-width: 1000px) {

    .wrap {
        width: calc(100% - 56px);
    }

    .hero {
        gap: 28px;
    }

    .hero-art {
        min-height: 475px;
    }

    .hero-actions {
        flex-wrap: wrap;
        gap: 12px;
    }

    .guestbook-layout {
        gap: 35px;
    }

    .guestbook-card {
        padding: 30px;
    }

    .hero-art figcaption span:last-child {
        display: none;
    }

    h1 {
        letter-spacing: -2px;
    }

}


/* =========================================
   14. 手机适配
========================================= */

@media (max-width: 700px) {

    .wrap {
        width: calc(100% - 40px);
    }

    .nav {
        height: 80px;
    }

    .nav nav {
        gap: 17px;
        font-size: 11px;
    }

    .brand {
        font-size: 12px;
        gap: 8px;
    }

    .brand-mark {
        width: 28px;
        height: 28px;
        font-size: 20px;
    }


    /* 首页 */

    .hero {
        grid-template-columns: 1fr;

        padding-top: 38px;
        padding-bottom: 45px;

        gap: 32px;
    }

    h1 {
        font-size: 54px;
        margin-top: 20px;
    }

    .desktop {
        display: none;
    }

    .hero .eyebrow {
        font-size: 8px;
        letter-spacing: 1.8px;
    }

    .hero-actions {
        margin-bottom: 24px;
    }

    .hero-art {
        min-height: 0;
        height: 440px;

        margin: 0 8px;
    }

    .hero-art > img {
        border-radius: 130px 130px 4px 4px;
    }

    .image-label {
        right: -8px;
        bottom: 57px;

        padding: 14px 20px;

        font-size: 12px;
    }


    /* 留言板 */

    .guestbook {
        padding-top: 42px;
        padding-bottom: 50px;
    }

    .section-top {
        display: block;
    }

    .section-top > p {
        margin-top: 14px;
    }

    h2 {
        font-size: 25px;
    }

    .guestbook-layout {
        grid-template-columns: 1fr;
        gap: 28px;
    }

    .guestbook-aside {
        padding: 10px 0;
    }

    .guestbook-aside h3 {
        font-size: 26px;
        margin: 18px 0 12px;
    }

    .letter-decoration {
        margin-top: 28px;
    }

    .privacy-note {
        margin-top: 25px;
        padding-top: 0;
    }

    .guestbook-card {
        padding: 23px 19px;
    }

    .visibility-options {
        grid-template-columns: 1fr;
    }

    .submit-area {
        align-items: flex-start;
        flex-direction: column;
        gap: 12px;
    }


    /* 留言墙 */

    .message-wall {
        padding-top: 42px;
        padding-bottom: 55px;
    }

    .wall-heading {
        display: block;
    }

    .wall-count {
        display: block;
        margin-top: 15px;
    }

    .wall-empty {
        min-height: 240px;
    }


    /* 页脚 */

    footer {
        flex-wrap: wrap;
    }

    footer > span {
        order: 3;
        flex-basis: 100%;
    }

    .intro {
        font-size: 14px;
    }

}


/* =========================================
   15. 减少动态效果
========================================= */

@media (prefers-reduced-motion: reduce) {

    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        transition: none !important;
    }

}

/* =========================================
   16. 动态公开留言墙
========================================= */

/* 留言加载状态 */

.wall-status {
    margin-top: 20px;
    font-size: 11px;
    color: var(--muted);
}

.wall-status:empty {
    display: none;
}


/* 留言卡片容器 */

.message-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;

    margin-top: 35px;
}

.message-list:empty {
    display: none;
}


/* 单条留言卡片 */

.message-card {
    min-width: 0;

    background: var(--white);
    border: 1px solid var(--line);

    padding: 25px 27px;

    box-shadow: 0 8px 30px #00000005;

    transition:
        transform .2s,
        box-shadow .2s,
        border-color .2s;
}

.message-card:hover {
    transform: translateY(-3px);

    box-shadow: 0 12px 35px #0000000b;

    border-color: var(--blue);
}


/* 留言头部 */

.message-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 12px;

    padding-bottom: 17px;
    border-bottom: 1px solid var(--line);

    margin-bottom: 18px;
}


/* 匿名访客 */

.message-author {
    font-size: 12px;
    font-weight: 650;
    color: var(--ink);
}


/* 留言日期 */

.message-date {
    font-size: 10px;
    color: var(--muted);

    white-space: nowrap;
}


/* 留言正文 */

.message-card-content {
    margin: 0;

    font-size: 13px;
    line-height: 2;

    color: var(--ink);

    white-space: pre-wrap;
    overflow-wrap: anywhere;
}


/* 留言编号 */

.message-id {
    display: block;

    margin-top: 20px;

    font-family: monospace;
    font-size: 10px;
    letter-spacing: 1px;

    color: var(--muted);
}


/* 隐藏原始空状态 */

.wall-empty[hidden] {
    display: none;
}


/* 手机适配 */

@media (max-width: 700px) {

    .message-list {
        grid-template-columns: 1fr;
        gap: 13px;
    }

    .message-card {
        padding: 21px;
    }

}
