/* 全局样式 - Facebook风格 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    overflow-x: hidden;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif, '微软雅黑';
    background: linear-gradient(135deg, #e3f2fd 0%, #fff3e0 100%);
    min-height: 100vh;
    padding: 20px;
    color: #050505;
    overflow-x: hidden;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    background: #ffffff;
    border-radius: 8px;
    padding: 24px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    margin-top: 72px;
}

/* 标题 */
header {
    text-align: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e4e6eb;
    position: relative;
}

header h1 {
    font-size: 2em;
    color: #1877f2;
    margin-bottom: 8px;
    font-weight: 600;
    letter-spacing: -0.5px;
}

.subtitle {
    color: #65676b;
    font-size: 0.95em;
    font-weight: 400;
}

.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: linear-gradient(90deg, #e3f2fd 0%, #fff3e0 100%);
    border-bottom: 1px solid #e4e6eb;
}

.site-header-inner {
    max-width: 1000px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 20px;
}

.site-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: #1877f2;
    font-weight: 700;
}

.site-logo {
    width: 24px;
    height: 24px;
    border-radius: 4px;
}

.site-name {
    display: inline-flex;
    align-items: baseline;
    gap: 0;
    font-size: clamp(20px, 2.6vw, 28px);
    font-weight: 800;
    letter-spacing: 0;
    color: #0d47a1;
}

.site-name .name-group {
    display: inline-block;
    margin: 0;
    line-height: 1;
}

.site-name .name-sep {
    margin: 0 -3px;
    font-size: 0.72em;
    display: inline-block;
    letter-spacing: 0;
    background: linear-gradient(90deg, #1877f2 0%, #42a5f5 55%, #ffc107 85%, #fb8c00 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    -webkit-text-stroke: 0.25px rgba(0, 0, 0, 0.06);
    align-self: center;
    transform: translateY(1px);
}

.site-name .name-group {
    background: linear-gradient(90deg, #1877f2 0%, #42a5f5 55%, #ffc107 85%, #fb8c00 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    -webkit-text-stroke: 0.25px rgba(0, 0, 0, 0.08);
}

.site-name .group-nums {
    font-size: 1.1em;
}

/* 翻页弹窗等待框 */
.popup-mask {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.15);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.popup-box {
    background: #ffffff;
    border: 1px solid #e4e6eb;
    border-radius: 8px;
    padding: 12px 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
    text-align: center;
    color: #1877f2;
    min-width: 220px;
}

.popup-box .modal-input {
    width: 220px;
    padding: 8px 10px;
    border: 1px solid #dddfe2;
    border-radius: 6px;
    font-size: 14px;
    margin-top: 10px;
}

.popup-box .modal-actions {
    margin-top: 10px;
    display: flex;
    gap: 8px;
    justify-content: center;
    align-items: center;
}

.popup-box #adminPwdTip {
    display: block;
    margin: 6px 0 0 0;
    width: 220px;
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.spinner.small {
    width: 24px;
    height: 24px;
    border: 3px solid #e4e6eb;
    border-top: 3px solid #1877f2;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 8px;
}

@supports not (-webkit-background-clip: text) {
    .site-name .name-group {
        color: #0d47a1;
        -webkit-text-fill-color: initial;
        background: none;
        -webkit-text-stroke: 0;
    }
}

.site-nav {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.site-link {
    padding: 6px 12px;
    background: linear-gradient(90deg, #e3f2fd 0%, #fff3e0 100%);
    color: #0d47a1;
    border: 1px solid #ffd180;
    border-radius: 16px;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.2px;
    text-decoration: none;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

.site-link:hover {
    background: linear-gradient(90deg, #e1f0fb 0%, #ffe7cc 100%);
    border-color: #ffe0b2;
    color: #0d47a1;
}

.site-link-text {
    color: #6d809f;
    font-weight: inherit;
    background: none;
    -webkit-background-clip: initial;
    -webkit-text-fill-color: initial;
    -webkit-text-stroke: 0;
    text-shadow: none;
}

/* 留言页 */
.msg-page {
    margin-top: 72px;
}

.msg-form {
    background: #f0f2f5;
    padding: 5px 20px;
    border-radius: 8px;
    border: 1px solid #e4e6eb;
    margin-bottom: 20px;
}

.msg-row {
    margin-bottom: 2px;
}

.msg-form input,
.msg-form textarea {
    width: 100%;
    padding: 10px 12px;
    font-size: 15px;
    border: 1px solid #dddfe2;
    border-radius: 6px;
    outline: none;
    transition: all 0.2s;
    background: #ffffff;
    color: #050505;
}

.msg-form textarea {
    resize: vertical;
    min-height: 96px;
}

.msg-form input:focus,
.msg-form textarea:focus {
    border-color: #1877f2;
    box-shadow: 0 0 0 2px rgba(24, 119, 242, 0.1);
}

.msg-tip {
    margin: 0 0 0 6px;
    font-size: 13px;
    display: inline-block;
    white-space: nowrap;
    line-height: 24px;
    vertical-align: middle;
    background: transparent;
    border: 0;
    box-shadow: none;
    padding: 0;
    pointer-events: none;
    cursor: default;
}

.msg-tip.info {
    color: #1877f2;
    font-weight: 600;
}

.msg-tip.warn {
    color: #ff8f00;
    font-weight: 600;
}

.msg-tip.error {
    color: #d32f2f;
    font-weight: 600;
}

.msg-tip.success {
    color: #2e7d32;
    font-weight: 600;
}

.captcha-row {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.captcha-question {
    color: #1877f2;
    font-weight: 700;
    white-space: nowrap;
}

.captcha-input-wrap {
    display: inline-flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 3px;
}

.captcha-input-wrap #noteCategory {
    margin-right: 10px;
}

.captcha-input-wrap input {
    width: 66px;
    height: 24px;
    padding: 2px 6px;
    font-size: 13px;
    box-sizing: border-box;
}

.captcha-input-wrap #captchaInput {
    text-align: center;
}

.captcha-row #msgSubmit {
    margin-left: auto;
}

.captcha-row #noteSave {
    margin-left: auto;
}

/* 已移除验证码刷新按钮 */

.msg-list-section {
    margin-top: 12px;
}

.msg-list-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
    gap: 8px;
    flex-wrap: wrap;
    padding: 0;
}

.note-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.list-title {
    color: #ff9800;
    font-weight: 700;
    font-size: 1.2em;
}

.input-with-icon {
    position: relative;
    display: inline-block;
}

.input-with-icon input {
    padding-left: 30px !important;
}

.input-with-icon input {
    padding-right: 28px !important;
}

.input-with-icon::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 14px;
    height: 14px;
    border: 2px solid #bcc2cc;
    border-radius: 50%;
    opacity: 0.85;
    pointer-events: none;
    transition: all 0.2s ease;
}

.input-with-icon::after {
    content: '';
    position: absolute;
    left: 18px;
    top: calc(50% + 3px);
    width: 8px;
    height: 2px;
    background: #bcc2cc;
    transform: rotate(45deg);
    border-radius: 1px;
    opacity: 0.85;
    pointer-events: none;
    transition: all 0.2s ease;
}

.captcha-input-wrap .input-with-icon:hover::before {
    width: 10px;
    height: 2px;
    border: none;
    background: #bcc2cc;
    left: 12px;
    top: 50%;
    transform: translateY(-50%) rotate(45deg);
    border-radius: 1px;
}

.captcha-input-wrap .input-with-icon:hover::after {
    width: 10px;
    height: 2px;
    background: #bcc2cc;
    left: 12px;
    top: 50%;
    transform: translateY(-50%) rotate(-45deg);
}

.clear-btn {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 1px solid #dddfe2;
    background: #ffffff;
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease;
}

.clear-btn::before,
.clear-btn::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    width: 10px;
    height: 2px;
    background: #bcc2cc;
    transform-origin: center;
}

.clear-btn::before {
    transform: translate(-50%, -50%) rotate(45deg);
}

.clear-btn::after {
    transform: translate(-50%, -50%) rotate(-45deg);
}

.input-with-icon.has-text:hover .clear-btn {
    opacity: 0.85;
    pointer-events: auto;
}

.clear-btn:hover {
    border-color: #1877f2;
}

.clear-btn:hover::before,
.clear-btn:hover::after {
    background: #1877f2;
}

.clear-left-btn {
    position: absolute;
    left: 4px;
    top: 50%;
    transform: translateY(-50%);
    width: 22px;
    height: 22px;
    border: none;
    background: transparent;
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    z-index: 2;
}

.input-with-icon.has-text:hover .clear-left-btn {
    opacity: 1;
    pointer-events: auto;
}

.captcha-input-wrap .input-with-icon input#noteCategory {
    padding-right: 8px !important;
}

.note-page header {
    text-align: center;
    border-bottom: 1px solid #e4e6eb;
    position: relative;
}

.note-page header::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: -1px;
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, #1877f2 0%, #42a5f5 50%, #ffb74d 100%);
}

.msg-page header {
    position: relative;
}

.msg-page header::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: -1px;
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, #1877f2 0%, #42a5f5 50%, #ffb74d 100%);
}

.note-page header h1 {
    position: relative;
    display: inline-flex;
    align-items: flex-start;
    gap: 8px;
}

.note-page header h1 .mode-badge {
    position: static;
}

.note-page #noteFormSection {
    padding-left: 20px;
    padding-right: 20px;
}

.note-page #noteList {
    padding-left: 0;
    padding-right: 0;
}

.note-page .msg-body {
    margin-left: 0;
}

.note-page .msg-time {
    margin-left: 8px;
}

.msg-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

.msg-list {
    width: 100%;
    justify-items: stretch;
}

.kw-highlight {
    background: transparent;
    color: #ff9800;
    font-weight: 700;
}

.msg-item {
    background: #ffffff;
    border: 1px solid #e4e6eb;
    border-radius: 8px;
    padding: 12px 14px;
    max-width: 100%;
}

.msg-item {
    width: 100%;
    scroll-margin-top: 72px;
}

.msg-item-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}

.msg-item-head-left {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.msg-item-head-right {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

.msg-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-weight: 800;
    font-size: 16px;
    line-height: 1;
    color: #37474f;
    border: 1px solid #e4e6eb;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    user-select: none;
}

.msg-nickname {
    color: #1877f2;
    font-weight: 700;
}

.msg-time {
    color: #8a8d91;
    font-size: 12px;
}

.msg-content {
    color: #050505;
    line-height: 1.6;
    word-break: break-word;
    overflow-wrap: anywhere;
    white-space: pre-wrap;
}

.msg-body {
    margin-left: 40px;
}

.msg-ip-inline {
    color: #8a8d91;
    font-size: 12px;
}

.fav-star {
    color: #ff8f00;
    font-size: 16px;
}

.edit-tag {
    padding: 2px 8px;
    border: 1px solid #ffd180;
    border-radius: 12px;
    background: linear-gradient(90deg, #e3f2fd 0%, #fff3e0 100%);
    color: #1877f2;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    user-select: none;
}

.edit-tag:hover {
    background: linear-gradient(90deg, #e1f0fb 0%, #ffe7cc 100%);
}

.share-icon {
    position: relative;
    display: inline-block;
    font-size: 16px;
    line-height: 1;
    margin-left: 8px;
    vertical-align: middle;
    cursor: pointer;
    opacity: 0.98;
    transition: transform 0.12s ease;
    transform-origin: center;
}

.share-icon:hover {
    transform: scale(1.08);
}

.share-icon .si-box {
    position: absolute;
    left: 2px;
    top: 2px;
    width: 12px;
    height: 12px;
    border: 2px solid transparent;
    border-right-color: #bcc2cc;
    border-top-color: #bcc2cc;
    border-radius: 50%;
}

.share-icon .si-shaft {
    position: absolute;
    left: 8px;
    top: 9px;
    width: 6px;
    height: 0;
    border-top: 2px solid #bcc2cc;
    transform: rotate(35deg);
    transform-origin: left center;
}

.share-icon .si-head {
    position: absolute;
    right: 1px;
    top: 5px;
    width: 8px;
    height: 8px;
}

.share-icon .si-head::before,
.share-icon .si-head::after {
    content: '';
    position: absolute;
    width: 8px;
    height: 0;
    border-top: 2px solid #bcc2cc;
}

.share-icon .si-head::before {
    transform: rotate(45deg);
    left: -2px;
    top: 3px;
}

.share-icon .si-head::after {
    transform: rotate(-45deg);
    left: -2px;
    top: 3px;
}

.share-icon:hover .si-box {
    border-right-color: #1877f2;
    border-top-color: #1877f2;
}

.share-icon:hover .si-shaft {
    border-top-color: #1877f2;
}

.share-icon:hover .si-head::before,
.share-icon:hover .si-head::after {
    border-top-color: #1877f2;
}

.read-more-link {
    color: #8a8d91;
    font-size: 13px;
    font-weight: 400;
    text-decoration: none;
    margin-left: 4px;
}

.read-more-link.expanded {
    display: block;
    margin-top: 6px;
}

.msg-category {
    color: #8a8d91;
    font-size: 12px;
    border: 1px solid #e4e6eb;
    border-radius: 10px;
    padding: 0 6px;
    line-height: 18px;
}

.mode-badge {
    display: inline-block;
    margin-left: 8px;
    padding: 2px 8px;
    border-radius: 10px;
    border: 1px solid #c8e6c9;
    background: #e8f5e9;
    color: #2e7d32;
    font-size: 12px;
    font-weight: 700;
    line-height: 18px;
    vertical-align: middle;
}

#noteContent {
    min-height: 220px;
}

.msg-reply {
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px dashed #e4e6eb;
    margin-left: 12px;
}

.msg-reply-title {
    color: #1877f2;
    font-weight: 700;
    margin-right: 6px;
    white-space: nowrap;
}

.msg-reply-line {
    display: grid;
    grid-template-columns: max-content 1fr;
    align-items: baseline;
    gap: 6px;
    padding-right: 8ch;
}

.msg-reply-time-line {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 6px;
    padding-right: 8ch;
}

.msg-reply-time {
    color: #8a8d91;
    font-size: 12px;
    grid-column: 2;
}

.msg-reply-time-line::before {
    content: '站长回复：';
    visibility: hidden;
    white-space: nowrap;
    grid-column: 1;
    padding-right: 6px;
}

.msg-reply-edit {
    margin-left: 12px;
    margin-top: 12px;
    padding-right: 8ch;
    display: grid;
    grid-template-columns: max-content 1fr;
    align-items: start;
    gap: 6px;
}

.msg-reply-edit::before {
    content: '站长回复：';
    visibility: hidden;
    white-space: nowrap;
    font-weight: 700;
}

.msg-reply-edit textarea {
    grid-column: 1 / 3;
    width: 100%;
    display: block;
    padding: 8px;
    border: 1px solid #dddfe2;
    border-radius: 6px;
    box-sizing: border-box;
}

.msg-reply-edit .reply-actions {
    grid-column: 1 / 3;
    margin-top: 8px;
    display: flex;
    gap: 8px;
    align-items: center;
}

.msg-reply-edit .btn {
    padding: 6px 12px;
    font-size: 13px;
    border-radius: 6px;
    background: #ffffff;
    color: #374151;
    border: 1px solid #dddfe2;
}

.msg-reply-edit .msg-tip {
    font-size: 12px;
    color: #6b7280;
}

.msg-time-line {
    display: block;
    text-align: left;
}

.msg-empty {
    text-align: center;
    color: #8a8d91;
    padding: 12px 0;
}

@supports not (-webkit-background-clip: text) {
    .site-link-text {
        color: inherit;
        -webkit-text-fill-color: initial;
        background: none;
        -webkit-text-stroke: 0;
        text-shadow: none;
    }
}

.site-link:focus-visible {
    outline: 2px solid rgba(24, 119, 242, 0.35);
    outline-offset: 2px;
}

/* 回到顶部按钮 */
.back-to-top {
    position: fixed;
    right: 16px;
    bottom: 16px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid #ffd180;
    background: linear-gradient(90deg, #e3f2fd 0%, #fff3e0 100%);
    color: #1877f2;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    z-index: 10000;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.back-to-top.show {
    display: inline-flex;
}

@media (max-width: 640px) {
    .captcha-input-wrap {
        display: block;
    }

    #noteCategory,
    #noteFavorite,
    #notePublic {
        display: block;
        width: 100%;
        margin: 6px 0;
    }

    .back-to-top {
        bottom: 48px;
    }

    .msg-reply-line {
        display: block;
        padding-right: 0;
        font-size: 13px;
    }

    .msg-time-line,
    .msg-reply-time-line {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        padding-right: 0;
    }

    .msg-reply-time-line {
        display: block;
    }

    .msg-reply-time-line::before {
        display: none;
    }

    .msg-reply-time {
        white-space: nowrap;
        display: inline-block;
    }

    .msg-reply-edit {
        padding-right: 0;
    }

    .msg-reply-edit .btn {
        padding: 6px 10px;
        font-size: 13px;
    }

    .msg-time {
        white-space: nowrap;
        display: inline-block;
    }
}

@media (max-width: 768px) {
    body {
        padding: 12px;
    }

    .site-header-inner {
        padding: 8px 12px;
    }

    .container {
        padding: 16px;
    }

    .msg-page,
    .msg-form,
    .msg-list-section,
    .msg-list {
        width: 100%;
        max-width: 100%;
    }

    .msg-avatar {
        width: 28px;
        height: 28px;
        font-size: 15px;
    }

    .msg-body {
        margin-left: 34px;
    }

    .msg-reply-line,
    .msg-nickname,
    .msg-content {
        word-break: break-word;
        overflow-wrap: anywhere;
    }

    .msg-nickname {
        display: -webkit-box;
        -webkit-line-clamp: 1;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .msg-content {
        white-space: normal;
        display: -webkit-box;
        -webkit-line-clamp: 6;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .msg-reply-line span:last-child {
        display: -webkit-box;
        -webkit-line-clamp: 6;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
}

/* 笔记列表缩略内容两行展示，展开时取消限制 */
.note-page .msg-content {
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.note-page .msg-content.expanded {
    white-space: pre-wrap;
    display: block;
    -webkit-line-clamp: initial;
    -webkit-box-orient: initial;
    overflow: visible;
}
@media (max-width: 768px) {
    .note-page .msg-content.expanded {
        white-space: pre-wrap;
        display: block;
        -webkit-line-clamp: initial;
        -webkit-box-orient: initial;
        overflow: visible;
    }
}

/* 使用说明 */
.instructions {
    background: #f0f2f5;
    padding: 16px 20px;
    margin-bottom: 20px;
    border-radius: 8px;
}

.instructions h3 {
    color: #1877f2;
    margin-bottom: 12px;
    font-size: 1.1em;
    font-weight: 600;
}

.instructions ul {
    list-style-position: inside;
    line-height: 1.6;
    color: #65676b;
    font-size: 0.9em;
}

ul ul {
    padding-left: 40px;
    list-style-type: square;
    color: #666
}

.markdown-body {
    line-height: 1.8;
    color: #050505;
}

.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4,
.markdown-body h5,
.markdown-body h6 {
    margin: 16px 0 8px;
    color: #1877f2;
    font-weight: 600;
}

.markdown-body p {
    margin: 8px 0;
}

.markdown-body a {
    color: #1877f2;
    text-decoration: none;
}

.markdown-body a:hover {
    text-decoration: underline;
}

.markdown-body ul,
.markdown-body ol {
    margin: 8px 0 8px 20px;
}

.markdown-body code {
    background: #f0f2f5;
    border: 1px solid #e4e6eb;
    border-radius: 4px;
    padding: 2px 4px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 0.95em;
}

.markdown-body pre { background: #f8fafc; border: 1px solid #e4e6eb; border-radius: 6px; padding: 10px; overflow: auto; }
.markdown-body pre.md-pre { position: relative; }
.markdown-body .md-codebox { position: relative; }
.markdown-body pre.md-pre::after { content: attr(data-lang); position: absolute; bottom: 12px; right: 16px; font-size: 12px; color: #8a8d91; }
.markdown-body code.md-code { display: block; white-space: pre; }
.markdown-body code.md-code .code-line { position: relative; padding-left: 38px; }
.markdown-body code.md-code .ln { position: absolute; left: 0; width: 32px; color: #9aa0a6; text-align: right; user-select: none; }
.markdown-body code.md-code .cl { white-space: pre; display: inline; }
.markdown-body code.md-code { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; font-size: 13px; line-height: 1.35; }
.markdown-body .tok-comment { color: #6b7280; font-style: italic; }
.markdown-body .tok-string { color: #2e7d32; }
.markdown-body .tok-number { color: #d32f2f; }
.markdown-body .tok-keyword { color: #1976d2; font-weight: 600; }
.markdown-body .tok-tag { color: #d32f2f; }
.markdown-body .tok-attr { color: #6d4c41; }
.markdown-body blockquote { padding: 6px 10px; border-left: 3px solid #ffd180; background: #fff8e1; color: #65676b; margin: 8px 0; border-radius: 6px; }
.markdown-body blockquote blockquote { background: #fff3d1; border-left-color: #ffca7a; }
.markdown-body hr.md-hr { border: 0; border-top: 1px solid #445d9e; height: 0; margin: 12px 0; }
.markdown-body table.md-table { width: 100%; border-collapse: collapse; margin: 12px 0; }
.markdown-body table.md-table th, .markdown-body table.md-table td { border: 1px solid #e4e6eb; padding: 8px; font-size: 0.95em; }
.markdown-body table.md-table th { background: #f9fafb; color: #374151; }
.markdown-body table.md-table td { background: #ffffff; color: #374151; }
.markdown-body .align-left { text-align: left; }
.markdown-body .align-center { text-align: center; }
.markdown-body .align-right { text-align: right; }
.markdown-body img.md-img { max-width: 100%; height: auto; border-radius: 4px; display: inline-block; }
.markdown-body pre.md-pre .md-copy { position: absolute; top: 12px; right: 12px; width: 24px; height: 24px; border: 1px solid #e4e6eb; background: #ffffff; border-radius: 6px; cursor: pointer; display: inline-grid; place-items: center; z-index: 2; box-shadow: 0 2px 6px rgba(0,0,0,0.08); }
.markdown-body pre.md-pre .md-copy::before { content: '📋'; font-size: 14px; color: #9aa0a6; line-height: 1; }
.markdown-body pre.md-pre .md-copy:hover { background: #f9fafb; }
.markdown-body figure.md-figure { margin: 10px 0 20px; }
.markdown-body figure.md-figure { max-width: var(--img-max-width, 100%); }
.markdown-body figure.md-figure.align-center { text-align: center; margin-left: auto; margin-right: auto; }
.markdown-body figure.md-figure.align-right { text-align: right; margin-left: auto; }
.markdown-body figure.md-figure.align-left { text-align: left; }
.markdown-body figure.md-figure img { max-width: 100%; height: auto; display: inline-block; }
.markdown-body figure.md-figure figcaption { font-size: 0.85em; color: #8a8d91; margin-top: 2px; line-height: 1.4; text-align: center; }
.markdown-body .md-task { list-style: none; }
.markdown-body .md-task input[type="checkbox"] { margin-right: 6px; vertical-align: middle; }
.markdown-body .md-footnotes { margin-top: 16px; color: #65676b; }
.markdown-body .md-footnotes h4 { color: #1877f2; margin-bottom: 8px; font-weight: 600; }
.markdown-body .md-footnotes ol { padding-left: 20px; }
.markdown-body .md-footnotes li { margin: 6px 0; }
.markdown-body u { text-decoration: underline; }
.markdown-body .md-toc { background: #f0f2f5; border: 1px solid #e4e6eb; border-radius: 6px; padding: 10px 12px; margin: 12px 0; }
.markdown-body .md-toc > summary { cursor: pointer; color: #1877f2; font-weight: 600; margin-bottom: 6px; }
.markdown-body .md-toc ol { list-style: none; padding: 0; margin: 0; }
.markdown-body .md-toc li { margin: 4px 0; }
.markdown-body .md-toc li.toc-l1 { font-weight: 700; }
.markdown-body .md-toc li.toc-l2 { padding-left: 12px; }
.markdown-body .md-toc li.toc-l3 { padding-left: 24px; }
.markdown-body .md-toc li.toc-l4 { padding-left: 36px; }
.markdown-body .md-toc li.toc-l5 { padding-left: 48px; }
.markdown-body .md-toc li.toc-l6 { padding-left: 60px; }
.markdown-body .md-task-summary { background: #fff3e0; border: 1px solid #ffd180; border-radius: 6px; padding: 8px 10px; color: #8a8d91; margin: 12px 0; font-size: 0.95em; }
.markdown-body pre.md-pre .copy-toast { position: absolute; background: #ffffff; border: 1px solid #c8e6c9; color: #2e7d32; border-radius: 6px; padding: 4px 8px; box-shadow: 0 2px 8px rgba(0,0,0,0.1); animation: toast-pop 1.5s ease; z-index: 10000; font-size: 12px; pointer-events: none; transform-origin: top right; }
.markdown-body .md-code-summary { font-size: 12px; color: #9aa0a6; }
@keyframes toast-pop {
    0% { opacity: 0; transform: translateY(-6px) scale(0.98); }
    20% { opacity: 1; transform: translateY(0) scale(1); }
    80% { opacity: 1; transform: translateY(0) scale(1); }
    100% { opacity: 0; transform: translateY(-6px) scale(0.98); }
}



/* 搜索区域 */
.search-section {
    margin-bottom: 24px;
}

.ip-inline {
    text-align: center;
    padding: 0 6px;
    margin: 12px 0;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    font-size: 0.85em;
    color: #8a8d91;
}

#ipInfo span {
    display: inline-block;
}

#ipText,
#locationText {
    word-break: break-word;
    overflow-wrap: anywhere;
}

.search-box {
    display: flex;
    gap: 8px;
    max-width: 600px;
    margin: 0 auto;
}

#cityInput {
    flex: 1;
    padding: 10px 12px;
    font-size: 15px;
    border: 1px solid #dddfe2;
    border-radius: 6px;
    outline: none;
    transition: all 0.2s;
    background: #f0f2f5;
    color: #050505;
}

#cityInput:focus {
    background: #ffffff;
    border-color: #1877f2;
    box-shadow: 0 0 0 2px rgba(24, 119, 242, 0.1);
}

#cityInput::placeholder {
    color: #8a8d91;
}

#searchBtn {
    padding: 5px 20px;
    background: linear-gradient(90deg, #e3f2fd 0%, #fff3e0 100%);
    color: #1877f2;
    border: 1px solid #ffb74d;
    border-radius: 8px;
    font-size: clamp(16px, 4vw, 20px);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    white-space: nowrap;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
    text-align: center;
}

#searchBtn:hover {
    background: linear-gradient(90deg, #e1f0fb 0%, #ffe7cc 100%);
}

#searchBtn:active {
    background: linear-gradient(90deg, #d3e8fa 0%, #ffd8a6 100%);
    transform: scale(0.98);
}

#searchBtn .btn-icon {
    font-size: 1.2em;
}

.btn {
    padding: 10px 20px;
    background: linear-gradient(90deg, #e3f2fd 0%, #fff3e0 100%);
    color: #1877f2;
    border: 1px solid #ffd180;
    border-radius: 8px;
    font-size: clamp(14px, 3.5vw, 15px);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    text-decoration: none;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
    text-align: center;
}

.btn:hover {
    background: linear-gradient(90deg, #e1f0fb 0%, #ffe7cc 100%);
    border-color: #ffe0b2;
}

.btn:active {
    background: linear-gradient(90deg, #d3e8fa 0%, #ffd8a6 100%);
    transform: scale(0.98);
    border-color: #ffd59a;
}



/* 热门城市一行样式 */
.hot-cities-inline {
    text-align: center;
    margin-top: 12px;
    padding: 8px;
    color: #65676b;
    font-size: 13px;
}

.hot-label {
    color: #ff9800;
    font-weight: 600;
    margin-right: 8px;
}

.hot-cities-inline button {
    color: #ff9800;
    background: transparent;
    border: 1px solid #ffd180;
    margin: 0 6px;
    transition: all 0.2s;
    padding: 6px 10px;
    border-radius: 16px;
    font-weight: 500;
    cursor: pointer;
}

.hot-cities-inline button:hover {
    background: #fff3e0;
    border-color: #ffb74d;
}

/* 加载和错误提示 */
.loading {
    text-align: center;
    padding: 32px;
    color: #1877f2;
}

.msg-list-section .loading {
    width: 100%;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #e4e6eb;
    border-top: 3px solid #1877f2;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 16px;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.error {
    background: linear-gradient(90deg, #e3f2fd 0%, #fff3e0 100%);
    border: 1px solid #ffb74d;
    color: rgb(239 112 112);
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    text-align: center;
    font-size: 0.95em;
    font-weight: 600;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

/* 当前天气 */
.current-weather {
    margin-bottom: 24px;
    background: linear-gradient(135deg, #e3f2fd 0%, #fff3e0 100%);
    color: #1877f2;
    padding: 24px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border: 1px solid #ffb74d;
}

.weather-header {
    text-align: center;
    margin-bottom: 20px;
}

.weather-header h2 {
    font-size: 1.6em;
    margin-bottom: 4px;
    font-weight: 600;
}

.weather-header p {
    opacity: 0.9;
    font-size: 0.85em;
}

.weather-main {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.temperature-section {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
}

#weatherIcon {
    width: 100px;
    height: 100px;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.2));
}

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

.temp-current {
    font-size: 3.5em;
    font-weight: 300;
    line-height: 1;
}

.temp-desc {
    font-size: 1.3em;
    margin-top: 8px;
    opacity: 0.95;
}

.weather-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
}

.detail-item {
    background: rgba(255, 255, 255, 0.15);
    padding: 12px;
    border-radius: 6px;
    text-align: center;
    backdrop-filter: blur(10px);
}

.detail-label {
    display: block;
    font-size: 0.85em;
    opacity: 0.9;
    margin-bottom: 6px;
}

.detail-value {
    display: block;
    font-size: 1.2em;
    font-weight: 600;
}

/* 3天预报 */
.forecast-section {
    margin-bottom: 24px;
}

.forecast-section h3 {
    color: #1877f2;
    margin-bottom: 16px;
    text-align: center;
    font-size: 1.4em;
    font-weight: 600;
}

.forecast-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 12px;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.forecast-day {
    background: #f0f2f5;
    border: 1px solid #e4e6eb;
    border-radius: 8px;
    padding: 16px 12px;
    text-align: center;
    transition: all 0.2s;
    animation: fadeInUp 0.6s ease backwards;
}

.forecast-day:hover {
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border-color: #1877f2;
    background: #ffffff;
}

.forecast-date {
    font-weight: 600;
    color: #ff9800;
    margin-bottom: 4px;
    font-size: 0.9em;
}

.forecast-weekday {
    color: #65676b;
    font-size: 0.8em;
    margin-bottom: 8px;
}

.forecast-icon {
    width: 50px;
    height: 50px;
    margin: 8px auto;
}

.forecast-temp {
    font-size: 1.2em;
    font-weight: 600;
    color: #050505;
    margin: 8px 0;
}

.forecast-desc {
    color: #65676b;
    font-size: 0.85em;
    margin-bottom: 8px;
}

.forecast-details {
    display: flex;
    justify-content: space-around;
    font-size: 0.8em;
    color: #65676b;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #e4e6eb;
}

.error-page {
    margin-top: 12px;
}

.error-hero {
    text-align: center;
    padding: 48px 0;
    background: linear-gradient(135deg, #e3f2fd 0%, #fff3e0 100%);
    color: #1877f2;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin: 0 auto 24px auto;
    border: 1px solid #ffb74d;
    width: 100%;
    max-width: 600px;
}

.error-page header {
    border-bottom: 1px solid #e4e6eb;
    padding-bottom: 16px;
    margin: 0 auto 24px auto;
    max-width: 600px;
    width: 100%;
}

.error-page footer {
    max-width: 600px;
    margin: 24px auto 0 auto;
    width: 100%;
}

.error-code {
    font-size: 110px;
    font-weight: 700;
    letter-spacing: 8px;
}

.error-desc {
    font-size: 16px;
    margin-top: 12px;
    opacity: 0.95;
}

.error-actions {
    margin-top: 24px;
}

/* 页脚 */
footer {
    text-align: center;
    padding-top: 16px;
    margin-top: 24px;
    border-top: 1px solid #e4e6eb;
    color: #65676b;
    font-size: 0.85em;
}

footer a {
    color: #1877f2;
    text-decoration: none;
    font-weight: 500;
}

footer a:hover {
    text-decoration: underline;
}

footer p {
    margin: 4px 0;
}

/* 响应式设计 */
@media (max-width: 768px) {
    body {
        padding: 12px;
    }

    .container {
        padding: 16px;
    }

    .site-header-inner {
        padding: 8px 12px;
    }

    .site-name {
        font-size: clamp(16px, 3.2vw, 22px);
    }

    .site-link {
        padding: 5px 8px;
        font-size: 13px;
    }

    header h1 {
        font-size: 1.6em;
    }

    .search-box {
        flex-direction: column;
    }

    #searchBtn {
        width: 100%;
    }
}

@media (max-width: 768px) {
    .hot-cities-inline {
        font-size: 12px;
    }

    .hot-cities-inline button {
        margin: 0 4px;
        padding: 3px 6px;
    }

    .temperature-section {
        flex-direction: column;
        gap: 12px;
    }

    #weatherIcon {
        width: 80px;
        height: 80px;
    }

    .temp-current {
        font-size: 2.8em;
    }

    .weather-details {
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    }

    .forecast-container {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    }
}

/* 修复：移除多余的右大括号，保持媒体查询完整 */

@media (max-width: 480px) {
    .container {
        padding: 12px;
    }

    .site-header-inner {
        flex-direction: column;
        gap: 8px;
    }

    .site-name {
        font-size: clamp(16px, 5vw, 20px);
    }

    header h1 {
        font-size: 1.4em;
    }

    .subtitle {
        font-size: 0.85em;
    }


    .ip-inline {
        flex-direction: column;
        gap: 6px;
    }

    .hot-cities-inline {
        font-size: 11px;
    }

    .hot-cities-inline button {
        display: inline-block;
        margin: 2px 3px;
    }

    .forecast-container {
        grid-template-columns: 1fr;
    }

    .current-weather {
        padding: 16px;
    }

    .temp-current {
        font-size: 2.5em;
    }
}
