body {
    background-color: #008080;
    margin: 0;
    padding: 20px 10px;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
}

.window {
    width: 100%;
    max-width: 1000px;
    background-color: #c0c0c0;
    border-top: 2px solid #ffffff;
    border-left: 2px solid #ffffff;
    border-right: 2px solid #000000;
    border-bottom: 2px solid #000000;
    box-shadow: inset -1px -1px #808080, inset 1px 1px #dfdfdf, 0 10px 30px rgba(0, 0, 0, 0.3);
    padding: 2px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: #111;
}

.title-bar {
    background: linear-gradient(90deg, #000080, #1084d0);
    color: #ffffff;
    padding: 5px 8px;
    font-weight: bold;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
}

.title-bar-brand {
    display: flex;
    align-items: center;
    gap: 6px;
}

.title-bar-controls button {
    width: 16px;
    height: 14px;
    font-size: 9px;
    font-weight: bold;
    background-color: #c0c0c0;
    border-top: 1px solid #ffffff;
    border-left: 1px solid #ffffff;
    border-right: 1px solid #000000;
    border-bottom: 1px solid #000000;
    cursor: default;
}

.status-bar {
    display: flex;
    gap: 2px;
    margin-top: 10px;
}

.status-panel {
    padding: 3px 6px;
    font-size: 12px;
    flex: 1;
    border-top: 1px solid #808080;
    border-left: 1px solid #808080;
    border-right: 1px solid #ffffff;
    border-bottom: 1px solid #ffffff;
}

.window-body {
    padding: 20px 40px;
}

.header {
    text-align: center;
    margin-bottom: 25px;
    padding-top: 10px;
}

.header h1 {
    margin: 0 0 8px;
    font-size: 2.2rem;
    color: #000080;
}

.alert {
    background-color: #ffffe0;
    color: #800000;
    padding: 15px;
    border-radius: 8px;
    border-left: 5px solid #ff0000;
    text-align: center;
    font-weight: bold;
    margin-bottom: 25px;
}

.site-announcement {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, auto) minmax(0, 1fr) auto auto;
    gap: 10px;
    align-items: center;
    background: #eef6ff;
    color: #102a43;
    border: 1px solid #9dc9f4;
    border-left: 5px solid #000080;
    border-radius: 8px;
    padding: 14px 42px 14px 14px;
    margin-bottom: 25px;
}

.site-announcement.is-warning {
    background: #fff8e6;
    border-color: #f2c94c;
    border-left-color: #b35c00;
}

.site-announcement.is-success {
    background: #ecfff4;
    border-color: #8bd8aa;
    border-left-color: #008080;
}

.site-announcement strong,
.site-announcement span,
.site-announcement a {
    min-width: 0;
    word-break: break-word;
}

.site-announcement a {
    color: #000080;
    font-weight: bold;
}

.site-announcement button {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    border: 1px solid #808080;
    background: #c0c0c0;
    cursor: pointer;
    font-weight: bold;
}

.card {
    background-color: #ffffff;
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 25px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.card h2 {
    margin-top: 0;
    color: #000080;
    border-bottom: 2px solid #f3f4f6;
    padding-bottom: 12px;
    font-size: 1.5rem;
}

.btn-group {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin: 25px 0;
}

.btn {
    display: block;
    text-align: center;
    padding: 16px 20px;
    border-radius: 8px;
    font-weight: bold;
    font-size: 1.15rem;
    text-decoration: none;
    transition: all 0.2s ease;
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background-color: #000080;
    color: #ffffff !important;
    box-shadow: 0 4px 10px rgba(0, 0, 128, 0.3);
}

.btn-primary:hover {
    background-color: #1084d0;
    transform: translateY(-2px);
}

.btn-outline {
    border: 2px solid #008080;
    color: #008080 !important;
    background-color: transparent;
}

.btn-outline:hover {
    background-color: #008080;
    color: #ffffff !important;
}

a.modern-link {
    color: #008080;
    text-decoration: none;
    font-weight: 500;
    font-size: 1.05rem;
    transition: color 0.2s ease;
}

a.modern-link:hover {
    text-decoration: underline;
    color: #000080;
}

.text-center {
    text-align: center;
}

.contact-time {
    color: #444;
}

.contact-qr-block {
    margin: 25px 0;
}

.wx-heading {
    color: #008080;
}

.qr-code-img {
    max-width: 240px;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.qr-section {
    background-color: #f8fafc;
    border-radius: 10px;
    padding: 25px;
    margin: 20px 0;
    text-align: center;
}

.tg-heading {
    color: #000080;
}

.tg-button {
    max-width: 280px;
    margin: 0 auto 15px;
}

.tg-bot-button {
    margin-bottom: 5px;
    background-color: #000066;
    border-color: #000066;
}

.tg-bot-subtext {
    font-size: 0.9rem;
    color: #555;
    margin-top: 0;
    margin-bottom: 20px;
}

.tg-links {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 10px;
}

.tags {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin: 15px 0;
}

.tag {
    background-color: #008080;
    color: #ffffff;
    padding: 5px 12px;
    border-radius: 6px;
    font-family: monospace;
}

.player-list {
    padding-left: 20px;
    line-height: 1.8;
}

.faq-answer {
    color: #666;
    margin-bottom: 20px;
}

.guestbook-card {
    background: #e9ecef;
    border: 2px outset #dfdfdf;
}

.guestbook-subtext {
    font-size: 0.9rem;
    color: #666;
}

.msg-display {
    max-height: 250px;
    overflow-y: auto;
    margin-bottom: 15px;
}

.msg-box {
    border: 1px inset #808080;
    background: #fff;
    padding: 10px;
    margin-bottom: 10px;
    font-size: 0.95rem;
}

.msg-header {
    color: #000080;
    font-weight: bold;
    margin-bottom: 5px;
}

.msg-time {
    font-size: 0.8em;
    color: #666;
    font-weight: normal;
}

.msg-content {
    font-family: monospace;
    white-space: pre-wrap;
    word-break: break-all;
    background: #f4f4f4;
    padding: 5px;
    border-radius: 4px;
    border: 1px solid #e0e0e0;
}

.empty-message {
    color: #888;
}

.load-more-btn {
    width: 100%;
    padding: 6px;
    margin-bottom: 15px;
    background: #c0c0c0;
    border-top: 2px solid #fff;
    border-left: 2px solid #fff;
    border-right: 2px solid #000;
    border-bottom: 2px solid #000;
    cursor: pointer;
    font-weight: bold;
    font-family: inherit;
}

.msg-form {
    border-top: 1px solid #ccc;
    padding-top: 15px;
}

.msg-nickname {
    width: 150px;
    padding: 5px;
    margin-bottom: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.msg-content-input {
    width: 100%;
    height: 60px;
    padding: 5px;
    box-sizing: border-box;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-family: monospace;
}

.btn-submit {
    margin-top: 10px;
    padding: 8px 20px;
    background: #000080;
    color: #fff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.2s;
}

.btn-submit:hover {
    background: #1084d0;
    transform: translateY(-1px);
}

.btn-submit:active {
    transform: scale(0.95);
}

.waf-card {
    background: #000;
    padding: 15px;
    border-radius: 0;
    border: 3px inset #808080;
}

.waf-heading {
    color: #0f0 !important;
    font-size: 1.1rem !important;
    border-bottom: 1px solid #0f0 !important;
    padding-bottom: 5px !important;
}

.threat-logs {
    height: 100px;
    overflow: auto;
    font-family: monospace;
    font-size: 0.85rem;
    line-height: 1.4;
}

.log-line {
    color: #0f0;
    margin: 2px 0;
}

.footer-dynamic {
    margin: 35px 0 10px;
    color: #000080;
    font-size: 1.1rem;
    font-weight: bold;
}

.visitor-status {
    flex: 2;
    color: #000080;
    font-weight: bold;
}

.visitor-count {
    color: #e3342f;
    font-family: monospace;
    font-size: 14px;
}

.text-danger {
    color: #e3342f;
}

.text-muted {
    color: #666;
}

.text-teal {
    color: #008080;
}

.text-navy {
    color: #000080;
}

.small-note {
    font-size: 0.95rem;
}

.pixel-icon {
    image-rendering: pixelated;
    image-rendering: crisp-edges;
}

[hidden] {
    display: none !important;
}

@media (min-width: 600px) {
    .btn-group {
        flex-direction: row;
        justify-content: center;
    }

    .btn-group .btn {
        flex: 1;
        max-width: 360px;
    }
}

@media (max-width: 768px) {
    .window-body {
        padding: 15px 20px;
    }

    .site-announcement {
        grid-template-columns: 1fr;
    }
}

/* =========================================================================
   v2.0.1 微调：按钮 + 留言板局部优化（保留 Win95 复古风）
   不改 HTML 结构，所有 id/data-* 钩子保留
   ========================================================================= */

/* 所有 .btn 加手型 + 显式 transition 避免被上方 transition:all 漏触发 */
.btn {
    cursor: pointer;
    transition: background-color 0.18s ease,
                color 0.18s ease,
                border-color 0.18s ease,
                transform 0.18s ease,
                box-shadow 0.22s ease;
}

/* 主按钮 hover：颜色变亮 + 上浮 + 强化阴影 */
.btn-primary:hover {
    background-color: #1084d0;
    transform: translateY(-2px);
    box-shadow: 0 10px 22px rgba(16, 132, 208, 0.45),
                0 2px 6px rgba(0, 0, 128, 0.2);
}
.btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(0, 0, 128, 0.3);
}

/* 描边按钮 hover：反色 + 同步上浮 + 阴影，与主按钮一致的动感 */
.btn-outline:hover {
    background-color: #008080;
    color: #ffffff !important;
    transform: translateY(-2px);
    box-shadow: 0 10px 22px rgba(0, 128, 128, 0.35),
                0 2px 6px rgba(0, 128, 128, 0.18);
}
.btn-outline:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(0, 128, 128, 0.25);
}

/* TG 按钮（也是 btn-primary）：让 hover 阴影更强 */
.tg-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 22px rgba(16, 132, 208, 0.45);
}
.tg-bot-button:hover {
    box-shadow: 0 10px 22px rgba(0, 0, 102, 0.45);
}

/* ---- 联系卡：TG 按钮 — 不再全宽，控制在合理尺寸 ---- */
.tg-button {
    max-width: 360px;
    /* 比 .btn 默认更紧凑 */
    padding: 12px 22px;
    font-size: 1.02rem;
}
@media (min-width: 600px) {
    .tg-button {
        max-width: 420px;
    }
}

/* ---- TG 链接：胶囊化 + 桌面横向 ---- */
a.modern-link {
    display: inline-block;
    padding: 7px 16px;
    border-radius: 999px;
    background: rgba(0, 128, 128, 0.08);
    border: 1px solid rgba(0, 128, 128, 0.25);
    color: #008080;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.98rem;
    transition: all 0.18s ease;
}
a.modern-link:hover {
    background: #008080;
    color: #ffffff;
    border-color: #008080;
    text-decoration: none;
}
.tg-links {
    align-items: center;
}
@media (min-width: 600px) {
    .tg-links {
        flex-direction: row;
        justify-content: center;
        gap: 20px;
    }
}

/* ---- 留言板：整体表单与显示区 ---- */
.msg-display {
    max-height: 280px;
    overflow-y: auto;
    margin-bottom: 16px;
    padding: 12px 14px;
    background: #ffffff;
    border: 1px solid #d8d8d8;
    border-radius: 8px;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.04);
}
.msg-display:empty {
    display: none;
}

/* "加载更多"按钮：从横铺灰块改成居中小胶囊 */
.load-more-btn {
    display: block;
    width: auto;
    margin: 0 auto 18px;
    padding: 7px 22px;
    background: #ffffff;
    color: #000080;
    border: 1px solid #b8b8b8;
    border-radius: 999px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.92rem;
    font-family: inherit;
    transition: all 0.18s ease;
    /* 覆盖原 Win95 厚边框 */
    border-top: 1px solid #b8b8b8;
    border-left: 1px solid #b8b8b8;
    border-right: 1px solid #b8b8b8;
    border-bottom: 1px solid #b8b8b8;
}
.load-more-btn:hover:not(:disabled) {
    background: #000080;
    color: #ffffff;
    border-color: #000080;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(0, 0, 128, 0.25);
}
.load-more-btn:disabled {
    color: #999;
    cursor: not-allowed;
    background: #f5f5f5;
    border-color: #d8d8d8;
}

/* 留言表单：grid 布局，输入项整齐对齐 */
.msg-form {
    border-top: 1px solid #cfcfcf;
    padding-top: 18px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.msg-nickname {
    width: 100%;
    max-width: 280px;
    padding: 9px 12px;
    margin-bottom: 0;
    border: 1px solid #b8b8b8;
    border-radius: 6px;
    box-sizing: border-box;
    font-family: inherit;
    font-size: 0.95rem;
    transition: border-color 0.18s, box-shadow 0.18s;
    /* 在 input 内左上角放一个 "代号:" 视觉前缀（通过 placeholder 自带"@" 等装饰） */
}
.msg-nickname:focus {
    outline: none;
    border-color: #000080;
    box-shadow: 0 0 0 3px rgba(0, 0, 128, 0.15);
}

.msg-content-input {
    min-height: 100px;
    padding: 10px 12px;
    border: 1px solid #b8b8b8;
    border-radius: 6px;
    font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    font-size: 0.92rem;
    resize: vertical;
    transition: border-color 0.18s, box-shadow 0.18s;
}
.msg-content-input:focus {
    outline: none;
    border-color: #000080;
    box-shadow: 0 0 0 3px rgba(0, 0, 128, 0.15);
}

/* 提交按钮：右下角胶囊 + 阴影 */
.btn-submit {
    justify-self: end;
    margin-top: 0;
    padding: 9px 24px;
    background: #000080;
    color: #ffffff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 700;
    font-size: 0.95rem;
    letter-spacing: 0.02em;
    transition: all 0.18s;
    box-shadow: 0 2px 6px rgba(0, 0, 128, 0.28);
}
.btn-submit:hover {
    background: #1084d0;
    transform: translateY(-1px);
    box-shadow: 0 6px 14px rgba(0, 0, 128, 0.35);
}
.btn-submit:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 128, 0.25);
}

/* 留言条目内的「[昵称]」行间距统一 */
.msg-box {
    padding: 12px 14px;
    border-radius: 6px;
}

/* ---- 关闭公告按钮：圆形更现代 ---- */
.site-announcement button {
    border-radius: 50%;
    border: 1px solid #b8b8b8;
    background: #ffffff;
    color: #555;
    transition: all 0.18s;
}
.site-announcement button:hover {
    background: #000080;
    color: #ffffff;
    border-color: #000080;
}

/* ---- 移动端微调 ---- */
@media (max-width: 600px) {
    .msg-display { max-height: 220px; }
    .btn-submit { justify-self: stretch; }
}


/* =========================================================================
   Phase W:公告弹窗(announcement-modal)
   --------------------------------------------------------------------------
   设计:沿用首页 Win95 标题栏 + 凸起边框,与 .window / .title-bar 一脉相承,
   避免突然冒出来一个"现代风"模态框破坏整体复古调性。
   ========================================================================= */

.announcement-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}
.announcement-modal[hidden] { display: none !important; }

.announcement-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
}

.announcement-modal__dialog {
    position: relative;
    z-index: 1;
    width: min(520px, 92vw);
    max-height: 86vh;
    background: var(--win-bg, #c0c0c0);
    border: 2px outset #ffffff;
    box-shadow:
        4px 4px 0 rgba(0, 0, 0, 0.35),
        inset 1px 1px 0 #ffffff,
        inset -1px -1px 0 #808080;
    font-family: "MS Sans Serif", "Pixelated MS Sans Serif", Tahoma, Verdana, "PingFang SC", system-ui, sans-serif;
    display: flex;
    flex-direction: column;
    animation: announce-pop 180ms cubic-bezier(0.4, 0, 0.2, 1);
}
@keyframes announce-pop {
    0% { transform: scale(0.92); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.announcement-modal__titlebar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 6px;
    background: linear-gradient(90deg, #000080, #1084d0);
    color: #ffffff;
    font-weight: 700;
    font-size: 14px;
    user-select: none;
}
.announcement-modal__title-text {
    padding: 0 4px;
    word-break: break-word;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 80%;
}
.announcement-modal__close {
    width: 22px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--win-bg, #c0c0c0);
    color: #000000;
    border: 1px outset #ffffff;
    font-weight: 700;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
}
.announcement-modal__close:active {
    border-style: inset;
}

.announcement-modal__body {
    padding: 16px 18px;
    background: #ffffff;
    margin: 4px;
    border: 1px solid #808080;
    overflow-y: auto;
    flex: 1;
    font-size: 14px;
    line-height: 1.65;
    color: #1a1a1a;
}
.announcement-modal__body p {
    margin: 0 0 10px 0;
    white-space: pre-wrap;
    word-break: break-word;
}
.announcement-modal__body a {
    display: inline-block;
    margin-top: 8px;
    padding: 4px 10px;
    background: #000080;
    color: #ffffff;
    text-decoration: none;
    border: 1px outset #4060c0;
    font-weight: 600;
}
.announcement-modal__body a:hover {
    background: #1084d0;
}
.announcement-modal__body a:active {
    border-style: inset;
}

.announcement-modal__footer {
    padding: 8px 12px 12px;
    display: flex;
    justify-content: flex-end;
}
.announcement-modal__ok {
    min-width: 88px;
    padding: 6px 16px;
    background: var(--win-bg, #c0c0c0);
    color: #000000;
    border: 2px outset #ffffff;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
}
.announcement-modal__ok:active {
    border-style: inset;
}
.announcement-modal__ok:focus {
    outline: 1px dotted #000;
    outline-offset: -4px;
}

/* 弹窗的风格变体:对应 normalize 里的 style: info/success/warning */
.announcement-modal.is-success .announcement-modal__titlebar {
    background: linear-gradient(90deg, #006400, #2e8b57);
}
.announcement-modal.is-warning .announcement-modal__titlebar {
    background: linear-gradient(90deg, #b8860b, #d97706);
}

@media (max-width: 480px) {
    .announcement-modal__dialog { width: 96vw; }
    .announcement-modal__body { font-size: 13px; }
}
