:root {
  --bg: #f7f7f8;
  --bg-elev: #ffffff;
  --text: #1c1c22;
  --text-muted: #7a7a86;
  --border: #e7e7ec;
  --accent: #4f46e5;
  --accent-soft: #eef2ff;
  --danger: #dc2626;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(16, 16, 32, 0.06), 0 4px 16px rgba(16, 16, 32, 0.06);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
/* 弹窗层级：资料页在详情页之上，裁剪在资料页之上 */
#profileModal { z-index: 120; }
#cropModal { z-index: 130; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
}
a { color: var(--accent); text-decoration: none; }
code { background: var(--accent-soft); padding: 1px 5px; border-radius: 4px; font-size: 12px; }
.muted { color: var(--text-muted); }

/* 顶栏 */
.topbar { position: sticky; top: 0; z-index: 50; background: rgba(255,255,255,0.9); backdrop-filter: blur(8px); border-bottom: 1px solid var(--border); }
.topbar-inner { max-width: 1200px; margin: 0 auto; padding: 12px 20px; display: flex; align-items: center; gap: 16px; }
.brand { font-size: 18px; font-weight: 700; letter-spacing: -0.02em; display: flex; align-items: baseline; gap: 8px; cursor: pointer; }
.brand-sub { font-size: 12px; font-weight: 500; color: var(--accent); background: var(--accent-soft); padding: 2px 8px; border-radius: 20px; }
.searchbox { flex: 1; max-width: 360px; }
.searchbox input { width: 100%; padding: 8px 14px; border: 1px solid var(--border); border-radius: 20px; background: var(--bg); outline: none; transition: border .15s, box-shadow .15s; }
.searchbox input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); background: #fff; }
.nav { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.userchip { display: flex; align-items: center; gap: 8px; font-weight: 600; }

/* 按钮 */
.btn { border: 1px solid var(--border); background: #fff; color: var(--text); padding: 8px 14px; border-radius: 8px; cursor: pointer; font-size: 13px; transition: all .15s; }
.btn:hover { border-color: var(--accent); color: var(--accent); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: #4338ca; color: #fff; }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--accent-soft); }
.btn.small { padding: 5px 10px; font-size: 12px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* 内容 */
.content { max-width: 1200px; margin: 0 auto; padding: 20px; }
.toolbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; flex-wrap: wrap; gap: 10px; }
.filters { display: flex; gap: 8px; }
.stats { color: var(--text-muted); font-size: 12px; }

.chip { border: 1px solid var(--border); background: #fff; color: var(--text); padding: 6px 14px; border-radius: 20px; cursor: pointer; font-size: 13px; }
.chip.active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* 漫画网格 */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 18px; }
.card { background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; cursor: pointer; box-shadow: var(--shadow); transition: transform .15s, box-shadow .15s; }
.card:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(16,16,32,.12); }
.card-cover { aspect-ratio: 3/4; background: var(--bg); position: relative; overflow: hidden; }
.card-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card-cover .placeholder { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-size: 30px; color: var(--text-muted); background: linear-gradient(135deg,#f3f3f6,#e8e8ee); }
.card-cover .badge { position: absolute; top: 8px; left: 8px; background: rgba(0,0,0,.55); color: #fff; font-size: 10px; padding: 2px 7px; border-radius: 6px; text-transform: uppercase; }
.card-cover .status { position: absolute; inset: 0; background: rgba(255,255,255,.7); display: flex; align-items: center; justify-content: center; color: var(--text); font-size: 13px; }
.card-body { padding: 10px 12px; }
.card-title { font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-sub { color: var(--text-muted); font-size: 11px; margin-top: 2px; }

.empty { text-align: center; padding: 80px 20px; color: var(--text); }
.empty-icon { font-size: 44px; margin-bottom: 12px; }
.empty .muted { font-size: 13px; }

/* 弹窗 */
.modal-backdrop { position: fixed; inset: 0; background: rgba(20,20,30,.45); display: flex; align-items: center; justify-content: center; z-index: 100; padding: 20px; }
.modal { background: #fff; border-radius: 16px; padding: 26px; width: 100%; max-width: 400px; box-shadow: 0 20px 60px rgba(0,0,0,.2); }
.modal h2 { margin: 0 0 16px; font-size: 18px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.modal-head h2 { margin: 0; }
.modal-close { border: none; background: none; font-size: 22px; line-height: 1; color: var(--text-muted); cursor: pointer; padding: 0 6px; }
.modal-close:hover { color: var(--text); }
.modal form label { display: block; margin-bottom: 12px; font-size: 13px; color: var(--text-muted); }
.modal form input { width: 100%; margin-top: 6px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; font-size: 14px; outline: none; }
.modal form input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.modal-actions { display: flex; justify-content: space-between; align-items: center; margin-top: 18px; gap: 10px; }
.form-error { color: var(--danger); font-size: 12px; min-height: 16px; margin: 4px 0; }

/* 上传 */
.dropzone { border: 2px dashed var(--border); border-radius: 12px; padding: 34px 16px; text-align: center; cursor: pointer; color: var(--text-muted); transition: all .15s; }
.dropzone:hover, .dropzone.drag { border-color: var(--accent); background: var(--accent-soft); }
.upload-list { max-height: 180px; overflow: auto; margin-top: 12px; }
.upload-item { display: flex; justify-content: space-between; align-items: center; padding: 8px 4px; border-bottom: 1px solid var(--border); font-size: 13px; }
.upload-item .rm { color: var(--danger); cursor: pointer; }

/* 阅读器 */
.reader { position: fixed; inset: 0; background: #17171c; z-index: 90; display: flex; flex-direction: column; }
.reader-top { display: flex; align-items: center; gap: 14px; padding: 10px 16px; background: rgba(23,23,28,.95); color: #fff; }
.reader-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; min-width: 0; }
.reader-meta { font-size: 12px; color: #bbb; white-space: nowrap; }
.reader .btn.ghost { color: #ddd; }
.reader .btn.ghost:hover { background: rgba(255,255,255,.12); color: #fff; }
.reader-progress { height: 3px; background: #2a2a32; }
.reader-progress-bar { height: 100%; background: var(--accent); width: 0; transition: width .1s; }
.reader-stage { flex: 1; overflow-y: auto; text-align: center; padding: 8px 0 40px; }
.reader-stage img { display: block; margin: 0 auto 4px; max-width: 100%; min-height: 40px; background: #232329; }
.reader-stage .textpage { max-width: 720px; margin: 0 auto 20px; padding: 24px; background: #fbfbfc; color: #1c1c22; text-align: left; white-space: pre-wrap; border-radius: 8px; line-height: 1.9; }
.reader-stage .page-loading { color: #777; padding: 30px; font-size: 13px; }

/* 阅读模式选择 + 翻页 */
.reader-modes { display: flex; gap: 6px; }
.reader-modes .chip { border-color: rgba(255,255,255,.25); background: transparent; color: #ccc; padding: 4px 12px; font-size: 12px; }
.reader-modes .chip.active { background: var(--accent); border-color: var(--accent); color: #fff; }

.reader-stage.single, .reader-stage.double { display: flex; align-items: center; justify-content: center; overflow: hidden; padding: 0; }
.reader-stage.single { perspective: 2200px; }
.book { position: relative; aspect-ratio: 3 / 4; height: min(90vh, calc(86vw * 4 / 3)); transform-style: preserve-3d; }
.book-page { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.book-page img { width: 100%; height: 100%; object-fit: contain; display: block; user-select: none; }
.book-page .textpage { position: absolute; inset: 0; overflow: auto; margin: 0; border-radius: 8px; }
.book-page.front { transform-origin: left center; transition: transform .5s ease; z-index: 2; }
.book-page.under { z-index: 1; }
.book-page.front.no-anim { transition: none !important; }
.book.flip .front { transform: rotateY(-180deg); }
.book.flip-back .front { transform: rotateY(180deg); }

.spread-track { display: flex; align-items: center; width: 100%; height: 100%; transition: transform .45s ease; }
.spread { flex: 0 0 100%; display: flex; justify-content: center; align-items: center; gap: 4px; height: 100%; padding: 8px; box-sizing: border-box; }
.spread img { max-width: 49.5%; max-height: 96%; object-fit: contain; user-select: none; }
.spread .textpage { max-width: 49.5%; max-height: 96%; overflow: auto; text-align: left; white-space: pre-wrap; background: #fbfbfc; color: #1c1c22; padding: 16px; border-radius: 8px; line-height: 1.8; }

/* 后台 */
.admin-backdrop { z-index: 110; }
.admin-panel { background: #fff; border-radius: 16px; width: 100%; max-width: 900px; max-height: 86vh; display: flex; flex-direction: column; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.admin-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--border); }
.admin-head h2 { margin: 0; font-size: 18px; }
.admin-tabs { display: flex; gap: 8px; padding: 12px 22px; border-bottom: 1px solid var(--border); }
.admin-body { padding: 18px 22px; overflow: auto; }
.admin-body table { width: 100%; border-collapse: collapse; font-size: 13px; }
.admin-body th, .admin-body td { text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--border); }
.admin-body th { color: var(--text-muted); font-weight: 600; }
.admin-body .row-actions { display: flex; gap: 6px; }
.stat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 14px; }
.stat-card { background: var(--bg); border: 1px solid var(--border); border-radius: 12px; padding: 16px; }
.stat-card .num { font-size: 26px; font-weight: 700; }
.stat-card .label { color: var(--text-muted); font-size: 12px; }

/* toast */
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: #1c1c22; color: #fff; padding: 10px 18px; border-radius: 10px; font-size: 13px; z-index: 200; box-shadow: 0 8px 24px rgba(0,0,0,.3); }

/* 头部头像 + 个人资料 */
.chip-avatar { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; border: 1px solid var(--border); background: var(--accent-soft); }
.userchip { cursor: pointer; }

.profile-modal { max-width: 460px; padding: 0; position: relative; overflow: hidden; }
.modal-x { position: absolute; top: 10px; right: 10px; z-index: 3; background: rgba(0,0,0,.28); color: #fff; border: none; font-size: 18px; line-height: 1; padding: 4px 9px; border-radius: 50%; }
.modal-x:hover { background: rgba(0,0,0,.5); color: #fff; }
.profile-banner { height: 128px; background: linear-gradient(135deg, #4f46e5, #7c3aed); background-size: cover; background-position: center; position: relative; }
.profile-banner-btn { position: absolute; right: 10px; bottom: 10px; background: rgba(0,0,0,.35); color: #fff; border-color: transparent; }
.profile-banner-btn:hover { background: rgba(0,0,0,.55); color: #fff; }
.profile-content { padding: 0 22px 22px; }
.profile-avatar { width: 88px; height: 88px; margin: -44px auto 0; border-radius: 50%; border: 3px solid #fff; background: var(--bg); overflow: hidden; position: relative; box-shadow: 0 2px 10px rgba(0,0,0,.18); }
.profile-avatar img { width: 100%; height: 100%; object-fit: cover; }
.profile-avatar-edit { position: absolute; bottom: 0; left: 0; right: 0; background: rgba(0,0,0,.45); color: #fff; border: none; font-size: 12px; cursor: pointer; padding: 2px 0; }
.profile-name { text-align: center; margin: 12px 0 16px; font-weight: 700; font-size: 16px; }
.role-badge { font-size: 11px; font-weight: 600; color: var(--accent); background: var(--accent-soft); padding: 2px 8px; border-radius: 10px; margin-left: 6px; vertical-align: 2px; }
.profile-label { display: block; font-size: 12px; color: var(--text-muted); margin-bottom: 6px; }
.profile-modal textarea { width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; font-size: 14px; resize: vertical; font-family: inherit; box-sizing: border-box; }
.profile-actions { display: flex; gap: 10px; margin-top: 14px; justify-content: flex-end; }

/* 后台建用户/设置 */
.create-user { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.create-user input, .create-user select { padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; font-size: 13px; }
.settings-row { display: flex; gap: 10px; margin: 12px 0; }
.settings-row input { flex: 1; padding: 9px 12px; border: 1px solid var(--border); border-radius: 8px; font-size: 14px; }

/* 图片裁剪 */
.crop-modal { max-width: 440px; max-height: 92vh; overflow-y: auto; }
.crop-stage { position: relative; overflow: hidden; background: #1c1c22; border-radius: 10px; touch-action: none; }
.crop-stage.square { aspect-ratio: 1 / 1; max-width: 60vh; }
.crop-stage.wide { aspect-ratio: 16 / 5; }
.crop-stage img { position: absolute; top: 0; left: 0; transform-origin: 0 0; max-width: none; user-select: none; -webkit-user-drag: none; }
.crop-controls { display: flex; align-items: center; gap: 10px; margin: 14px 0 4px; }
.crop-controls input[type=range] { flex: 1; }
.crop-hint { font-size: 11px; }

/* 漫画详情 */
.comic-modal { max-width: 520px; max-height: 92vh; overflow-y: auto; }
.comic-head { display: flex; gap: 16px; }
.comic-cover { flex: 0 0 120px; width: 120px; height: 160px; border-radius: 10px; overflow: hidden; background: var(--bg); }
.comic-cover img { width: 100%; height: 100%; object-fit: cover; }
.comic-info { flex: 1; min-width: 0; }
.comic-info h2 { margin: 0 0 8px; font-size: 17px; word-break: break-word; }
.comic-tags { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.src-tag { font-size: 11px; padding: 2px 9px; border-radius: 10px; font-weight: 600; }
.src-local { background: var(--accent-soft); color: var(--accent); }
.src-user { background: #ecfdf5; color: #059669; }
.uploader-card { display: flex; align-items: center; gap: 10px; padding: 8px 10px; background: var(--bg); border-radius: 10px; margin-bottom: 12px; }
.uploader-avatar { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; cursor: pointer; background: var(--accent-soft); flex-shrink: 0; }
.uploader-info { flex: 1; min-width: 0; }
.uploader-name { font-weight: 600; font-size: 13px; cursor: pointer; }
.uploader-name:hover { color: var(--accent); }
.uploader-time { font-size: 11px; color: var(--text-muted); }
.comments-box { margin-top: 16px; border-top: 1px solid var(--border); padding-top: 14px; }
.comments-box h3 { margin: 0 0 10px; font-size: 15px; }
.comment-list { max-height: 260px; overflow-y: auto; margin-bottom: 10px; }
.comment { display: flex; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--border); align-items: flex-start; }
.comment-avatar { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; flex-shrink: 0; background: var(--accent-soft); cursor: pointer; }
.avatar-empty { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: 13px; flex-shrink: 0; }
.comment-body { flex: 1; min-width: 0; }
.comment-head { display: flex; gap: 8px; align-items: baseline; }
.comment-user { font-weight: 600; font-size: 12px; cursor: pointer; }
.comment-user:hover { color: var(--accent); }
.comment-time { font-size: 10px; color: var(--text-muted); }
.comment-text { font-size: 13px; margin-top: 2px; word-break: break-word; }
.comment-del { border: none; background: none; color: var(--danger); font-size: 11px; cursor: pointer; flex-shrink: 0; }
.comment-input { display: flex; gap: 8px; }
.comment-input input { flex: 1; padding: 9px 12px; border: 1px solid var(--border); border-radius: 8px; font-size: 13px; }

/* 楼中楼回复 */
.comment-ops { display: flex; gap: 14px; margin-top: 4px; align-items: center; }
.comment-reply-btn { border: none; background: none; color: var(--text-muted); font-size: 11px; cursor: pointer; padding: 0; }
.comment-reply-btn:hover { color: var(--accent); }
.comment-children { margin-top: 8px; padding-left: 36px; border-left: 2px solid var(--border); }
.comment-children .comment { border-bottom: none; padding: 6px 0; }
.comment-children .comment-children { padding-left: 32px; }
.reply-to { color: var(--text-muted); font-size: 12px; }
.reply-to b { color: var(--accent); font-weight: 600; }
.reply-hint { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: var(--accent-soft); color: var(--accent); font-size: 12px; padding: 7px 10px; border-radius: 8px; margin-bottom: 8px; }
.reply-cancel { border: none; background: none; color: var(--accent); cursor: pointer; font-size: 12px; }

/* 个人资料点赞/上传列表 */
.profile-like-row { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 6px 0 12px; }
.profile-uploads-title { margin: 14px 0 8px; font-size: 13px; color: var(--text-muted); }
.mini-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(70px, 1fr)); gap: 10px; }
.mini-card { cursor: pointer; }
.mini-cover { aspect-ratio: 3/4; border-radius: 6px; overflow: hidden; background: var(--bg); display: flex; align-items: center; justify-content: center; }
.mini-cover img { width: 100%; height: 100%; object-fit: cover; }
.mini-title { font-size: 11px; margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* 关注新上传标识 */
.follow-badge { position: absolute; top: 8px; right: 8px; background: #f59e0b; color: #fff; font-size: 10px; padding: 2px 7px; border-radius: 6px; font-weight: 600; }

/* 个人主页（整页） */
.profile-page { max-width: 720px; margin: 0 auto; }
.profile-page-banner { height: 170px; border-radius: 12px; background: linear-gradient(135deg, #4f46e5, #7c3aed); background-size: cover; background-position: center; position: relative; }
.profile-page-banner .banner-btn { position: absolute; right: 12px; bottom: 12px; background: rgba(0,0,0,.35); color: #fff; border-color: transparent; }
.profile-page-banner .banner-btn:hover { background: rgba(0,0,0,.55); color: #fff; }
.profile-page-head { display: flex; align-items: flex-end; gap: 16px; margin-top: -58px; padding: 0 20px; }
.profile-page-avatar { width: 110px; height: 110px; border-radius: 50%; border: 4px solid #fff; background: var(--bg); overflow: hidden; position: relative; box-shadow: 0 3px 12px rgba(0,0,0,.2); flex-shrink: 0; }
.profile-page-avatar img { width: 100%; height: 100%; object-fit: cover; }
.profile-page-avatar .edit { position: absolute; bottom: 0; left: 0; right: 0; background: rgba(0,0,0,.45); color: #fff; border: none; font-size: 12px; cursor: pointer; padding: 2px 0; }
.profile-page-info { flex: 1; min-width: 0; padding-bottom: 4px; }
.profile-page-name { font-size: 20px; font-weight: 700; }
.profile-page-sig { color: var(--text-muted); margin: 6px 0; white-space: pre-wrap; font-size: 13px; }
.profile-page-stats { display: flex; gap: 20px; margin: 10px 0; }
.profile-page-stats .stat { text-align: center; cursor: pointer; }
.profile-page-stats .stat .num { font-weight: 700; font-size: 16px; }
.profile-page-stats .stat .label { font-size: 12px; color: var(--text-muted); }
.profile-page-actions { display: flex; gap: 10px; margin-top: 12px; }
.profile-page-section { margin-top: 26px; }
.profile-page-section h4 { margin: 0 0 12px; font-size: 15px; color: var(--text-muted); }
.profile-posts-list { display: flex; flex-direction: column; gap: 8px; }

/* 帖子 */
.posts-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.posts-list { display: flex; flex-direction: column; gap: 12px; }
.post-card { background: var(--bg-elev); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; cursor: pointer; box-shadow: var(--shadow); }
.post-card:hover { border-color: var(--accent); }
.post-card .post-card-title { font-weight: 600; }
.post-card .post-card-meta { display: flex; gap: 10px; align-items: center; margin-top: 6px; font-size: 12px; color: var(--text-muted); }
.post-card .post-card-content { margin-top: 6px; font-size: 13px; white-space: pre-wrap; max-height: 60px; overflow: hidden; }
.post-card .post-thumbs { display: flex; gap: 6px; margin-top: 8px; }
.post-card .post-thumbs img { width: 60px; height: 60px; object-fit: cover; border-radius: 6px; }
.resolved-badge { color: #059669; background: #ecfdf5; font-size: 11px; padding: 1px 8px; border-radius: 8px; }
.open-badge { color: var(--accent); background: var(--accent-soft); font-size: 11px; padding: 1px 8px; border-radius: 8px; }

/* 发帖弹窗 + 帖子详情 */
.post-images { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0; }
.post-images .post-img { position: relative; }
.post-images img { width: 70px; height: 70px; object-fit: cover; border-radius: 8px; }
.post-images .rm { position: absolute; top: -6px; right: -6px; background: var(--danger); color: #fff; border: none; border-radius: 50%; width: 18px; height: 18px; cursor: pointer; font-size: 11px; line-height: 1; }
.post-detail-modal { max-width: 520px; max-height: 88vh; overflow-y: auto; position: relative; }
.post-author { display: flex; align-items: center; gap: 8px; margin: 8px 0; font-size: 13px; }
.post-author img, .post-author .avatar-empty { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.post-author .name { font-weight: 600; cursor: pointer; }
.post-author .name:hover { color: var(--accent); }
.post-status-tag { margin: 8px 0; }
.post-content { font-size: 14px; white-space: pre-wrap; margin: 10px 0; word-break: break-word; }
.post-images-box { display: flex; gap: 8px; flex-wrap: wrap; }
.post-images-box img { max-width: 100%; max-height: 300px; border-radius: 8px; }
.pd-sub { margin: 14px 0 8px; font-size: 13px; color: var(--text-muted); }
.post-comics { display: grid; grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)); gap: 10px; }
.post-actions { display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; }

/* 漫画详情页（整页） */
.comic-detail-page { max-width: 760px; margin: 0 auto; }

/* Hero 头图区 */
.detail-hero { position: relative; overflow: hidden; border-radius: 16px; margin-bottom: 16px; background: linear-gradient(135deg, #4f46e5, #7c3aed); }
.detail-hero-bg { position: absolute; inset: 0; background-size: cover; background-position: center; filter: blur(26px) brightness(0.45) saturate(1.25); transform: scale(1.2); }
.detail-hero-content { position: relative; padding: 18px 22px 22px; }
.detail-back { color: #fff !important; border-color: rgba(255,255,255,.4) !important; }
.detail-back:hover { background: rgba(255,255,255,.18) !important; color: #fff !important; }
.detail-hero-main { display: flex; gap: 22px; align-items: flex-end; margin-top: 16px; }
.detail-cover { flex: 0 0 150px; width: 150px; aspect-ratio: 3/4; border-radius: 12px; overflow: hidden; background: rgba(0,0,0,.25); box-shadow: 0 10px 28px rgba(0,0,0,.35); display: flex; align-items: center; justify-content: center; font-size: 44px; border: 1px solid rgba(255,255,255,.25); }
.detail-cover img { width: 100%; height: 100%; object-fit: cover; }
.detail-info { flex: 1; min-width: 0; }
.detail-title { color: #fff; margin: 0 0 10px; font-size: 22px; word-break: break-word; line-height: 1.3; }
.detail-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.detail-meta .muted { color: rgba(255,255,255,.78); }
.detail-hero .src-tag { background: rgba(255,255,255,.18); }
.detail-hero .src-local { color: #fff; }
.detail-hero .src-user { color: #fff; }
.detail-hero .badge { background: rgba(255,255,255,.18); color: #fff; font-size: 11px; padding: 2px 9px; border-radius: 10px; font-weight: 600; text-transform: uppercase; }
.detail-hero .uploader-card { background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.22); margin-bottom: 14px; }
.detail-hero .uploader-name { color: #fff; }
.detail-hero .uploader-time { color: rgba(255,255,255,.72); }
.detail-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.btn-read { font-size: 15px; padding: 10px 26px; }
.detail-actions .btn.ghost { color: #fff; border-color: rgba(255,255,255,.4); }
.detail-actions .btn.ghost:hover { background: rgba(255,255,255,.16); color: #fff; }

/* 数据统计条 */
.detail-stats { display: flex; background: var(--bg-elev); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow); margin-bottom: 18px; }
.detail-stats .stat { flex: 1; text-align: center; padding: 14px 8px; min-width: 0; }
.detail-stats .stat + .stat { border-left: 1px solid var(--border); }
.detail-stats .num { font-weight: 700; font-size: 16px; color: var(--text); }
.detail-stats .label { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* 更多推荐 */
.detail-section { margin-bottom: 18px; }
.section-title { font-size: 15px; color: var(--text-muted); margin: 0 0 12px; }
.comic-detail-page .comments-box { margin-top: 6px; }

@media (max-width: 640px) {
  html, body { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
  .content { padding: 12px; }
  .topbar-inner { padding: 10px 12px; gap: 8px; flex-wrap: nowrap; }
  .brand { font-size: 16px; }
  .brand-sub { display: none; }
  .nav { gap: 4px; }
  .nav .btn { padding: 6px 9px; font-size: 12px; white-space: nowrap; }
  .userchip #username { display: none; }
  .searchbox { display: none; }
  .toolbar { gap: 8px; }
  .filters { flex-wrap: wrap; }
  .chip { padding: 5px 11px; font-size: 12px; }

  .grid { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 10px; }
  .card-title { font-size: 12px; }
  .card-sub { font-size: 10px; }

  /* 详情页 */
  .detail-hero-content { padding: 14px 16px 18px; }
  .detail-hero-main { flex-direction: column; align-items: flex-start; gap: 14px; }
  .detail-cover { width: 130px; flex: none; }
  .detail-title { font-size: 18px; }
  .detail-stats .stat { padding: 11px 4px; }
  .detail-stats .num { font-size: 14px; }

  /* 弹窗 */
  .modal-backdrop { padding: 12px; }
  .modal { padding: 18px; }
  .modal-actions { flex-wrap: wrap; }
  .admin-panel { max-width: 100%; max-height: 92vh; }
  .profile-modal { max-width: 100%; }

  /* 阅读器 */
  .reader-title { display: none; }
  .reader-modes .chip { padding: 3px 8px; font-size: 11px; }
  .reader-top { padding: 8px 10px; gap: 8px; }

  /* 评论 / 上传 */
  .comment-input { flex-direction: column; }
  .comment-input .btn { width: 100%; }
  .uploader-card { flex-wrap: wrap; }
  .comment-text { word-break: break-word; overflow-wrap: anywhere; }
  .detail-title { overflow-wrap: anywhere; }
}
