/* ================= Base ================= */
:root { 
    --primary: #007bff; 
    --primary-hover: #0056b3;
    --dark: #333; 
    --gray: #767676; 
    --border: #eee; 
    --bg-odd: #fcfcfc; 
    --bg-even: #ffffff; 
    --bg-hover: #f0f8ff;
    --code-bg: #f6f8fa;
    --radius-sm: 3px;
    --radius-md: 6px;
    --radius-lg: 10px;
    --shadow-1: 0 2px 10px rgba(0,0,0,0.08);
    --focus-ring: 0 0 0 3px rgba(0,123,255,0.22);
}
[data-theme="dark"] {
    --primary: #4dabf7;
    --dark: #e0e0e0;
    --gray: #a8a8a8;
    --border: #333;
    --bg-odd: #1a1a1a;
    --bg-even: #202020;
    --bg-hover: #2a2a2a;
    --code-bg: #1e1e1e;
    --shadow-1: 0 2px 12px rgba(0,0,0,0.35);
    --focus-ring: 0 0 0 3px rgba(77,171,247,0.35);
}

/* LearnKu Skin（已移除后台开关，保留默认风格） */

* { box-sizing: border-box; }
body { margin: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; font-size: 14px; color: var(--dark); background: var(--bg-even); line-height: 1.65; transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease; }
a { text-decoration: none; color: var(--dark); transition: color 0.2s ease; }
a:hover { color: var(--primary); }
ul { list-style: none; padding: 0; margin: 0; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 15px; }
button, input, textarea { font: inherit; }

/* 键盘可访问性：统一焦点样式 */
:where(a, button, input, textarea, [tabindex], [role="button"], .emoji-toggle-btn, .icon-btn, .submit-btn):focus-visible {
    outline: none;
    box-shadow: var(--focus-ring);
    border-radius: var(--radius-sm);
}
:where(a, button, input, textarea, [tabindex], [role="button"], .emoji-toggle-btn, .icon-btn, .submit-btn):focus:not(:focus-visible) {
    outline: none;
    box-shadow: none;
}

/* ================= Header ================= */
.header { padding: 15px 0; border-bottom: 1px solid var(--border); background: var(--bg-even); }
.header-wrap { display: flex; align-items: center; justify-content: space-between; }
.logo { font-size: 22px; font-weight: 700; display: flex; align-items: center; color: var(--primary); }
.logo img { height: 52px; }
.header-right { display: flex; align-items: center; gap: 15px; }

.search-area { position: relative; width: 260px; }
.search-area form { display: flex; border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; background: var(--bg-even); }
.search-area input { flex: 1; border: none; padding: 8px 10px; outline: none; background: transparent; color: var(--dark); }
.search-area button { border: none; background: transparent; padding: 0 10px; cursor: pointer; color: var(--gray); }
#live-search-result { position: absolute; top: 100%; left: 0; width: 100%; background: var(--bg-even); border: 1px solid var(--border); z-index: 99; display: none; box-shadow: var(--shadow-1); border-radius: var(--radius-md); margin-top: 5px; max-height: 300px; overflow-y: auto; }
.search-item { display: block; padding: 8px 12px; border-bottom: 1px solid var(--border); font-size: 13px; }
.search-item:hover { background: var(--bg-hover); color: var(--primary); }

.theme-switch { cursor: pointer; font-size: 20px; color: var(--gray); display: flex; align-items: center; }
.rss-icon { font-size: 20px; color: #f26522; display: flex; align-items: center; transition: 0.2s; }
.rss-icon:hover { color: #e0541a; }

/* ================= Nav ================= */
.nav-bar { background: var(--bg-even); border-bottom: 1px solid var(--border); margin-bottom: 20px; }
.nav-list { display: flex; overflow-x: auto; white-space: nowrap; -webkit-overflow-scrolling: touch; gap: 6px; align-items: center; }
.nav-list::-webkit-scrollbar { height: 4px; }
.nav-list::-webkit-scrollbar-thumb { background: var(--border); border-radius: 999px; }
.nav-list li a:not(.sort-chip) {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 36px;                 /* 与 sort-chip 对齐 */
    padding: 0 12px;
    border-radius: var(--radius-md);
    color: var(--dark);
    font-weight: 600;
    border: 1px solid transparent;
    transition: background-color .15s ease, border-color .15s ease, color .15s ease, transform .15s ease;
}
.nav-list li a:not(.sort-chip):hover {
    background: var(--bg-hover);
    border-color: rgba(0,0,0,0.06);
    color: var(--primary);
    transform: translateY(-1px);
}
.nav-list li a:not(.sort-chip).active,
.nav-list li a:not(.sort-chip).current {
    background: rgba(0,123,255,0.10);
    border-color: rgba(0,123,255,0.18);
    color: var(--primary);
}
[data-theme="dark"] .nav-list li a:not(.sort-chip):hover {
    border-color: rgba(255,255,255,0.10);
}
[data-theme="dark"] .nav-list li a:not(.sort-chip).active,
[data-theme="dark"] .nav-list li a:not(.sort-chip).current {
    background: rgba(77,171,247,0.16);
    border-color: rgba(77,171,247,0.25);
}

/* nav 横向滑动按钮 */
.nav-scroll { position: relative; }
.nav-scroll-fade {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 42px;
    pointer-events: none;
    opacity: 0;
    transition: opacity .15s ease;
    z-index: 4;
}
.nav-scroll-fade.left { left: -2px; background: linear-gradient(90deg, var(--bg-even), rgba(255,255,255,0)); }
.nav-scroll-fade.right { right: -2px; background: linear-gradient(270deg, var(--bg-even), rgba(255,255,255,0)); }
[data-theme="dark"] .nav-scroll-fade.left { background: linear-gradient(90deg, var(--bg-even), rgba(32,32,32,0)); }
[data-theme="dark"] .nav-scroll-fade.right { background: linear-gradient(270deg, var(--bg-even), rgba(32,32,32,0)); }

.nav-scroll-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: rgba(255,255,255,0.92);
    color: var(--gray);
    display: none; /* JS 按需显示 */
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 5;
    box-shadow: var(--shadow-1);
}
.nav-scroll-btn.left { left: -10px; }
.nav-scroll-btn.right { right: -10px; }
.nav-scroll-btn:hover { color: var(--primary); border-color: var(--primary); }
.nav-scroll-btn:active { transform: translateY(-50%) scale(0.98); }
[data-theme="dark"] .nav-scroll-btn { background: rgba(32,32,32,0.92); border-color: rgba(255,255,255,0.12); }

/* ================= Sortbar (LearnKu-like) ================= */
.sort-chip {
    --chip-bg: #f3f4f6;
    --chip-color: #111827;
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 0 12px;
    border-radius: var(--radius-md); /* 轻微弧度：更像“分类卡片” */
    background-color: var(--chip-bg);
    background-image: none; /* 封面图由 inline style 设置，避免暗色模式丢失 */
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    color: #fff;
    border: 1px solid rgba(0,0,0,0.06);
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
    transition: transform .15s ease, box-shadow .15s ease, background-color .15s ease, border-color .15s ease;
    width: 112px;          /* 统一大小（更窄） */
    height: 36px;          /* 统一大小 */
    /* 覆盖 nav 默认样式 */
    margin: 6px 0;
}
.sort-chip::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    background: linear-gradient(180deg, rgba(0,0,0,0.08), rgba(0,0,0,0.22));
}
[data-theme="dark"] .sort-chip::before {
    background: linear-gradient(180deg, rgba(0,0,0,0.18), rgba(0,0,0,0.42));
}
.sort-chip.current {
    box-shadow: 0 12px 26px rgba(0,0,0,0.16);
    border-color: rgba(255,255,255,0.35);
    outline: 2px solid rgba(0,123,255,0.18);
}
[data-theme="dark"] .sort-chip.current {
    outline: 2px solid rgba(77,171,247,0.28);
}
.sort-chip:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 22px rgba(0,0,0,0.14);
    border-color: rgba(0,0,0,0.12);
}
.sort-chip:active { transform: translateY(0); box-shadow: 0 2px 10px rgba(0,0,0,0.08); }
.sort-chip-icon {
    position: absolute;
    left: 10px;
    width: 20px;
    height: 20px;
    border-radius: 6px;
    object-fit: contain;
    background: rgba(255,255,255,0.92);
}
.sort-chip-text {
    font-size: 13px;
    font-weight: 800;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    width: 100%;
    text-align: center;          /* 修正“偏右”：始终居中 */
    padding: 0 8px;              /* 默认完全居中 */
    text-shadow: 0 1px 0 rgba(0,0,0,0.22);
}
.sort-chip.has-icon .sort-chip-text {
    padding-left: 32px;          /* 有 icon 时再留位，避免“看起来偏右” */
}
[data-theme="dark"] .sort-chip {
    border-color: rgba(255,255,255,0.08);
    box-shadow: 0 10px 24px rgba(0,0,0,0.35);
}
[data-theme="dark"] .sort-chip:hover {
    box-shadow: 0 10px 24px rgba(0,0,0,0.45);
}

.notice { 
    background: var(--bg-odd);
    color: var(--gray);
    padding: 8px 14px; 
    border-radius: 4px; 
    margin-bottom: 20px; 
    border: 1px solid var(--border);
    display: flex; 
    align-items: center; 
    gap: 8px; 
    font-size: 13px;
}
.notice i { color: var(--gray); flex-shrink: 0; font-size: 14px; }

/* ================= Layout ================= */
.row { display: flex; gap: 20px; }
.main-col { flex: 1; min-width: 0; }
.col-side { width: 300px; flex-shrink: 0; position: sticky; top: 20px; max-height: calc(100vh - 40px); overflow-y: auto; align-self: flex-start; }

/* === 列表样式 (核心修改) === */
.list-box { border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; }
.list-item { 
    display: flex; 
    align-items: center; 
    padding: 12px 15px; 
    border-bottom: 1px solid var(--border); 
    transition: transform 0.3s ease, background-color 0.3s ease; 
    justify-content: space-between; 
}
.list-item:nth-child(odd) { background: var(--bg-odd); }
.list-item:nth-child(even) { background: var(--bg-even); }

/* 列表悬停动效：更克制的位移与层次 */
.list-item:hover { 
    background: var(--bg-hover); 
    transform: translateX(2px); 
}

.list-item:last-child { border-bottom: none; }

.post-title { flex: 1; font-size: 15px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; display: flex; align-items: center; margin: 0; }
.post-title a { color: var(--dark); font-weight: 500; }
.top-icon { color: #ff4757; font-size: 14px; margin-right: 5px; transform: rotate(45deg); }
.sort-tag { color: var(--gray); margin-right: 8px; font-size: 12px; background: rgba(0,0,0,0.05); padding: 2px 6px; border-radius: 3px; }
.post-date { color: var(--gray); font-size: 12px; margin-left: 15px; min-width: 80px; text-align: right; font-family: monospace; }
.highlight { color: red !important; font-weight: bold; }

.empty-box { text-align: center; padding: 40px; color: var(--gray); background: var(--bg-even); border: 1px solid var(--border); }

/* ================= Pagination ================= */
.pagination { margin: 20px 0; text-align: center; }
.pagination a, .pagination span { display: inline-block; padding: 5px 12px; margin: 0 2px; border: 1px solid var(--border); border-radius: 3px; background: var(--bg-even); color: var(--gray); font-size: 13px; }
.pagination a:hover { border-color: var(--primary); color: var(--primary); }
.pagination .current { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ================= Article ================= */
.article-box { padding: 25px; background: var(--bg-even); border: 1px solid var(--border); border-radius: 4px; }
.art-title { font-size: 24px; text-align: center; margin-bottom: 15px; font-weight: 700; color: var(--dark); }
.art-meta { text-align: center; color: var(--gray); font-size: 12px; background: var(--bg-odd); padding: 10px; margin-bottom: 25px; display: flex; justify-content: center; gap: 15px; border-radius: 4px; }
.art-content { font-size: 15px; line-height: 1.8; color: var(--dark); word-wrap: break-word; }
.art-content p { margin: 0 0 1em; }
.art-content h1, .art-content h2, .art-content h3, .art-content h4 { line-height: 1.35; }
.art-content h1 { font-size: 1.8em; margin: 28px 0 12px; }
.art-content h4 { font-size: 1.05em; margin: 18px 0 8px; }
.art-content img { max-width: 100%; border: 1px solid var(--border); padding: 4px; border-radius: 4px; margin: 10px 0; }

/* 文章内链接图标 */
.art-content a { color: var(--primary); }
.art-content a:hover { text-decoration: underline; }
.link-icon-ext,
.link-icon-int {
    font-size: 0.72em;
    vertical-align: middle;
    margin-left: 2px;
    opacity: 0.55;
    position: relative;
    top: -1px;
    font-style: normal;
}
.link-icon-ext { color: var(--primary); }
.link-icon-int { color: var(--gray); }
.art-content a:hover .link-icon-ext,
.art-content a:hover .link-icon-int { opacity: 1; }

/* 标题样式：无左侧蓝线，纯文字加粗 */
.art-content h2, .art-content h3 { margin: 20px 0 10px; color: var(--dark); font-weight: 700; font-size: 1.2em; border-bottom: 1px dashed var(--border); padding-bottom: 10px; }

/* 代码块 */
.art-content pre { position: relative; margin: 20px 0; padding: 10px; border: 1px solid var(--border); border-radius: 4px; background: var(--code-bg); overflow-x: auto; }
[data-theme="dark"] .art-content pre { border-color: #333; }
.copy-btn { position: absolute; top: 5px; right: 5px; font-size: 12px; border: 1px solid var(--border); background: var(--bg-even); padding: 3px 8px; cursor: pointer; border-radius: 3px; color: var(--gray); z-index: 10; }
.copy-btn:hover { color: var(--primary); border-color: var(--primary); }

/* 底部标签 */
.art-footer { margin-top: 30px; padding-top: 20px; border-top: 1px dashed var(--border); display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; }
.tag-item { background: var(--bg-odd); color: var(--gray); padding: 4px 10px; border-radius: 8px; font-size: 12px; margin-right: 5px; border: 1px solid var(--border); }
.tag-item:hover { background: var(--primary); color: #fff; border-color: var(--primary); }
.no-tag { color: var(--gray); font-size: 12px; }

.action-bar { display: flex; gap: 10px; }
.icon-btn { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; cursor: pointer; font-size: 18px; color: var(--gray); background: var(--bg-even); position: relative; transition: color 0.2s ease, border-color 0.2s ease, transform 0.2s ease; }
.icon-btn:hover { border-color: var(--primary); color: var(--primary); }
.icon-btn:active { transform: translateY(1px); }
.icon-btn.like.active { background: #ff4757; color: #fff; border-color: #ff4757; }
.like-num { position: absolute; top: -5px; right: -5px; background: #ff4757; color: #fff; font-size: 10px; padding: 0 5px; border-radius: 8px; height: 16px; line-height: 16px; display: none; min-width: 16px; text-align: center; }

/* ================= Comments ================= */
.comments-wrap { margin-top: 30px; }
.section-title { font-size: 16px; border-bottom: 1px solid var(--border); padding-bottom: 10px; margin-bottom: 20px; font-weight: 700; }
.comment-list { display: flex; flex-direction: column; gap: 20px; }
.comment-item { display: flex; gap: 15px; }
.c-avatar { width: 40px; height: 40px; border-radius: 30%; background: #e1ecf4; color: var(--primary); display: flex; align-items: center; justify-content: center; font-size: 20px; flex-shrink: 0; }
.c-avatar.small { width: 32px; height: 32px; font-size: 16px; }

.c-body { flex: 1; max-width: 100%; }
.c-info { margin-bottom: 5px; font-size: 12px; color: var(--gray); display: flex; justify-content: space-between; align-items: center; }
.c-user { font-weight: bold; color: var(--dark); font-size: 14px; margin-right: 10px; }
.c-reply { color: var(--primary); cursor: pointer; }

.c-content { display: inline-block; max-width: 100%; background: var(--bg-odd); padding: 10px 15px; border-radius: 0 15px 15px 15px; border: 1px solid var(--border); position: relative; color: var(--dark); line-height: 1.5; font-size: 14px; word-break: break-word; overflow-wrap: anywhere; }
.child .c-content { background: var(--bg-even); border-color: var(--primary); }
.c-quote { margin: 0 0 6px 0; padding: 4px 10px; background: var(--bg-even); border-left: 3px solid var(--border); border-radius: 2px; color: var(--gray); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 300px; }
.c-children { margin-top: 15px; padding-left: 15px; border-left: 2px solid var(--border); display: flex; flex-direction: column; gap: 15px; }

/* 评论框与工具栏 */
.comment-form { background: var(--bg-even); padding: 20px; border: 1px solid var(--border); border-radius: 4px; margin-top: 20px; }
.form-row { display: flex; gap: 10px; margin-bottom: 10px; }
.form-row input { flex: 1; padding: 8px; border: 1px solid var(--border); border-radius: 3px; background: var(--bg-odd); color: var(--dark); }
.editor-wrap { border: 1px solid var(--border); background: var(--bg-odd); border-radius: 3px; }
textarea#comment { width: 100%; border: none; padding: 10px; height: 80px; resize: vertical; outline: none; background: transparent; color: var(--dark); }

.toolbar { padding: 5px 10px; border-top: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; position: relative; }
.toolbar-left, .toolbar-right { display: flex; align-items: center; gap: 15px; }

/* 表情按钮 */
.emoji-toggle-btn {
    cursor: pointer; color: var(--gray); font-size: 13px;
    display: inline-flex; align-items: center; gap: 5px;
    padding: 4px 10px; border-radius: 3px;
    border: 1px solid var(--border);
    background: var(--bg-odd);
    transition: .2s; user-select: none;
}
.emoji-toggle-btn:hover,
.emoji-toggle-btn.active {
    color: var(--primary); border-color: var(--primary);
    background: var(--bg-hover);
}
/* 表情面板：Grid 行高动画，height:0→auto 丝滑过渡 */
#emoji-list-wrap {
    display: grid;
    grid-template-rows: 0fr;       /* 折叠：内容行高为 0 */
    transition: grid-template-rows .28s cubic-bezier(.4,0,.2,1),
                opacity .22s ease;
    opacity: 0;
    background: var(--bg-odd);
    border: 1px solid var(--border);
    border-top: none;
    border-radius: 0 0 4px 4px;
    overflow: hidden;
}
#emoji-list-wrap.open {
    grid-template-rows: 1fr;       /* 展开：自然高度 */
    opacity: 1;
}
/* 内层必须 min-height:0 才能被压缩到 0 */
#emoji-list {
    min-height: 0;
    display: flex; flex-wrap: wrap; gap: 4px;
    padding: 8px;
}
#emoji-list span {
    cursor: pointer; font-size: 22px;
    width: 36px; height: 36px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 4px;
    transition: background .12s, transform .15s cubic-bezier(.34,1.56,.64,1);
    flex-shrink: 0;
}
#emoji-list span:hover { background: var(--bg-hover); transform: scale(1.25); }

/* 验证码 */
.captcha-inline { display: flex; align-items: center; gap: 5px; background: var(--bg-even); border: 1px solid var(--border); padding: 2px 5px; border-radius: 3px; }
.captcha-inline input { border: none !important; background: transparent !important; width: 60px; padding: 0 5px !important; font-size: 12px; height: 26px; outline: none; color: var(--dark); }
.captcha-img-box { cursor: pointer; height: 26px; display: flex; align-items: center; border-left: 1px solid var(--border); padding-left: 5px; }
.captcha-img-box img { height: 22px; display: block; max-width: none; }

.submit-btn { background: var(--primary); color: #fff; border: none; padding: 5px 20px; border-radius: 20px; cursor: pointer; font-size: 13px; transition: background-color 0.2s ease, opacity 0.2s ease, transform 0.2s ease; }
.submit-btn:hover { background: var(--primary-hover); }
.submit-btn:active { transform: translateY(1px); }
.submit-btn:disabled { opacity: 0.6; cursor: not-allowed; }
.btn-cancel { border: none; background: transparent; color: var(--gray); cursor: pointer; font-size: 12px; }

/* ================= Sidebar ================= */
.widget { margin-bottom: 20px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--bg-even); overflow: hidden; }
/* 侧边栏标题：无左侧蓝线 */
.widget-title { background: var(--bg-odd); padding: 10px 15px; font-weight: 700; border-bottom: 1px solid var(--border); font-size: 14px; }
.widget li { padding: 8px 15px; border-bottom: 1px dashed var(--border); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.widget li a { color: var(--gray); }
.widget li a:hover { color: var(--primary); transform: translateX(3px); display: inline-block; }

#toc-list { padding: 10px 0; max-height: 400px; overflow-y: auto; }
#toc-list li { border: none; padding: 4px 15px; }
#toc-list a { padding-left: 10px; border-left: 2px solid transparent; display: block; }
#toc-list a:hover, #toc-list a.active { color: var(--primary); border-left-color: var(--primary); background: var(--bg-hover); }
.toc-h3 a { margin-left: 15px; font-size: 12px; opacity: 0.8; }

/* 广告轮播 */
.widget-ad { border: none; background: transparent; padding: 0 !important; }
.ad-carousel { width: 100%; position: relative; overflow: hidden; border-radius: 4px; aspect-ratio: 2/1; }
.ad-wrapper { display: flex; width: 100%; height: 100%; transition: transform 0.5s ease; }
.ad-item { flex: 0 0 100%; width: 100%; position: relative; }
.ad-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ad-tag { position: absolute; bottom: 5px; right: 5px; background: rgba(0,0,0,0.3); color: #fff; font-size: 10px; padding: 2px 5px; border-radius: 2px; }
.ad-dots { position: absolute; bottom: 10px; left: 50%; transform: translateX(-50%); display: flex; gap: 5px; }
.ad-dots span { width: 6px; height: 6px; background: rgba(255,255,255,0.5); border-radius: 50%; cursor: pointer; }
.ad-dots span.active { background: #fff; width: 12px; border-radius: 3px; }

/* ================= Footer ================= */
.footer { margin-top: 40px; padding: 30px 0; border-top: 1px solid var(--border); text-align: center; color: var(--gray); font-size: 12px; background: var(--bg-even); }
#back-to-top { position: fixed; bottom: 60px; right: 20px; width: 40px; height: 40px; background: var(--bg-even); border: 1px solid var(--border); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 20px; cursor: pointer; box-shadow: var(--shadow-1); z-index: 99; display: none; }
#pjax-loading-bar { position: fixed; top: 0; left: 0; height: 2px; background: var(--primary); width: 0; z-index: 9999; transition: width 0.2s; }
.modal-mask { position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 1000; display: none; align-items: center; justify-content: center; }
.modal-box { background: var(--bg-even); color: var(--dark); border: 1px solid var(--border); padding: 20px; border-radius: 5px; text-align: center; }
.toast { position: fixed; top: 50%; left: 50%; transform: translate(-50%,-50%); background: rgba(0,0,0,0.8); color: #fff; padding: 10px 20px; border-radius: 4px; z-index: 3000; display: none; }

/* 用户偏好减少动画时，关闭非必要动效 */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    .list-item:hover { transform: none; }
    #emoji-list span:hover { transform: none; }
}

@media (max-width: 768px) {
    .header-wrap { flex-direction: column; gap: 10px; align-items: flex-start; }
    .header-right { width: 100%; justify-content: space-between; }
    .search-area { width: 100%; }
    .row { flex-direction: column; }
    .col-side { width: 100%; order: 2; }
    .main-col { order: 1; }
    .post-date { display: none; }
    .art-footer { flex-direction: column; align-items: flex-start; }
    .action-bar { width: 100%; justify-content: center; }

    /* 评论区移动端适配 */
    .comment-form { padding: 14px; }
    .form-row { flex-direction: column; gap: 8px; }
    .form-row input { width: 100%; min-width: 0; }
    .comment-item { gap: 10px; }
    .c-avatar { width: 34px; height: 34px; font-size: 17px; }
    .c-info { flex-wrap: wrap; gap: 6px 10px; }
    .c-children { padding-left: 10px; }
    .c-quote { max-width: 100%; }

    .toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        padding: 8px 10px;
    }
    .toolbar-left,
    .toolbar-right {
        width: 100%;
        justify-content: space-between;
        gap: 8px;
        flex-wrap: wrap;
    }
    .emoji-toggle-btn { flex-shrink: 0; }
    .captcha-inline {
        flex: 1;
        min-width: 0;
        max-width: 100%;
    }
    .captcha-inline input {
        flex: 1;
        width: auto;
        min-width: 42px;
    }
    .captcha-img-box { padding-left: 4px; }
    .captcha-img-box img {
        height: 22px;
        width: auto;
        max-width: 120px;
    }
    .submit-btn {
        flex-shrink: 0;
        min-width: 86px;
        padding: 7px 16px;
    }
}