/* =====================================================
   補教通論壇 forum.tutoring.com.tw
   前台樣式 v1.0
   ===================================================== */

:root {
    /* 主色系 - 沉穩藍 */
    --blue-900: #0F2942;
    --blue-800: #123F66;
    --blue-700: #1B4B7E;
    --blue-600: #2E6DA4;
    --blue-100: #E3EDF7;
    --blue-050: #F2F7FC;

    /* 中性色 */
    --ink:      #16202B;
    --ink-soft: #4A5A6B;
    --ink-mute: #8496A6;
    --line:     #DFE6ED;
    --surface:  #FFFFFF;
    --canvas:   #F5F7FA;

    /* 狀態色 */
    --ok:   #1A7F45;
    --warn: #B26A00;
    --bad:  #B3261E;
    --gold: #C9A227;
    --gold-bg: #FBF6E6;

    /* 尺寸 */
    --wrap: 1120px;
    --radius: 10px;
    --shadow: 0 1px 3px rgba(16,32,48,.06), 0 4px 16px rgba(16,32,48,.05);
    --shadow-up: 0 2px 6px rgba(16,32,48,.09), 0 8px 28px rgba(16,32,48,.09);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    background: var(--canvas);
    color: var(--ink);
    font-family: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", sans-serif;
    font-size: 15px;
    line-height: 1.75;
    letter-spacing: .01em;
}

a { color: var(--blue-600); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; display: block; }

:focus-visible { outline: 2px solid var(--blue-600); outline-offset: 2px; border-radius: 3px; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 16px; }
.serif { font-family: "Noto Serif TC", "Songti TC", serif; }

/* ── 頁首 ────────────────────────────── */
.site-header { background: var(--blue-900); color: #fff; position: sticky; top: 0; z-index: 50; }

.header-bar {
    display: flex; align-items: center; justify-content: space-between;
    gap: 16px; height: 58px;
}

.wordmark {
    display: flex; align-items: baseline; gap: 10px; color: #fff;
    font-family: "Noto Serif TC", "Songti TC", serif;
    font-size: 21px; font-weight: 700; letter-spacing: .06em;
}
.wordmark:hover { text-decoration: none; opacity: .88; }
.wordmark .tagline {
    font-family: "Noto Sans TC", sans-serif; font-size: 12px; font-weight: 400;
    letter-spacing: .1em; color: rgba(255,255,255,.5);
}
@media (max-width: 560px) { .wordmark .tagline { display: none; } }

.btn-submit {
    background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.24);
    color: #fff; padding: 7px 16px; border-radius: 999px;
    font-size: 14px; white-space: nowrap; transition: background .15s;
}
.btn-submit:hover { background: rgba(255,255,255,.2); text-decoration: none; }

/* ── 看板列 ──────────────────────────── */
.board-nav { background: var(--blue-800); border-top: 1px solid rgba(255,255,255,.07); }
.board-nav-inner { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.board-nav-inner::-webkit-scrollbar { display: none; }

.board-link {
    padding: 11px 15px; color: rgba(255,255,255,.7); font-size: 14px;
    white-space: nowrap; border-bottom: 3px solid transparent;
}
.board-link:hover { color: #fff; text-decoration: none; }
.board-link.active { color: #fff; font-weight: 500; border-bottom-color: var(--accent, #fff); }

/* ── 主版面 ──────────────────────────── */
.layout {
    display: grid; grid-template-columns: minmax(0,1fr) 300px;
    gap: 28px; padding: 26px 0 60px; align-items: start;
}
@media (max-width: 900px) {
    .layout { grid-template-columns: 1fr; gap: 22px; }
}

/* ── 區塊標題 ────────────────────────── */
.section-head {
    display: flex; align-items: baseline; justify-content: space-between;
    gap: 12px; margin-bottom: 14px; flex-wrap: wrap;
}
.section-head h1, .section-head h2 {
    font-family: "Noto Serif TC", "Songti TC", serif;
    font-size: 19px; font-weight: 700; margin: 0; letter-spacing: .04em;
}
.section-head .desc { color: var(--ink-mute); font-size: 13px; }

/* ── 文章卡片 ────────────────────────── */
.post-list { display: flex; flex-direction: column; gap: 12px; }

.card {
    display: flex; gap: 16px; background: var(--surface);
    border: 1px solid var(--line); border-left: 4px solid var(--accent, var(--blue-600));
    border-radius: var(--radius); padding: 16px 18px;
    box-shadow: var(--shadow); transition: transform .14s ease, box-shadow .14s ease;
}
.card:hover { transform: translateY(-1px); box-shadow: var(--shadow-up); }

.card-body { flex: 1; min-width: 0; }

.card-eyebrow {
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
    margin-bottom: 5px; font-size: 12.5px; color: var(--ink-mute);
}
.board-chip { color: var(--accent, var(--blue-600)); font-weight: 500; }
.pin-flag {
    background: var(--gold-bg); color: #8A6D12; border-radius: 4px;
    padding: 1px 7px; font-size: 11.5px; font-weight: 500;
}

.card-title {
    font-family: "Noto Serif TC", "Songti TC", serif;
    font-size: 17.5px; font-weight: 700; line-height: 1.5;
    margin: 0 0 6px; letter-spacing: .02em;
}
.card-title a { color: var(--ink); }
.card-title a:hover { color: var(--blue-700); text-decoration: none; }

.card-excerpt {
    color: var(--ink-soft); font-size: 14px; line-height: 1.7; margin: 0 0 9px;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

.card-meta { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12.5px; color: var(--ink-mute); }

.card-thumb {
    flex: 0 0 104px; width: 104px; height: 104px;
    border-radius: 8px; overflow: hidden; background: var(--blue-050);
}
.card-thumb img { width: 100%; height: 100%; object-fit: cover; }

@media (max-width: 520px) {
    .card { padding: 14px; gap: 12px; }
    .card-thumb { flex-basis: 76px; width: 76px; height: 76px; }
    .card-title { font-size: 16px; }
    .card-excerpt { font-size: 13.5px; }
}

/* ── 空狀態 ──────────────────────────── */
.empty {
    background: var(--surface); border: 1px dashed var(--line);
    border-radius: var(--radius); padding: 48px 24px;
    text-align: center; color: var(--ink-soft);
}
.empty strong { display: block; font-size: 16px; color: var(--ink); margin-bottom: 6px; }

/* ── 分頁 ────────────────────────────── */
.pager { display: flex; justify-content: center; gap: 6px; margin-top: 24px; flex-wrap: wrap; }
.pager a, .pager span {
    min-width: 38px; padding: 7px 11px; text-align: center;
    background: var(--surface); border: 1px solid var(--line);
    border-radius: 7px; color: var(--ink-soft); font-size: 14px;
}
.pager a:hover { border-color: var(--blue-600); color: var(--blue-700); text-decoration: none; }
.pager .current { background: var(--blue-700); border-color: var(--blue-700); color: #fff; font-weight: 500; }
.pager .gap { border: none; background: none; }

/* ── 側欄 ────────────────────────────── */
.sidebar { display: flex; flex-direction: column; gap: 16px; position: sticky; top: 84px; }
@media (max-width: 900px) { .sidebar { position: static; } }

.panel {
    background: var(--surface); border: 1px solid var(--line);
    border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow);
}
.panel-title {
    font-family: "Noto Serif TC", "Songti TC", serif;
    font-size: 15px; font-weight: 700; margin: 0 0 10px;
    padding-bottom: 9px; border-bottom: 1px solid var(--line); letter-spacing: .04em;
}
.panel p { margin: 0 0 10px; font-size: 13.5px; color: var(--ink-soft); line-height: 1.7; }
.panel p:last-child { margin-bottom: 0; }

.btn-primary {
    display: block; background: var(--blue-700); color: #fff; text-align: center;
    padding: 10px 16px; border-radius: 8px; font-size: 14.5px; font-weight: 500;
    border: none; width: 100%; cursor: pointer; font-family: inherit; transition: background .15s;
}
.btn-primary:hover { background: var(--blue-900); text-decoration: none; }

.link-list { list-style: none; margin: 0; padding: 0; }
.link-list li { border-bottom: 1px solid var(--line); }
.link-list li:last-child { border-bottom: none; }
.link-list a { display: flex; align-items: center; gap: 8px; padding: 9px 0; font-size: 14px; color: var(--ink-soft); }
.link-list a:hover { color: var(--blue-700); text-decoration: none; }
.link-list .dot { width: 8px; height: 8px; border-radius: 2px; flex: 0 0 8px; background: var(--accent, var(--blue-600)); }
.link-list .count { margin-left: auto; font-size: 12.5px; color: var(--ink-mute); }

/* ── 廣告版位 ────────────────────────── */
.ad-slot { position: relative; }
.ad-label {
    position: absolute; top: 6px; right: 8px; background: rgba(0,0,0,.4);
    color: #fff; font-size: 10px; letter-spacing: .1em;
    padding: 1px 6px; border-radius: 3px; z-index: 2; pointer-events: none;
}
.ad-slot img { border-radius: var(--radius); width: 100%; }
.ad-inline {
    background: var(--surface); border: 1px solid var(--line);
    border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow);
}
.ad-placeholder {
    background: var(--surface); border: 1px dashed var(--line); border-radius: var(--radius);
    padding: 26px 18px; text-align: center; color: var(--ink-mute); font-size: 13px;
}

/* ── 單篇文章 ────────────────────────── */
.article {
    background: var(--surface); border: 1px solid var(--line);
    border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden;
}
.article-head {
    padding: 24px 30px 20px; border-bottom: 1px solid var(--line);
    border-top: 4px solid var(--accent, var(--blue-600));
}
.article-head h1 {
    font-family: "Noto Serif TC", "Songti TC", serif;
    font-size: 26px; font-weight: 700; line-height: 1.5;
    margin: 8px 0 14px; letter-spacing: .02em;
}
.article-meta { display: flex; flex-wrap: wrap; gap: 16px; font-size: 13px; color: var(--ink-mute); }

.article-body { padding: 26px 30px; font-size: 15.5px; line-height: 1.95; }
.article-body p { margin: 0 0 1.2em; }
.article-body p:last-child { margin-bottom: 0; }

.article-images { padding: 0 30px 26px; display: flex; flex-direction: column; gap: 16px; }
.article-images figure { margin: 0; }
.article-images img { border-radius: 8px; width: 100%; }
.article-images figcaption { margin-top: 7px; font-size: 13px; color: var(--ink-mute); text-align: center; }

@media (max-width: 620px) {
    .article-head { padding: 20px 18px 16px; }
    .article-head h1 { font-size: 21px; }
    .article-body { padding: 20px 18px; font-size: 15px; }
    .article-images { padding: 0 18px 20px; }
}

/* ── 留言區 ──────────────────────────── */
.comments { margin-top: 20px; }
.comment {
    background: var(--surface); border: 1px solid var(--line);
    border-radius: var(--radius); padding: 14px 18px; margin-bottom: 10px;
}
.comment-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 5px; }
.comment-author { font-weight: 500; font-size: 14px; }
.comment-time { font-size: 12.5px; color: var(--ink-mute); }
.comment-body { font-size: 14.5px; margin: 0; white-space: pre-wrap; }

.notice-box {
    background: var(--blue-050); border: 1px solid var(--blue-100);
    border-radius: var(--radius); padding: 14px 18px;
    font-size: 13.5px; color: var(--blue-900); line-height: 1.7;
}

/* ── 靜態內容頁 ──────────────────────── */
.doc {
    background: var(--surface); border: 1px solid var(--line);
    border-radius: var(--radius); box-shadow: var(--shadow); padding: 30px 34px;
}
.doc h1 { font-family: "Noto Serif TC","Songti TC",serif; font-size: 23px; margin: 0 0 6px; letter-spacing: .04em; }
.doc h2 {
    font-family: "Noto Serif TC","Songti TC",serif; font-size: 17px;
    margin: 30px 0 10px; padding-top: 22px; border-top: 1px solid var(--line); letter-spacing: .04em;
}
.doc h2:first-of-type { border-top: none; padding-top: 0; margin-top: 20px; }
.doc .lead { color: var(--ink-mute); font-size: 14px; margin: 0 0 8px; }
.doc .text { white-space: pre-wrap; font-size: 14.5px; line-height: 1.9; color: var(--ink-soft); }
@media (max-width: 620px) { .doc { padding: 22px 18px; } }

/* ── 頁尾 ────────────────────────────── */
.site-footer {
    background: var(--blue-900); color: rgba(255,255,255,.6);
    padding: 30px 0 34px; font-size: 13px; line-height: 1.9;
}
.footer-inner { display: flex; flex-wrap: wrap; gap: 20px; justify-content: space-between; }
.footer-brand {
    font-family: "Noto Serif TC","Songti TC",serif; color: #fff;
    font-size: 16px; letter-spacing: .06em; margin-bottom: 4px;
}
.footer-links { display: flex; flex-wrap: wrap; gap: 18px; align-items: flex-start; }
.footer-links a { color: rgba(255,255,255,.7); }
.footer-links a:hover { color: #fff; }
.footer-legal {
    margin-top: 22px; padding-top: 16px;
    border-top: 1px solid rgba(255,255,255,.1);
    font-size: 12px; color: rgba(255,255,255,.42);
}

@media (prefers-reduced-motion: reduce) {
    * { animation: none !important; transition: none !important; }
    .card:hover { transform: none; }
}


/* =====================================================
   會員系統（登入／註冊／忘記密碼／我的投稿）
   ===================================================== */

/* ── 頁首右側的會員區塊 ────────────────── */
.header-right {
    display: flex; align-items: center; gap: 10px;
}

.header-link {
    color: rgba(255,255,255,.78); font-size: 14px; white-space: nowrap;
}
.header-link:hover { color: #fff; text-decoration: none; }

.header-user {
    display: flex; align-items: center; gap: 7px;
    color: #fff; font-size: 14px; white-space: nowrap;
}
.header-user:hover { text-decoration: none; opacity: .85; }

/* 暱稱首字當頭像。省掉上傳頭像那一整套功能，視覺上仍有識別度 */
.header-avatar {
    width: 26px; height: 26px; border-radius: 50%;
    background: rgba(255,255,255,.18); border: 1px solid rgba(255,255,255,.28);
    display: flex; align-items: center; justify-content: center;
    font-size: 13px; font-weight: 500; flex: 0 0 26px;
}

/* 手機上空間不夠，只留頭像與投稿鈕 */
@media (max-width: 560px) {
    .header-right { gap: 8px; }
    .header-name { display: none; }
}
@media (max-width: 400px) {
    .btn-submit { padding: 7px 11px; font-size: 13px; }
}


/* ── 表單頁外框 ────────────────────────── */
.auth-wrap {
    max-width: 460px; margin: 32px auto 48px;
}

.auth-box {
    background: var(--surface); border: 1px solid var(--line);
    border-radius: var(--radius); box-shadow: var(--shadow);
    padding: 30px 28px;
}

.auth-box h1 {
    font-family: "Noto Serif TC", "Songti TC", serif;
    font-size: 22px; margin: 0 0 6px; letter-spacing: .04em;
}

.auth-sub {
    margin: 0 0 22px; font-size: 13.5px; line-height: 1.75; color: var(--ink-mute);
}

.auth-alt {
    margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line);
    font-size: 13.5px; color: var(--ink-soft); text-align: center;
}

@media (max-width: 560px) {
    .auth-wrap { margin: 20px auto 36px; }
    .auth-box { padding: 24px 20px; }
}


/* ── 表單欄位 ──────────────────────────── */
.field { margin-bottom: 16px; }

.field label {
    display: block; font-size: 13.5px; font-weight: 500;
    color: var(--ink-soft); margin-bottom: 6px;
}

.field input[type=text],
.field input[type=email],
.field input[type=password] {
    width: 100%; padding: 11px 13px;
    border: 1px solid var(--line); border-radius: 8px;
    font-size: 16px;  /* 16px 以下 iOS Safari 會自動放大整個頁面 */
    font-family: inherit; color: var(--ink);
    background: #fff; transition: border-color .15s, box-shadow .15s;
}

.field input:focus {
    outline: none; border-color: var(--blue-600);
    box-shadow: 0 0 0 3px rgba(46,109,164,.13);
}

.field-hint {
    margin-top: 6px; font-size: 12.5px; line-height: 1.65; color: var(--ink-mute);
}

/* 驗證碼輸入框：拉開字距，六碼要能一眼看清 */
.code-input {
    letter-spacing: 8px; font-size: 22px !important;
    text-align: center; font-family: "Courier New", Consolas, monospace;
}

.btn-main {
    width: 100%; margin-top: 6px;
    background: var(--blue-700); color: #fff;
    border: 0; border-radius: 8px; padding: 13px 20px;
    font-size: 15.5px; font-weight: 500; font-family: inherit;
    cursor: pointer; transition: background .15s;
}
.btn-main:hover { background: var(--blue-900); }
.btn-main:active { transform: translateY(1px); }


/* ── 訊息方塊 ──────────────────────────── */
.form-err {
    background: #FDF0EF; border: 1px solid #F0C4C1; color: #8F221B;
    border-radius: 8px; padding: 12px 14px; margin-bottom: 18px;
    font-size: 13.5px; line-height: 1.8;
}
.form-err div + div { margin-top: 4px; }

.form-ok {
    background: #EDF7F0; border: 1px solid #B9DEC6; color: #14663A;
    border-radius: 8px; padding: 12px 14px; margin-bottom: 18px;
    font-size: 13.5px; line-height: 1.8;
}


/* ── 我的投稿 ──────────────────────────── */
.my-stats {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px;
    margin-bottom: 18px;
}

.my-stat {
    background: var(--surface); border: 1px solid var(--line);
    border-radius: var(--radius); padding: 14px 10px; text-align: center;
}
.my-stat strong {
    display: block; font-size: 24px; line-height: 1.2; color: var(--blue-700);
}
.my-stat span { font-size: 12.5px; color: var(--ink-mute); }

.my-list { display: flex; flex-direction: column; gap: 12px; }

.my-item {
    background: var(--surface); border: 1px solid var(--line);
    border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow);
}

.my-item-head {
    display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
    font-size: 12.5px; color: var(--ink-mute); margin-bottom: 8px;
}

.my-item-title {
    font-size: 16.5px; font-weight: 500; line-height: 1.55; margin: 0 0 6px;
}
.my-item-title a { color: var(--ink); }
.my-item-title a:hover { color: var(--blue-700); text-decoration: none; }

.my-item-excerpt {
    margin: 0 0 8px; font-size: 13.5px; line-height: 1.7; color: var(--ink-soft);
}

.my-item-note { font-size: 12.5px; color: var(--ink-mute); }

.my-item-reason {
    margin-top: 10px; padding: 11px 13px;
    background: var(--blue-050); border-left: 3px solid var(--warn);
    border-radius: 0 6px 6px 0; font-size: 13.5px; line-height: 1.75;
    color: var(--ink-soft);
}
.my-item-reason strong {
    display: block; font-size: 12.5px; color: var(--warn); margin-bottom: 3px;
}


/* ── 狀態標籤 ──────────────────────────── */
.status-tag {
    display: inline-block; padding: 2px 9px; border-radius: 999px;
    font-size: 12px; font-weight: 500; line-height: 1.7;
}
.status-pending   { background: #FDF3E2; color: var(--warn); }
.status-published { background: #E9F5EE; color: var(--ok); }
.status-rejected  { background: #FBECEB; color: var(--bad); }


/* ── 投稿表單 ──────────────────────────── */
.submit-card {
    background: var(--surface); border: 1px solid var(--line);
    border-radius: var(--radius); box-shadow: var(--shadow);
    padding: 20px 22px; margin-bottom: 14px;
}
.submit-card-h {
    font-size: 15px; font-weight: 700; color: var(--ink);
    margin: 0 0 14px; padding-bottom: 10px; border-bottom: 1px solid var(--line);
}

/* textarea 的字級同樣要 16px：iOS Safari 在 16px 以下會自動放大整個頁面 */
.field textarea {
    width: 100%; min-height: 260px; padding: 12px 13px;
    border: 1px solid var(--line); border-radius: 8px;
    font-size: 16px; line-height: 1.85;
    font-family: inherit; color: var(--ink);
    background: #fff; resize: vertical;
    transition: border-color .15s, box-shadow .15s;
}
.field textarea:focus {
    outline: none; border-color: var(--blue-600);
    box-shadow: 0 0 0 3px rgba(46,109,164,.13);
}

/* 看板選擇：radio 藏起來，整塊標籤都可以點，手機上比小圓點好按太多 */
.board-pick { display: flex; flex-wrap: wrap; gap: 8px; }
.board-pick input { position: absolute; opacity: 0; width: 0; height: 0; }
.board-pick label {
    display: block; margin: 0; cursor: pointer;
    padding: 9px 15px; border-radius: 999px;
    border: 1px solid var(--line); background: #fff;
    font-size: 14px; font-weight: 400; color: var(--ink-soft);
    transition: all .15s;
}
.board-pick label:hover { border-color: var(--blue-600); color: var(--blue-700); }
.board-pick input:checked + label {
    background: var(--blue-700); border-color: var(--blue-700);
    color: #fff; font-weight: 500;
}
.board-pick input:focus-visible + label { box-shadow: 0 0 0 3px rgba(46,109,164,.25); }

/* 選照片區塊 */
.drop {
    display: block; cursor: pointer; text-align: center;
    padding: 26px 16px; border-radius: 10px;
    border: 2px dashed var(--line); background: var(--blue-050);
    transition: border-color .15s, background .15s;
}
.drop:hover, .drop.on { border-color: var(--blue-600); background: #EAF2FA; }
.drop .big { font-size: 15px; font-weight: 500; color: var(--blue-700); margin-bottom: 4px; }
.drop .sm  { font-size: 12.5px; color: var(--ink-mute); }
.drop input[type=file] { display: none; }

.previews { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.preview {
    position: relative; width: 96px; height: 96px;
    border-radius: 8px; overflow: hidden; border: 1px solid var(--line);
}
.preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.preview .rm {
    position: absolute; top: 3px; right: 3px;
    width: 22px; height: 22px; line-height: 20px; padding: 0;
    border: 0; border-radius: 50%; cursor: pointer;
    background: rgba(16,32,48,.66); color: #fff; font-size: 15px;
}
.preview .rm:hover { background: var(--bad); }

.upload-status {
    margin-top: 10px; font-size: 13px; line-height: 1.7; color: var(--ink-soft);
}

.submit-actions {
    display: flex; align-items: center; gap: 14px;
    flex-wrap: wrap; margin-top: 4px;
}
.submit-actions .btn-main { width: auto; min-width: 190px; margin-top: 0; }
.submit-actions .btn-main:disabled { background: var(--ink-mute); cursor: default; }
.submit-cancel { font-size: 13.5px; color: var(--ink-mute); }

/* 退稿說明：出現在修改頁最上方，讓作者一眼看到要改什麼 */
.reject-notice {
    background: #FDF0EF; border: 1px solid #F0C4C1;
    border-left: 3px solid var(--bad);
    border-radius: 8px; padding: 14px 16px; margin-bottom: 16px;
}
.reject-notice strong { display: block; font-size: 14px; color: #8F221B; margin-bottom: 6px; }
.reject-notice p { margin: 0 0 8px; font-size: 14px; line-height: 1.8; color: var(--ink); }
.reject-notice span { font-size: 12.5px; color: var(--ink-mute); }

/* 未登入時的兩顆引導按鈕 */
.guest-cta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.guest-cta .btn-primary { width: auto; }
.btn-ghost-line {
    display: inline-block; padding: 10px 20px; border-radius: 8px;
    border: 1px solid var(--line); background: #fff;
    font-size: 14.5px; color: var(--ink-soft); text-align: center;
}
.btn-ghost-line:hover { border-color: var(--blue-600); color: var(--blue-700); text-decoration: none; }

/* 我的投稿：稿件下方的修改入口 */
.my-item-acts { margin-top: 12px; }
.my-item-btn {
    display: inline-block; padding: 7px 15px; border-radius: 999px;
    border: 1px solid var(--blue-600); background: #fff;
    font-size: 13.5px; color: var(--blue-700);
}
.my-item-btn:hover { background: var(--blue-700); color: #fff; text-decoration: none; }

@media (max-width: 600px) {
    .submit-card { padding: 16px 15px; }
    .field textarea { min-height: 220px; }
    .submit-actions .btn-main { width: 100%; min-width: 0; }
    .submit-cancel { width: 100%; text-align: center; }
    .guest-cta .btn-primary, .btn-ghost-line { width: 100%; }
    .preview { width: 82px; height: 82px; }
}


/* ── 留言 ──────────────────────────────── */
.comment-acts { margin-top: 8px; font-size: 13px; }
.comment-acts a { color: var(--ink-mute); }
.comment-acts a:hover { color: var(--blue-700); }

/* 回覆只做兩層。再往下長，手機上會被縮排推成一條細長的字帶 */
.comment-replies {
    margin: 12px 0 0 0; padding-left: 14px;
    border-left: 2px solid var(--line);
    display: flex; flex-direction: column; gap: 10px;
}
.comment-reply { background: var(--blue-050); border-color: transparent; padding: 12px 14px; }

.comment-box {
    background: var(--surface); border: 1px solid var(--line);
    border-radius: var(--radius); box-shadow: var(--shadow);
    padding: 20px 22px; margin-top: 18px;
}
.comment-box-h { font-size: 15.5px; font-weight: 700; margin: 0 0 4px; color: var(--ink); }
.comment-box-sub { font-size: 13px; color: var(--ink-mute); line-height: 1.7; margin: 0 0 16px; }
.comment-box-foot {
    margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line);
    font-size: 13px; color: var(--ink-mute);
}
.comment-box .btn-main { width: auto; min-width: 190px; }

/* 留言的輸入框比投稿短很多：留言是幾句話，不是一篇文章 */
.comment-textarea { min-height: 130px !important; }

.reply-target {
    background: var(--blue-050); border: 1px solid var(--blue-100);
    border-radius: 8px; padding: 9px 13px; margin-bottom: 14px;
    font-size: 13.5px; color: var(--blue-900);
}
.reply-target a { margin-left: 10px; font-size: 13px; color: var(--ink-mute); }

.comment-cancel-form { margin-top: 12px; }
.comment-cancel {
    background: none; border: 0; padding: 0; cursor: pointer;
    font-family: inherit; font-size: 13px; color: var(--ink-mute);
    text-decoration: underline;
}
.comment-cancel:hover { color: var(--bad); }

@media (max-width: 600px) {
    .comment-box { padding: 16px 15px; }
    .comment-box .btn-main { width: 100%; min-width: 0; }
    .comment-replies { padding-left: 10px; }
}


/* ── 客服對話 ──────────────────────────── */
/* 頁首的未讀紅點。數字直接寫在點裡，比單純一個點更有用 */
.header-support { position: relative; }
.header-dot {
    display: inline-block; min-width: 17px; height: 17px; padding: 0 5px;
    margin-left: 3px; border-radius: 999px;
    background: #E0483C; color: #fff;
    font-size: 11px; line-height: 17px; text-align: center; font-weight: 500;
}

.unread-pill {
    display: inline-block; padding: 1px 8px; border-radius: 999px;
    background: #FBECEB; color: var(--bad);
    font-size: 12px; font-weight: 500;
}

/* 對話列表的一列 */
.thread-item {
    display: block; background: var(--surface);
    border: 1px solid var(--line); border-radius: var(--radius);
    box-shadow: var(--shadow); padding: 14px 16px;
}
.thread-item:hover { border-color: var(--blue-600); text-decoration: none; }
.thread-item .my-item-title { margin: 0; }

/* 對話本身。左右分邊，一眼看得出誰說的 */
.chat { display: flex; flex-direction: column; gap: 14px; }

.msg { display: flex; flex-direction: column; max-width: 82%; }
.msg-me   { align-self: flex-end;   align-items: flex-end; }
.msg-them { align-self: flex-start; align-items: flex-start; }

.msg-who {
    font-size: 12px; color: var(--ink-mute); margin-bottom: 4px;
    display: flex; gap: 8px; align-items: baseline;
}

.msg-bubble {
    border-radius: 12px; padding: 11px 14px;
    font-size: 14.5px; line-height: 1.8;
    border: 1px solid var(--line); background: var(--surface);
}
.msg-me .msg-bubble {
    background: var(--blue-700); border-color: var(--blue-700); color: #fff;
    border-bottom-right-radius: 4px;
}
.msg-them .msg-bubble { background: var(--blue-050); border-bottom-left-radius: 4px; }
.msg-bubble p { margin: 0; }
.msg-bubble p + .msg-img { margin-top: 9px; }

.msg-img {
    display: block; max-width: 220px; width: 100%;
    border-radius: 8px; border: 1px solid rgba(0,0,0,.08);
}

@media (max-width: 600px) {
    .msg { max-width: 90%; }
    .msg-img { max-width: 180px; }
}


/* ── 頁首 logo ─────────────────────────── */
/* .wordmark 原本是 align-items: baseline，那是純文字時的排法；
   加了圖示之後要改成 center，圖與字才會對齊 */
.wordmark { align-items: center; }

.wordmark-logo {
    width: 32px; height: 32px; flex: 0 0 32px;
    display: block; border-radius: 6px;
}

/* 窄螢幕只留圖示。頁首右邊還有客服、登出、我要投稿三個項目，
   站名文字留著會把它們擠到換行 */
@media (max-width: 420px) {
    .wordmark-text { display: none; }
    .wordmark-logo { width: 30px; height: 30px; flex-basis: 30px; }
}
