/* ===== Design Tokens ===== */
:root{
  --bg: #F7F7F4;
  --surface: #FFFFFF;
  --surface-alt: #F0F1ED;
  --border: #E5E4DE;
  --ink: #23261F;
  --ink-muted: #7A7E73;
  --ink-faint: #A8ABA0;
  --accent: #3E8E7E;
  --accent-dark: #2F6F62;
  --accent-soft: #E3F1EC;
  --like: #D9575B;
  --like-soft: #FBEAEA;
  --danger: #C1553F;
  --danger-soft: #F8E9E5;
  --radius-s: 6px;
  --radius-m: 10px;
  --radius-l: 14px;
  --shadow-card: 0 1px 2px rgba(35,38,31,0.05), 0 1px 1px rgba(35,38,31,0.04);
  --shadow-modal: 0 20px 50px rgba(35,38,31,0.18);
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang TC", "Microsoft JhengHei", "Helvetica Neue", sans-serif;
}

html[data-theme="dark"]{
  --bg: #171813;
  --surface: #201F1A;
  --surface-alt: #292822;
  --border: #3A3930;
  --ink: #ECEBE4;
  --ink-muted: #A6A497;
  --ink-faint: #74736A;
  --accent: #4FAF9B;
  --accent-dark: #6FC4B2;
  --accent-soft: #223330;
  --like: #E27B7E;
  --like-soft: #3A2325;
  --danger: #E07857;
  --danger-soft: #3A241C;
  --shadow-card: 0 1px 2px rgba(0,0,0,0.3), 0 1px 1px rgba(0,0,0,0.24);
  --shadow-modal: 0 20px 50px rgba(0,0,0,0.5);
}

html{ transition: background-color .2s ease; }
body{ transition: background-color .2s ease, color .2s ease; }

*{ box-sizing: border-box; }
html,
body{
  min-height:100%;
}
html{
  background: var(--bg);
  overscroll-behavior-y: none;
}
body{
  margin:0;
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}
h1,h2,h3,h4{ margin:0; font-weight:600; }
p{ margin:0; }
button{ font-family: inherit; cursor:pointer; }
input,textarea,select{ font-family: inherit; }

/* ===== Topbar ===== */
.topbar{
  position: sticky; top:0; z-index: 40;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding-top: env(safe-area-inset-top);
}
.topbar-inner{
  max-width: 960px;
  margin: 0 auto;
  padding: 12px max(20px, env(safe-area-inset-right)) 12px max(20px, env(safe-area-inset-left));
  display:flex; align-items:center; gap:20px;
}
.brand{ display:flex; align-items:center; gap:8px; flex-shrink:0; }
.brand-mark{ color: var(--accent); font-size:18px; }
.brand-name{ font-size:17px; font-weight:700; letter-spacing:0.5px; }

.tabs{ display:flex; gap:4px; background: var(--surface-alt); padding:3px; border-radius: 999px; flex-shrink:0; }
.tab-btn{
  border:none; background:transparent; padding:6px 16px; border-radius:999px;
  font-size:14px; color: var(--ink-muted); font-weight:600;
  transition: background .15s, color .15s;
}
.tab-btn.is-active{ background: var(--surface); color: var(--ink); box-shadow: var(--shadow-card); }

.topbar-actions{ display:flex; align-items:center; gap:8px; margin-left:auto; }
.search-input{
  border:1px solid var(--border); background: var(--surface);
  border-radius: 999px; padding:7px 14px; font-size:13px; width:180px;
  color: var(--ink); outline:none;
}
.search-input:focus{ border-color: var(--accent); }

.icon-btn{
  border:1px solid var(--border); background: var(--surface);
  width:32px; height:32px; border-radius:50%;
  display:flex; align-items:center; justify-content:center;
  font-size:14px; color: var(--ink-muted);
}
.icon-btn:hover{ color: var(--ink); border-color: var(--ink-faint); }

.btn{
  border:none; border-radius: 999px; padding:8px 16px; font-size:13px; font-weight:600;
  transition: opacity .15s, background .15s;
}
.btn-primary{ background: var(--accent); color:#fff; }
.btn-primary:hover{ background: var(--accent-dark); }
.btn-outline{ background: var(--surface); border:1px solid var(--border); color: var(--ink); }
.btn-outline:hover{ border-color: var(--accent); color: var(--accent-dark); }
.btn-ghost{ background: transparent; color: var(--ink-muted); }
.btn-ghost:hover{ color: var(--ink); }
.btn-danger{ background: var(--danger-soft); color: var(--danger); }
.btn-danger:hover{ background: var(--danger); color:#fff; }

/* ===== Main layout ===== */
.app-main{ max-width: 720px; margin: 0 auto; padding: 24px 20px 80px; }
.view{ display:none; }
.view.is-active{ display:block; }

/* ===== Feed / Post cards ===== */
.feed{ display:flex; flex-direction:column; gap:14px; }
.feed--compact{ gap:10px; }

/* 將卡片改為 Grid 佈局，讓縮圖靠右，並固定最小高度 */
.post-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-l);
  padding: 16px 18px;
  box-shadow: var(--shadow-card);
  cursor: pointer;
  transition: border-color .15s, transform .1s;
  
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas:
    "author images"
    "title  images"
    "foot   images";
  column-gap: 16px;
  min-height: 110px;
}

.post-card-author-row {
  display: flex; align-items: center; gap: 8px; margin-bottom: 8px;
  grid-area: author;
}

.post-card-avatar{
  width:22px; height:22px; border-radius:50%; flex-shrink:0; overflow:hidden;
  background: var(--accent-soft); color: var(--accent-dark);
  display:flex; align-items:center; justify-content:center; font-size:12px;
}
.post-card-avatar img{ width:100%; height:100%; object-fit:cover; }
.post-card-username{ font-size:12.5px; font-weight:600; color: var(--ink); }
.post-card-time { 
  display: none; 
}

.post-card-title {
  font-size: 15.5px; font-weight: 700; line-height: 1.4;
  grid-area: title;
  align-self: start;
}

.post-card-text {
  display: none;
}

.post-card-cover{
  position: relative; width:76px; height:76px; flex-shrink:0;
  grid-area: images; border-radius: var(--radius-s); overflow:hidden;
  background: var(--surface-alt);
}
.post-card-cover--empty{ width:0; height:0; }
.post-card-cover img{
  width:100%; height:100%; object-fit:cover; display:block;
}
.cover-count-badge{
  position:absolute; right:4px; bottom:4px;
  background: rgba(20,21,17,0.6); color:#fff;
  font-size:10.5px; font-weight:600; line-height:1;
  padding:3px 6px; border-radius:999px;
  display:flex; align-items:center; gap:3px;
}

.post-card-foot {
  display: flex; align-items: center; gap: 16px;
  grid-area: foot;
  margin-top: auto;
}
.stat-pill{ font-size:12.5px; color: var(--ink-muted); display:flex; align-items:center; gap:4px; }
.stat-pill.is-active{ color: var(--like); font-weight:600; }
.stat-pill.is-active.is-fav{ color: #C99A2E; }

.empty-hint{ text-align:center; color: var(--ink-faint); font-size:13.5px; padding: 60px 20px; }

/* ===== Me view ===== */
.profile-card{
  display:flex; align-items:center; gap:14px;
  background: var(--surface); border:1px solid var(--border); border-radius: var(--radius-l);
  padding:16px 18px; margin-bottom:16px; box-shadow: var(--shadow-card);
}
.profile-avatar{
  width:56px; height:56px; border-radius:50%; flex-shrink:0; overflow:hidden;
  background: var(--accent-soft); display:flex; align-items:center; justify-content:center;
  font-size:24px; color: var(--accent-dark);
}
.profile-avatar img{ width:100%; height:100%; object-fit:cover; }
.profile-info{ flex:1; min-width:0; }
.profile-nickname{ font-size:16px; font-weight:700; }
.profile-bio{
  margin-top:3px; font-size:12.5px; color: var(--ink-muted); line-height:1.5;
  display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden;
}
.profile-edit-btn{ flex-shrink:0; }

.me-stats{
  display:grid; grid-template-columns: repeat(4,1fr); gap:10px; margin-bottom:20px;
}
.me-stat-item{
  background: var(--surface); border:1px solid var(--border); border-radius: var(--radius-m);
  padding:14px 8px; text-align:center;
}
.me-stat-num{ font-size:20px; font-weight:700; color: var(--accent-dark); }
.me-stat-label{ font-size:12px; color: var(--ink-muted); margin-top:2px; }

.subtabs{ display:flex; gap:6px; margin-bottom:16px; flex-wrap:wrap; }
.subtab-btn{
  border:1px solid var(--border); background: var(--surface); color: var(--ink-muted);
  padding:6px 14px; border-radius:999px; font-size:13px; font-weight:600;
}
.subtab-btn.is-active{ background: var(--accent-soft); color: var(--accent-dark); border-color: var(--accent-soft); }

/* ===== 收藏分类 ===== */
.fav-category-bar{ display:flex; gap:6px; flex-wrap:wrap; margin-bottom:14px; }
.cat-chip{
  border:1px solid var(--border); background: var(--surface); color: var(--ink-muted);
  padding:5px 12px; border-radius:999px; font-size:12.5px; font-weight:600;
}
.cat-chip.is-active{ background: var(--accent); color:#fff; border-color: var(--accent); }

.fav-item{ display:flex; flex-direction:column; }
.fav-item-catbar{
  display:flex; align-items:center; justify-content:space-between; gap:8px;
  margin-top:-6px; padding:8px 14px; background: var(--surface-alt);
  border:1px solid var(--border); border-top:none;
  border-radius: 0 0 var(--radius-l) var(--radius-l); font-size:12px;
}
.fav-cat-badge{ color: var(--ink-muted); font-weight:600; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.fav-cat-change-btn{ border:none; background:transparent; color: var(--accent-dark); font-weight:600; font-size:12px; flex-shrink:0; }
.fav-cat-change-btn:hover{ text-decoration: underline; }

.category-choice-list{ display:flex; flex-direction:column; gap:6px; max-height:280px; overflow-y:auto; }
.category-choice-item{
  display:flex; align-items:center; justify-content:space-between; gap:10px;
  padding:10px 12px; border:1px solid var(--border); border-radius: var(--radius-s);
  font-size:13.5px; color: var(--ink);
}
.category-choice-item:hover{ border-color: var(--ink-faint); }
.category-choice-item.is-selected{ background: var(--accent-soft); color: var(--accent-dark); border-color: var(--accent); font-weight:600; }
.category-choice-item .cat-name{ flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; cursor:pointer; }
.cat-del-btn{ border:none; background:transparent; color: var(--ink-faint); font-size:12px; flex-shrink:0; }
.cat-del-btn:hover{ color: var(--danger); }
.category-add-row{ display:flex; gap:8px; margin-top:12px; }
.category-add-row .text-input{ flex:1; }

/* ===== Char / persona ===== */
.persona-block{
  margin-top:16px; background: var(--surface); border:1px solid var(--border);
  border-radius: var(--radius-l); padding:14px 16px; box-shadow: var(--shadow-card);
}
.persona-block h4{ font-size:13px; color: var(--ink-muted); margin-bottom:6px; }
.persona-text{ font-size:13.5px; line-height:1.7; color: var(--ink); white-space:pre-wrap; }

/* ===== NPC 列表 ===== */
.npc-toolbar{ display:flex; gap:8px; flex-wrap:wrap; margin-bottom:14px; }
.npc-list{ display:flex; flex-direction:column; gap:10px; }
.npc-card{
  display:flex; align-items:center; gap:12px;
  background: var(--surface); border:1px solid var(--border); border-radius: var(--radius-l);
  padding:12px 14px; box-shadow: var(--shadow-card);
}
.npc-avatar{
  width:44px; height:44px; border-radius:50%; flex-shrink:0; overflow:hidden;
  background: var(--accent-soft); color: var(--accent-dark);
  display:flex; align-items:center; justify-content:center; font-size:19px;
}
.npc-avatar img{ width:100%; height:100%; object-fit:cover; }
.npc-info{ flex:1; min-width:0; }
.npc-name{ font-size:14px; font-weight:700; }
.npc-bio{
  margin-top:2px; font-size:12px; color: var(--ink-muted);
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
}
.npc-actions{ display:flex; gap:6px; flex-shrink:0; }

/* ===== 邀请 NPC 评论 ===== */
.npc-pick-list{ display:flex; flex-direction:column; gap:6px; max-height:320px; overflow-y:auto; }
.npc-pick-item{
  display:flex; align-items:center; gap:10px; width:100%;
  border:1px solid var(--border); background: var(--surface); border-radius: var(--radius-s);
  padding:9px 12px; font-size:13.5px; color: var(--ink); text-align:left;
}
.npc-pick-item:hover{ border-color: var(--accent); background: var(--accent-soft); }
.npc-pick-item:disabled{ opacity:0.5; cursor:default; }
.npc-pick-avatar{
  width:26px; height:26px; border-radius:50%; overflow:hidden; flex-shrink:0;
  background: var(--accent-soft); color: var(--accent-dark);
  display:flex; align-items:center; justify-content:center; font-size:13px;
}
.npc-pick-avatar img{ width:100%; height:100%; object-fit:cover; }
.npc-pick-name{ font-weight:600; }

.activity-list{ list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:2px; }
.activity-item{
  display:flex; gap:10px; padding:12px 4px; border-bottom:1px solid var(--border); font-size:13.5px;
}
.activity-item:last-child{ border-bottom:none; }
.activity-icon{ flex-shrink:0; width:22px; height:22px; border-radius:50%; background:var(--accent-soft); color:var(--accent-dark);
  display:flex; align-items:center; justify-content:center; font-size:12px; }
.activity-text{ color: var(--ink); }
.activity-text b{ font-weight:600; }
.activity-time{ margin-left:auto; color: var(--ink-faint); font-size:12px; white-space:nowrap; flex-shrink:0; }

/* ===== Modal ===== */
.modal-mask{
  position: fixed; inset:0; background: rgba(35,38,31,0.45);
  display:flex; align-items:center; justify-content:center; z-index:100; padding:20px;
}
.modal-mask[hidden]{ display:none; }
.modal{
  background: var(--surface); border-radius: var(--radius-l); box-shadow: var(--shadow-modal);
  width: 100%; max-height: 88vh; display:flex; flex-direction:column;
}
.modal--form{ max-width: 520px; }
.modal--detail{ max-width: 600px; }
.modal-head{
  display:flex; align-items:center; justify-content:space-between; padding: 16px 20px;
  border-bottom: 1px solid var(--border); flex-shrink:0;
}
.modal-body{ padding: 18px 20px; overflow-y:auto; }
.modal-foot{ padding: 14px 20px; border-top:1px solid var(--border); display:flex; justify-content:flex-end; gap:8px; flex-shrink:0; }

.field-label{ display:block; font-size:12.5px; font-weight:600; color: var(--ink-muted); margin: 14px 0 6px; }
.field-label:first-child{ margin-top:0; }
.text-input, .textarea-input{
  width:100%; border:1px solid var(--border); border-radius: var(--radius-s); padding:9px 12px;
  font-size:14px; color: var(--ink); outline:none; background: var(--surface);
}
.text-input:focus, .textarea-input:focus{ border-color: var(--accent); }
.textarea-input{ resize: vertical; line-height:1.6; }

.uploader{ display:flex; align-items:center; gap:10px; flex-wrap:wrap; }
.uploader-hint{ font-size:12px; color: var(--ink-faint); }

.image-preview-grid{ margin-top:10px; display:grid; grid-template-columns: repeat(4,1fr); gap:8px; }
.preview-thumb{
  position:relative; aspect-ratio:1/1; border-radius: var(--radius-s); overflow:hidden;
  background: var(--surface-alt); transition: opacity .12s, outline-color .12s;
}
.preview-thumb img{ width:100%; height:100%; object-fit:cover; display:block; pointer-events:none; }
.preview-thumb .remove-thumb{
  position:absolute; top:3px; right:3px; width:20px; height:20px; border-radius:50%;
  background: rgba(0,0,0,0.55); color:#fff; border:none; font-size:11px; display:flex; align-items:center; justify-content:center;
  z-index:3;
}
.preview-thumb .drag-handle{
  position:absolute; top:3px; left:3px; width:22px; height:22px; border-radius:50%;
  background: rgba(0,0,0,0.5); color:#fff; font-size:13px;
  display:flex; align-items:center; justify-content:center;
  cursor: grab; touch-action:none; z-index:3; user-select:none;
}
.preview-thumb .cover-badge{
  position:absolute; left:3px; bottom:3px; z-index:3;
  background: var(--accent); color:#fff; font-size:10px; font-weight:700;
  padding:2px 7px; border-radius:999px; pointer-events:none;
}
.preview-thumb.is-dragging{ opacity:0.4; }
.preview-thumb.drag-over{ outline:2px solid var(--accent); outline-offset:-2px; }
.preview-hint{ margin-top:8px; font-size:11.5px; color: var(--ink-faint); }
.compress-progress{ margin-top:8px; font-size:12px; color: var(--ink-muted); }

.avatar-uploader{ display:flex; align-items:center; gap:14px; }
.avatar-preview{
  width:64px; height:64px; border-radius:50%; overflow:hidden; flex-shrink:0;
  background: var(--accent-soft); display:flex; align-items:center; justify-content:center;
  font-size:26px; color: var(--accent-dark);
}
.avatar-preview img{ width:100%; height:100%; object-fit:cover; }
.avatar-uploader-actions{ display:flex; flex-direction:column; gap:6px; }
.avatar-url-row{ display:flex; gap:8px; margin-top:10px; }
.avatar-url-row .text-input{ flex:1; }

.data-size-info{ font-size:12.5px; color: var(--accent-dark); margin-bottom:10px; }

/* Detail modal */
.detail-meta{ font-size:12.5px; color: var(--ink-faint); }
.detail-text{ margin-top:10px; font-size:14.5px; line-height:1.7; color: var(--ink); white-space:pre-wrap; }
.detail-image-grid{
  margin-top:14px; display:grid; grid-template-columns: repeat(3, 1fr); gap:6px;
}
.detail-image-grid.is-single{
  grid-template-columns: minmax(120px, 45%);
}
.detail-thumb{
  position:relative; aspect-ratio:1/1; border-radius: var(--radius-s); overflow:hidden;
  background: var(--surface-alt); border:none; padding:0; cursor:zoom-in; display:block;
}
.detail-thumb img{ width:100%; height:100%; object-fit:cover; display:block; }
.detail-thumb--more::after{
  content: attr(data-more);
  position:absolute; inset:0; background: rgba(20,21,17,0.55); color:#fff;
  display:flex; align-items:center; justify-content:center; font-size:16px; font-weight:700;
}
.expand-btn{
  display:block; width:100%; margin-top:10px; padding:9px;
  border:1px dashed var(--border); border-radius: var(--radius-m);
  background: var(--surface-alt); color: var(--accent-dark);
  font-size:13px; font-weight:600; text-align:center;
}
.expand-btn:hover{ border-color: var(--accent); background: var(--accent-soft); }

.detail-actions{ display:flex; gap:8px; margin-top:16px; flex-wrap:wrap; }
.action-btn{
  border:1px solid var(--border); background: var(--surface); border-radius:999px;
  padding:7px 14px; font-size:13px; color: var(--ink-muted); font-weight:600;
  display:flex; align-items:center; gap:5px;
}
.action-btn:hover{ border-color: var(--ink-faint); }
.action-btn.is-active{ background: var(--like-soft); color: var(--like); border-color: var(--like-soft); }
.action-btn.is-active.is-fav{ background:#FCF3DD; color:#B5872A; border-color:#FCF3DD; }
.action-btn--danger{ margin-left:auto; color: var(--danger); }
.action-btn--danger:hover{ background: var(--danger-soft); border-color: var(--danger-soft); }

.comments-block{ margin-top:22px; border-top:1px solid var(--border); padding-top:16px; }
.comments-block h4{ font-size:14px; margin-bottom:10px; }
.comment-list{ list-style:none; margin:0 0 10px; padding:0; display:flex; flex-direction:column; gap:10px; }
.comment-item{ font-size:13.5px; background: var(--surface-alt); border-radius: var(--radius-s); padding:9px 12px; }
.comment-author-row{ display:flex; align-items:center; gap:6px; margin-bottom:3px; }
.comment-avatar{
  width:18px; height:18px; border-radius:50%; overflow:hidden; flex-shrink:0;
  background: var(--accent-soft); color: var(--accent-dark);
  display:flex; align-items:center; justify-content:center; font-size:10px;
}
.comment-avatar img{ width:100%; height:100%; object-fit:cover; }
.comment-author{ font-size:12.5px; font-weight:700; color: var(--ink); }
.npc-tag{
  margin-left:4px; font-size:9.5px; font-weight:700; color: var(--accent-dark);
  background: var(--accent-soft); padding:1px 6px; border-radius:999px; vertical-align:1px;
}
.comment-text{ line-height:1.6; white-space:pre-wrap; }
.comment-meta-row{ display:flex; align-items:center; gap:12px; margin-top:4px; }
.comment-time{ font-size:11.5px; color: var(--ink-faint); }
.comment-reply-btn{ border:none; background:transparent; padding:0; color: var(--accent-dark); font-size:12px; font-weight:600; }
.comment-reply-btn:hover{ text-decoration: underline; }

.reply-list{ list-style:none; margin:8px 0 0; padding-left:14px; border-left:2px solid var(--border); display:flex; flex-direction:column; gap:8px; }
.comment-item--reply{ background: var(--surface); border:1px solid var(--border); padding:8px 10px; }

.reply-target-bar{
  display:flex; align-items:center; gap:6px; margin-bottom:8px;
  background: var(--accent-soft); color: var(--accent-dark);
  border-radius: var(--radius-s); padding:6px 10px; font-size:12.5px;
}
.reply-target-bar[hidden]{ display:none; }
.reply-target-bar span{ font-weight:600; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.reply-target-bar button{ margin-left:auto; border:none; background:transparent; color: var(--accent-dark); font-weight:700; font-size:13px; }

.comment-input-row{ display:flex; gap:8px; }
.comment-input-row .text-input{ flex:1; }

/* Lightbox */
.modal-mask--lightbox{
  background: rgba(20,21,17,0.92); padding:0;
  flex-direction: column; align-items:stretch; justify-content:stretch;
}
.lightbox-stage{
  flex:1; display:flex; align-items:center; justify-content:center;
  min-height:0; padding: max(20px, env(safe-area-inset-top)) 16px 10px;
}
.modal-mask--lightbox img{ max-width:92vw; max-height:100%; border-radius:6px; object-fit:contain; touch-action: pan-y; }
.lightbox-close{
  position:absolute; top: max(16px, env(safe-area-inset-top)); right: max(16px, env(safe-area-inset-right));
  background: rgba(255,255,255,0.15); color:#fff; border-color: transparent; z-index:2;
}
.lightbox-toolbar{
  flex-shrink:0; display:flex; align-items:center; justify-content:center; gap:14px;
  padding: 10px 16px calc(14px + env(safe-area-inset-bottom));
}
.lightbox-nav{
  width:40px; height:40px; border-radius:50%;
  background: rgba(255,255,255,0.15); color:#fff; border:none;
  font-size:22px; line-height:1; display:flex; align-items:center; justify-content:center;
}
.lightbox-nav:hover{ background: rgba(255,255,255,0.28); }
.lightbox-counter{
  color:#fff; font-size:12.5px; font-weight:600;
  background: rgba(255,255,255,0.12); padding:6px 12px; border-radius:999px;
  min-width:44px; text-align:center;
}
.lightbox-download{
  display:flex; align-items:center; gap:5px;
  background: rgba(255,255,255,0.15); color:#fff; border:none;
  font-size:13px; font-weight:600; padding:9px 16px; border-radius:999px;
}
.lightbox-download:hover{ background: rgba(255,255,255,0.28); }

/* Settings */
.settings-block{ padding: 14px 0; border-bottom:1px solid var(--border); }
.settings-block:first-child{ padding-top:0; }
.settings-block:last-child{ border-bottom:none; padding-bottom:0; }
.settings-block h4{ font-size:14px; margin-bottom:6px; }
.settings-desc{ font-size:12.5px; color: var(--ink-muted); line-height:1.6; margin-bottom:10px; }
.settings-status{ font-size:12px; color: var(--accent-dark); margin-top:8px; min-height:14px; }
.settings-block--danger .settings-desc{ color: var(--danger); }
.checkbox-row{ display:flex; align-items:center; gap:7px; font-size:13px; color: var(--ink-muted); margin-bottom:10px; }
.settings-row{ display:flex; gap:8px; flex-wrap:wrap; margin-top:4px; }
.settings-divider{ height:1px; background: var(--border); margin:16px 0; }
.settings-version{ font-size:12.5px; color: var(--ink-muted); margin-bottom:10px; }

/* Toast */
.toast{
  position: fixed; bottom: 78px; left:50%; transform: translateX(-50%);
  background: #23261F; color:#fff; padding:10px 18px; border-radius:999px;
  font-size:13px; z-index: 200; box-shadow: var(--shadow-modal);
}

/* ===== 底部 Dock 導覽列 ===== */
.dock{
  position:fixed;
  left:0;
  right:0;
  bottom:0;
  z-index:50;

  background:var(--surface);
  border-top:1px solid var(--border);

  display:flex;
  justify-content:center;
  gap:8px;

  padding:6px 16px;
}
.dock-btn{
  flex:1; max-width:180px; border:none; background:transparent;
  display:flex; flex-direction:column; align-items:center; gap:2px;
  padding:6px 10px; border-radius: var(--radius-m);
  color: var(--ink-faint); font-size:11px; font-weight:600;
  transition: background .15s, color .15s;
}
.dock-btn .dock-icon{ font-size:19px; line-height:1; }
.dock-btn.is-active{ color: var(--accent-dark); background: var(--accent-soft); }

/* ===== Responsive ===== */
@media (max-width:640px){
  .topbar-inner{
    flex-wrap:wrap;
    gap:10px;
  }

  .search-input{
    width:120px;
  }

  .me-stats{
    grid-template-columns:repeat(2,1fr);
  }

  .app-main{
    padding:16px 12px 80px;
  }
}