/* ================= 主题变量 ================= */
:root, [data-theme="purple"] {
    --primary: #6c5ce7;
    --primary-dark: #5b4cdb;
    --primary-light: #f0eefb;
    --accent: #a29bfe;
    --bg: #f7f8fb;
    --card-bg: #ffffff;
    --text: #2d3436;
    --text-muted: #636e72;
    --border: #eef0f3;
    --shadow-sm: 0 1px 6px rgba(0,0,0,.04);
    --shadow: 0 2px 16px rgba(0,0,0,.05);
    --shadow-lg: 0 8px 24px rgba(0,0,0,.08);
    --radius: 12px;
    --radius-sm: 8px;
}

[data-theme="pink"] {
    --primary: #ec4899;
    --primary-dark: #db2777;
    --primary-light: #fce7f3;
    --accent: #f9a8d4;
    --bg: #fdf4f8;
    --card-bg: #ffffff;
    --text: #3b2436;
    --text-muted: #8b6b7d;
    --border: #fce7f3;
    --shadow-sm: 0 1px 6px rgba(236,72,153,.06);
    --shadow: 0 2px 16px rgba(236,72,153,.08);
    --shadow-lg: 0 8px 24px rgba(236,72,153,.14);
}

[data-theme="blue-pink"] {
    --primary: #3b82f6;
    --primary-dark: #2563eb;
    --primary-light: #dbeafe;
    --accent: #f472b6;
    --bg: #f8fafc;
    --card-bg: #ffffff;
    --text: #1e293b;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --shadow-sm: 0 1px 6px rgba(59,130,246,.05);
    --shadow: 0 2px 16px rgba(59,130,246,.07);
    --shadow-lg: 0 8px 24px rgba(244,114,182,.15);
}

/* ================= Reset ================= */
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.7;
    font-size: 15px;
    transition: background-color .3s;
}
a { color: var(--primary); text-decoration: none; }
a:hover { opacity: .85; }
img { max-width: 100%; }
button { font-family: inherit; }
.container { max-width: 1140px; margin: 0 auto; padding: 0 20px; }

/* ================= Header ================= */
.site-header {
    background: var(--card-bg);
    border-bottom: 1px solid var(--border);
    position: sticky; top: 0; z-index: 100;
    transition: background-color .3s;
}
.header-inner {
    display: flex; align-items: center; gap: 24px;
    height: 64px;
    max-width: 1140px; margin: 0 auto; padding: 0 20px;
}
.logo { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 17px; color: var(--text); flex-shrink: 0; }
.logo-mark {
    display: inline-flex; align-items: center; justify-content: center;
    width: 32px; height: 32px;
    background: var(--primary); color: #fff;
    border-radius: 8px; font-weight: 800;
    transition: background-color .3s;
}
.logo-text { white-space: nowrap; }

.nav { display: flex; gap: 22px; flex: 1; overflow: hidden; }
.nav a { color: var(--text); font-size: 14px; white-space: nowrap; }
.nav a:hover { color: var(--primary); opacity: 1; }

.header-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.search-form input {
    padding: 8px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 13px; width: 180px;
    background: var(--bg); color: var(--text);
    transition: .2s;
}
.search-form input:focus { outline: none; border-color: var(--primary); background: var(--card-bg); }

/* 主题按钮 */
.theme-toggle {
    width: 34px; height: 34px;
    border-radius: 50%;
    border: 1.5px solid var(--border);
    background: var(--card-bg);
    cursor: pointer;
    display: inline-flex;
    align-items: center; justify-content: center;
    padding: 0;
    transition: .2s;
    flex-shrink: 0;
}
.theme-toggle:hover { border-color: var(--primary); transform: rotate(15deg); }
.theme-dot {
    width: 16px; height: 16px;
    border-radius: 50%;
    background: var(--primary);
    transition: background-color .3s;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.4);
}

/* 汉堡按钮（移动端） */
.menu-toggle {
    display: none;
    width: 34px; height: 34px;
    border: none; background: transparent;
    cursor: pointer;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    padding: 0;
    flex-shrink: 0;
}
.menu-toggle span {
    display: block;
    width: 20px; height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition: .3s;
}
body.menu-open .menu-toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
body.menu-open .menu-toggle span:nth-child(2) { opacity: 0; }
body.menu-open .menu-toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* 按钮 */
.btn {
    display: inline-block;
    padding: 9px 18px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: .2s;
    text-decoration: none;
    white-space: nowrap;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); opacity: 1; }
.btn-primary:disabled { opacity: .6; cursor: not-allowed; }
.btn-ghost { background: transparent; color: var(--text); border: 1px solid var(--border); }
.btn-ghost:hover { border-color: var(--primary); color: var(--primary); opacity: 1; }
.btn-outline { background: var(--card-bg); color: var(--primary); border: 1px solid var(--primary); }
.btn-outline:hover { background: var(--primary); color: #fff; opacity: 1; }
.btn-block { width: 100%; display: block; text-align: center; }

/* 用户菜单 */
.user-menu { position: relative; }
.avatar {
    width: 32px; height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: block;
    border: 2px solid var(--border);
}
.user-menu .dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    min-width: 140px;
    padding: 6px 0;
    z-index: 20;
}
.user-menu.open .dropdown { display: block; }
.user-menu .dropdown a {
    display: block;
    padding: 9px 16px;
    font-size: 14px;
    color: var(--text);
    opacity: 1;
}
.user-menu .dropdown a:hover { background: var(--bg); color: var(--primary); }

/* ================= 移动菜单 ================= */
.mobile-menu {
    display: none;
    background: var(--card-bg);
    border-bottom: 1px solid var(--border);
    padding: 16px 20px 20px;
    position: sticky; top: 56px;
    z-index: 99;
    max-height: calc(100vh - 56px);
    overflow-y: auto;
    box-shadow: var(--shadow);
}
body.menu-open .mobile-menu { display: block; }
.mobile-menu .mm-search { margin-bottom: 14px; }
.mobile-menu .mm-search input {
    width: 100%;
    padding: 12px 16px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    font-family: inherit;
}
.mobile-menu .mm-search input:focus { outline: none; border-color: var(--primary); }
.mobile-menu .mm-nav { display: flex; flex-direction: column; gap: 2px; margin-bottom: 16px; }
.mobile-menu .mm-nav a {
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.mobile-menu .mm-nav a:hover,
.mobile-menu .mm-nav a:active { background: var(--primary-light); color: var(--primary); opacity: 1; }
.mobile-menu .mm-actions {
    display: flex; gap: 10px; flex-wrap: wrap;
    padding-top: 14px; border-top: 1px solid var(--border);
}
.mobile-menu .mm-actions .btn { flex: 1; text-align: center; }

/* ================= Main ================= */
.site-main { min-height: calc(100vh - 200px); padding: 32px 0 64px; }

/* ================= Hero ================= */
.hero { padding: 40px 0 32px; text-align: center; }
.hero h1 { font-size: 32px; margin-bottom: 8px; line-height: 1.3; }
.hero p { color: var(--text-muted); font-size: 15px; }

/* ================= Layout ================= */
.layout-two-col { display: grid; grid-template-columns: 1fr 300px; gap: 32px; }

/* ================= Cards ================= */
.card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 20px;
    transition: transform .2s, box-shadow .2s, background-color .3s;
}
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.card-body { padding: 22px 26px; }
.card-title { font-size: 19px; margin-bottom: 10px; font-weight: 700; line-height: 1.5; }
.card-title a { color: var(--text); }
.card-title a:hover { color: var(--primary); opacity: 1; }
.card-summary { color: var(--text-muted); font-size: 14.5px; line-height: 1.75; margin-bottom: 14px; }
.card-meta {
    display: flex; flex-wrap: wrap;
    gap: 16px; font-size: 13px;
    color: var(--text-muted);
}
.card-meta .meta-cat {
    color: var(--primary);
    padding: 2px 10px;
    background: var(--primary-light);
    border-radius: 6px;
    font-size: 12.5px;
}
.tag-top {
    display: inline-block;
    padding: 1px 8px;
    background: #ffe8e8; color: #e74c3c;
    font-size: 11px; border-radius: 4px;
    margin-right: 6px; vertical-align: middle;
    font-weight: 600;
}

/* ================= Article ================= */
.article {
    background: var(--card-bg);
    padding: 40px 48px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 24px;
    transition: background-color .3s;
}
.article-header { padding-bottom: 24px; border-bottom: 1px solid var(--border); margin-bottom: 28px; }
.article-header h1 { font-size: 28px; line-height: 1.4; margin-bottom: 16px; }
.article-meta { display: flex; flex-wrap: wrap; gap: 16px; font-size: 13.5px; color: var(--text-muted); }
.article-meta a { color: var(--primary); }

.article-content {
    font-size: 16.5px; line-height: 1.9; color: var(--text);
    word-wrap: break-word; overflow-wrap: break-word;
}
.article-content p { margin: 0 0 18px; }
.article-content h1, .article-content h2, .article-content h3,
.article-content h4, .article-content h5, .article-content h6 {
    margin: 32px 0 14px; font-weight: 700; line-height: 1.4;
}
.article-content h2 { font-size: 22px; border-left: 4px solid var(--primary); padding-left: 12px; }
.article-content h3 { font-size: 18px; }
.article-content ul, .article-content ol { margin: 0 0 18px; padding-left: 26px; }
.article-content li { margin: 6px 0; }
.article-content blockquote {
    margin: 18px 0;
    padding: 14px 18px;
    border-left: 4px solid var(--primary);
    background: var(--primary-light);
    border-radius: 0 8px 8px 0;
    color: var(--text-muted);
}
.article-content pre {
    margin: 18px 0; padding: 16px 18px;
    background: #1e1e2e; color: #e6e6f0;
    border-radius: 10px; overflow-x: auto;
    white-space: pre; tab-size: 4;
}
.article-content code {
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    font-size: 14px;
}
.article-content p code, .article-content li code {
    background: var(--primary-light); color: var(--primary);
    padding: 2px 6px; border-radius: 4px;
}
.article-content a { color: var(--primary); border-bottom: 1px solid var(--primary-light); }
.article-content img { max-width: 100%; border-radius: 10px; display: block; margin: 20px auto; }
.article-content hr { border: none; border-top: 1px solid var(--border); margin: 32px 0; }
.article-content mark { background: #fff3bf; padding: 1px 3px; border-radius: 3px; }
.md-plain { white-space: pre-wrap; word-wrap: break-word; word-break: break-word; line-height: 1.9; tab-size: 4; }

.article-tags { margin-top: 28px; display: flex; gap: 8px; flex-wrap: wrap; }
.tag {
    padding: 4px 12px;
    background: var(--primary-light);
    color: var(--primary);
    border-radius: 20px;
    font-size: 12.5px;
}
.article-notice {
    margin-top: 28px;
    padding: 16px 20px;
    background: #fff8e6;
    border-left: 4px solid #f0b400;
    border-radius: 6px;
    font-size: 13.5px;
    color: #7a5700;
    line-height: 1.7;
}

/* ================= Comments ================= */
.comments {
    background: var(--card-bg);
    padding: 32px 40px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.section-title {
    font-size: 18px; margin-bottom: 22px;
    padding-bottom: 14px; border-bottom: 1px solid var(--border);
}
.section-title .count { color: var(--text-muted); font-weight: 400; font-size: 15px; }
.comment-list { margin-bottom: 28px; }
.comment-item { position: relative; padding: 16px 0 16px 56px; border-bottom: 1px solid var(--border); }
.comment-item:last-child { border-bottom: none; }
.comment-avatar {
    position: absolute; left: 0; top: 16px;
    width: 40px; height: 40px; border-radius: 50%;
}
.comment-head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; flex-wrap: wrap; }
.comment-name { font-size: 14.5px; color: var(--text); }
.comment-head time { font-size: 12.5px; color: var(--text-muted); }
.badge { padding: 1px 8px; font-size: 11px; border-radius: 4px; }
.badge-admin { background: #ffe8e8; color: #e74c3c; }
.comment-content { color: var(--text); font-size: 14.5px; line-height: 1.75; word-wrap: break-word; }
.comment-actions { margin-top: 8px; font-size: 13px; }
.comment-actions a { color: var(--text-muted); }
.comment-actions a:hover { color: var(--primary); opacity: 1; }
.comment-children {
    margin-left: 26px; margin-top: 4px;
    padding-left: 20px;
    border-left: 2px solid var(--border);
}

.comment-form { margin-top: 24px; }
.form-row { display: flex; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.form-row-3 > * { flex: 1; min-width: 180px; }
.form-row-code { display: flex; gap: 12px; }
.form-row-code input { flex: 1; min-width: 0; }
.comment-form input, .comment-form textarea {
    width: 100%;
    padding: 11px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-family: inherit;
    background: var(--bg);
    color: var(--text);
    transition: .2s;
}
.comment-form input:focus, .comment-form textarea:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--card-bg);
    box-shadow: 0 0 0 3px var(--primary-light);
}
.comment-form textarea { resize: vertical; min-height: 120px; }
.form-footer { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; flex-wrap: wrap; gap: 8px; }
.hint { font-size: 13px; color: var(--text-muted); }
.comment-as {
    padding: 8px 14px;
    background: var(--bg);
    border-radius: var(--radius-sm);
    font-size: 13.5px;
    margin-bottom: 12px;
}
.empty { padding: 32px; text-align: center; color: var(--text-muted); font-size: 14px; }

/* Human verify */
.human-row { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.hv-label { font-size: 13.5px; color: var(--text-muted); }
.hv-body { display: flex; align-items: center; gap: 8px; }
.hv-image { height: 42px; border-radius: 6px; border: 1px solid var(--border); cursor: pointer; background: var(--bg); }
.hv-question {
    padding: 8px 16px;
    background: var(--primary-light);
    color: var(--primary);
    border-radius: 6px;
    font-weight: 600;
    font-size: 15px;
}
.human-row input {
    padding: 10px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    width: 100px;
    background: var(--bg);
    color: var(--text);
}
.human-row input:focus { outline: none; border-color: var(--primary); background: var(--card-bg); }
.human-row .hv-refresh { font-size: 18px; color: var(--text-muted); cursor: pointer; }
.human-row .hv-refresh:hover { color: var(--primary); }

/* ================= Pagination ================= */
.pagination { display: flex; justify-content: center; gap: 6px; margin-top: 32px; flex-wrap: wrap; }
.pagination a, .pagination span {
    display: inline-block;
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    background: var(--card-bg);
    color: var(--text);
    border: 1px solid var(--border);
}
.pagination a:hover { border-color: var(--primary); color: var(--primary); opacity: 1; }
.pagination .pg-current { background: var(--primary); color: #fff; border-color: var(--primary); }
.pagination .pg-dots { border: none; background: transparent; }

/* ================= Widgets ================= */
.widget {
    background: var(--card-bg);
    padding: 20px 22px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 20px;
    transition: background-color .3s;
}
.widget-title {
    font-size: 15px; margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
}
.widget-list { list-style: none; }
.widget-list li {
    padding: 8px 0;
    font-size: 14px;
    border-bottom: 1px dashed var(--border);
}
.widget-list li:last-child { border-bottom: none; }
.widget-list a { color: var(--text); }
.widget-list a:hover { color: var(--primary); opacity: 1; }

/* ================= Auth ================= */
.auth-box { display: flex; justify-content: center; padding: 40px 0; }
.auth-card {
    width: 100%; max-width: 420px;
    background: var(--card-bg);
    padding: 40px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.auth-card h1 { font-size: 22px; margin-bottom: 26px; text-align: center; }
.auth-card .field { margin-bottom: 16px; }
.auth-card label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--text-muted); }
.auth-card input, .auth-card textarea, .auth-card select {
    width: 100%; padding: 11px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px; font-family: inherit;
    background: var(--bg); color: var(--text);
}
.auth-card input:focus { outline: none; border-color: var(--primary); background: var(--card-bg); }
.auth-foot { text-align: center; margin-top: 20px; font-size: 13.5px; color: var(--text-muted); }
.input-group { display: flex; gap: 8px; }
.input-group input { flex: 1; min-width: 0; }

/* ================= Profile ================= */
.profile-header { display: flex; gap: 24px; align-items: center; padding: 32px 0; flex-wrap: wrap; }
.profile-avatar { width: 96px; height: 96px; border-radius: 50%; }
.profile-info h1 { font-size: 26px; margin-bottom: 6px; }
.profile-meta { color: var(--text-muted); font-size: 13.5px; margin-bottom: 8px; }
.profile-bio { color: var(--text); font-size: 14.5px; }

/* ================= Page header ================= */
.page-header { padding: 32px 0 24px; }
.page-header h1 { font-size: 26px; margin-bottom: 8px; }
.page-header p { color: var(--text-muted); }
.search-bar-lg { display: flex; gap: 12px; max-width: 520px; margin-top: 16px; }
.search-bar-lg input {
    flex: 1; padding: 12px 16px;
    border: 1.5px solid var(--border);
    border-radius: 10px; font-size: 15px;
    background: var(--bg); color: var(--text);
}
.search-result-hint { color: var(--text-muted); font-size: 14px; margin-bottom: 20px; }

/* ================= Panel / forms ================= */
.panel {
    background: var(--card-bg);
    padding: 24px 26px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 24px;
}
.form-narrow { max-width: 640px; }
.form-narrow .field { margin-bottom: 16px; }
.form-narrow label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--text-muted); }
.form-narrow input, .form-narrow textarea, .form-narrow select {
    width: 100%; padding: 11px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px; font-family: inherit;
    background: var(--bg); color: var(--text);
}
.form-narrow input:focus, .form-narrow textarea:focus, .form-narrow select:focus {
    outline: none; border-color: var(--primary);
    background: var(--card-bg);
}
.tip { font-size: 12.5px; color: var(--text-muted); margin: 8px 0 16px; }

/* ================= Footer ================= */
.site-footer {
    background: var(--card-bg);
    border-top: 1px solid var(--border);
    padding: 26px 0;
    text-align: center;
    color: var(--text-muted);
    font-size: 13.5px;
}
.site-footer p { margin: 4px 0; }
.powered { font-size: 12px; opacity: .6; }

/* ================= Toast ================= */
.toast {
    position: fixed; top: 24px; right: 24px;
    padding: 12px 22px;
    border-radius: 10px;
    color: #fff; font-size: 14px;
    z-index: 9999;
    opacity: 0; transform: translateY(-10px);
    transition: .3s;
    box-shadow: 0 8px 24px rgba(0,0,0,.15);
    max-width: calc(100vw - 48px);
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast-success { background: #00b894; }
.toast-error   { background: #e74c3c; }
.toast-info    { background: #0984e3; }

/* ================= 响应式 ================= */
@media (max-width: 1024px) {
    .layout-two-col { grid-template-columns: 1fr; gap: 24px; }
    .search-form input { width: 140px; }
    .nav { gap: 16px; }
}

@media (max-width: 900px) {
    .search-form { display: none; }
}

@media (max-width: 768px) {
    .header-inner { gap: 10px; height: 56px; padding: 0 14px; }
    .logo { font-size: 16px; }
    .logo-mark { width: 30px; height: 30px; }
    .nav { display: none; }
    .menu-toggle { display: flex; }
    .header-actions { gap: 8px; }
    .header-actions .btn { padding: 7px 12px; font-size: 13px; }

    .container { padding: 0 14px; }
    .site-main { padding: 20px 0 48px; }
    .hero { padding: 24px 0 20px; }
    .hero h1 { font-size: 24px; }
    .hero p { font-size: 14px; }

    .card-body { padding: 18px 20px; }
    .card-title { font-size: 17px; }
    .card-summary { font-size: 14px; }
    .card-meta { gap: 10px; font-size: 12.5px; }

    .article { padding: 24px 20px; }
    .article-header h1 { font-size: 22px; }
    .article-content { font-size: 16px; }
    .article-content h2 { font-size: 19px; }
    .article-content h3 { font-size: 17px; }
    .article-content pre { padding: 14px; font-size: 13px; }

    .comments { padding: 22px 18px; }
    .comment-item { padding: 14px 0 14px 48px; }
    .comment-avatar { width: 34px; height: 34px; top: 14px; }
    .comment-children { margin-left: 12px; padding-left: 14px; }

    .form-row-3 > * { min-width: 100%; }
    .form-row-code { flex-direction: column; }
    .form-row-code .btn { width: 100%; }

    .pagination a, .pagination span { padding: 7px 12px; font-size: 13px; }

    .auth-card { padding: 28px 22px; }
    .profile-header { gap: 16px; padding: 24px 0; }
    .profile-avatar { width: 72px; height: 72px; }
    .profile-info h1 { font-size: 22px; }

    .panel { padding: 20px 18px; }
    .toast { top: 12px; right: 12px; left: 12px; max-width: none; }
}

@media (max-width: 480px) {
    .header-inner { gap: 6px; }
    .header-actions .btn-ghost { display: none; }
    .hero h1 { font-size: 22px; }
    .card-title { font-size: 16px; }
    .article-header h1 { font-size: 20px; }
    .article-content { font-size: 15.5px; }
}

body.menu-open { overflow: hidden; }

/* ===== MTFNOTE_FIX3_PATCH ===== */
/* 移动端：让 header-actions 始终靠右 */
@media (max-width: 768px) {
    .header-inner { gap: 8px; }
    .header-actions { margin-left: auto; gap: 6px; }
    .menu-toggle { display: flex !important; }
}
/* 汉堡按钮视觉修正 */
.menu-toggle {
    justify-content: center;
    align-items: center;
}

/* ===== MTFNOTE_FIX4_PATCH ===== */
@media (max-width: 768px) {
    .header-inner { gap: 8px; }
    .header-actions { margin-left: auto; gap: 6px; }
    .menu-toggle { display: flex !important; }
}
.menu-toggle {
    justify-content: center;
    align-items: center;
}

/* ===== MTFNOTE_FIX5_STYLE ===== */
.hv-image {
    height: 60px !important;
    width: auto;
    max-width: 180px;
    border-radius: 8px;
    border: 1px solid var(--border);
    cursor: pointer;
    background: var(--card-bg);
    display: block;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}
.hv-question {
    padding: 12px 20px !important;
    background: var(--primary-light) !important;
    color: var(--primary) !important;
    border-radius: 8px !important;
    font-weight: 700 !important;
    font-size: 18px !important;
    letter-spacing: 2px;
    display: inline-block;
    line-height: 1.4;
}
@media (max-width: 480px) {
    .hv-image { height: 50px !important; max-width: 150px; }
    .hv-question { padding: 10px 16px !important; font-size: 16px !important; }
}

/* ===== MTFNOTE_VOTE_STYLE ===== */
.comment-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 8px;
    font-size: 13px;
}
.vote-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--text-muted);
    text-decoration: none;
    transition: .15s;
    padding: 3px 6px;
    border-radius: 6px;
}
.vote-btn:hover {
    background: var(--primary-light);
    color: var(--primary);
    opacity: 1;
}
.vote-btn .vote-icon {
    font-size: 14px;
    filter: grayscale(1);
    transition: .15s;
}
.vote-btn:hover .vote-icon { filter: grayscale(0); }
.vote-btn .vote-count {
    font-size: 12px;
    color: var(--text-muted);
    min-width: 8px;
    text-align: center;
}
.vote-btn.active { color: var(--primary); background: var(--primary-light); }
.vote-btn.active .vote-icon { filter: grayscale(0); }
.vote-btn.active .vote-count { color: var(--primary); font-weight: 600; }

.vote-down.active { color: #e74c3c; background: #fee; }
.vote-down.active .vote-count { color: #e74c3c; }

/* ===== MTFNOTE_CARD_OVERLAY ===== */
.article-card { position: relative; cursor: pointer; }

.article-card .card-link-overlay {
    position: absolute;
    top: 0; right: 0; bottom: 0; left: 0;
    z-index: 1;
    border-radius: inherit;
    background: transparent;
    text-indent: -9999px;
    overflow: hidden;
}

/* 分类链接浮在 overlay 之上，独立可点 */
.article-card .card-meta a,
.article-card .card-meta .meta-cat {
    position: relative;
    z-index: 2;
}

/* 标题链接不拦截 overlay 的点击（点哪儿都跳文章） */
.article-card .card-title a {
    position: relative;
    z-index: 0;
    pointer-events: none;
}

/* ===== MTFNOTE_USER_SETTINGS ===== */
.gender-badge {
    display: inline-block;
    padding: 2px 10px;
    font-size: 12px;
    font-weight: 500;
    color: var(--primary);
    background: var(--primary-light);
    border-radius: 20px;
    vertical-align: middle;
    margin-left: 8px;
}

.profile-extra {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    font-size: 13.5px;
    color: var(--text-muted);
    margin: 8px 0;
}
.profile-extra a { color: var(--primary); }

.profile-edit-btn {
    margin-top: 10px;
    padding: 6px 14px;
    font-size: 13px;
}

/* 设置页 */
.settings-page { max-width: 640px; margin: 0 auto; }

.settings-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 24px 26px;
    margin-bottom: 20px;
}
.settings-card-title {
    font-size: 15px;
    font-weight: 600;
    margin: 0 0 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
    color: var(--text);
}

.avatar-row {
    display: flex;
    align-items: center;
    gap: 24px;
}
.avatar-preview {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--border);
    background: var(--bg);
}
.avatar-actions { flex: 1; }
.avatar-actions label { cursor: pointer; }
.avatar-tip {
    font-size: 12px;
    color: var(--text-muted);
    margin: 8px 0 0;
}

.form-field { margin-bottom: 18px; }
.form-field label {
    display: block;
    font-size: 13.5px;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text);
}
.form-field input,
.form-field select,
.form-field textarea {
    width: 100%;
    padding: 11px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    font-family: inherit;
    transition: .2s;
    box-sizing: border-box;
}
.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--card-bg);
    box-shadow: 0 0 0 3px var(--primary-light);
}
.form-field input:disabled {
    opacity: .6;
    cursor: not-allowed;
}
.form-field textarea { resize: vertical; min-height: 90px; }

.field-tip {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 5px;
}

.settings-actions {
    display: flex;
    justify-content: flex-end;
    padding-top: 8px;
}
.settings-actions .btn {
    padding: 12px 40px;
    font-size: 14.5px;
}

@media (max-width: 768px) {
    .settings-card { padding: 20px 18px; }
    .avatar-row { gap: 16px; }
    .avatar-preview { width: 72px; height: 72px; }
    .settings-actions { justify-content: stretch; }
    .settings-actions .btn { width: 100%; }
    .profile-extra { gap: 10px; font-size: 13px; }
}
