/* gbook.css — 留言板頁 */
.gbook-main {
    /* 頂部要先讓出固定頂欄高度（padding 簡寫會蓋掉 .page-content 的 padding-top） */
    padding: calc(var(--topbar-h) + 24px) 20px 60px;
}
.gbook-container {
    max-width: var(--content-max);
    margin: 0 auto;
    padding: 0 16px;
}
.gbook-container .breadcrumb { margin: 0 0 16px; }
/* ===== 页头 ===== */
.gbook-page-hd {
    display: flex;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}
.gbook-count { margin-left: auto; font-size: 13px; color: var(--text-3); }
.gbook-count em { font-style: normal; font-weight: 700; color: var(--chip-accent); }
.gbook-page-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-1);
    display: flex;
    align-items: center;
    gap: 8px;
}
/* ===== Layout ===== */
.gbook-layout {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 24px;
    align-items: start;
}
/* ===== 留言列表 ===== */
.gbook-list-wrap {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    /* grid item 預設 min-width:auto，內容太寬時會撐開整條 grid 軌道，
       導致 .gbook-item 超出 .gbook-layout 寬度；需明確歸零才能正常收縮 */
    min-width: 0;
}
.gbook-list {
    list-style: none;
    margin: 0;
    padding: 8px 0;
}
.gbook-item {
    display: flex;
    gap: 14px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    transition: background .15s;
}
.gbook-item:hover {
    background: var(--bg-elevated);
}
.gbook-item:last-child {
    border-bottom: none;
}
.gbook-avatar {
    width: 38px;
    height: 38px;
    background: var(--accent-light);
    border-radius: 50%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    font-weight: 700;
    color: var(--accent);
    text-transform: uppercase;
}
.gbook-body {
    flex: 1;
    min-width: 0;
}
.gbook-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
}
.gbook-uname {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-1);
    overflow-wrap: anywhere;
}
.gbook-time {
    font-size: 12px;
    color: var(--text-3);
}
.gbook-content {
    font-size: 14px;
    color: var(--text-2);
    line-height: 1.7;
    word-break: break-all;
}
.gbook-reply {
    margin-top: 10px;
    padding: 10px 14px;
    background: var(--bg-elevated);
    border-left: 3px solid var(--accent);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    font-size: 13px;
    color: var(--text-2);
    display: flex;
    gap: 6px;
    align-items: flex-start;
}
.gbook-reply strong {
    color: var(--accent);
    white-space: nowrap;
}
.gbook-empty {
    padding: 48px 20px;
    text-align: center;
    color: var(--text-3);
    font-size: 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}
.gbook-empty .mac-icon {
    width: 40px;
    height: 40px;
    color: var(--text-3);
}
/* 分页器：单一来源 main.css，本页不再覆写 */

/* ===== 留言表單 ===== */
.gbook-form-wrap {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    position: sticky;
    top: calc(var(--sticky-h) + 12px);
    /* 跟 .gbook-list-wrap 同理：grid item 預設 min-width:auto 在窄寬度下可能被撐開 */
    min-width: 0;
}
.gbook-form-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-1);
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
}
.gbook-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.gbook-textarea {
    width: 100%;
    padding: 10px 12px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-2);
    border-radius: var(--radius-sm);
    color: var(--text-1);
    font-size: 13px;
    font-family: inherit;
    resize: vertical;
    outline: none;
    box-sizing: border-box;
    transition: border-color .15s;
    min-height: 120px;
}
.gbook-textarea:focus {
    border-color: var(--accent);
}
.gbook-remain {
    font-size: 12px;
    color: var(--text-3);
    text-align: right;
}
.gbook-remain em {
    color: var(--accent);
    font-style: normal;
}
.gbook-form-row {
    display: flex;
    gap: 8px;
    align-items: center;
}
.gbook-verify-input {
    flex: 1;
    min-width: 0;
    height: 36px;
    padding: 0 10px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-2);
    border-radius: var(--radius-sm);
    color: var(--text-1);
    font-size: 13px;
    outline: none;
}
.gbook-verify-input:focus {
    border-color: var(--accent);
}
.gbook-captcha-img {
    height: 36px;
    border-radius: 4px;
    cursor: pointer;
    vertical-align: middle;
    height: 36px;
    width: auto;
    max-width: 100%;
    flex-shrink: 0;
    border-radius: var(--radius-sm);
    cursor: pointer;
}
.gbook-submit-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    justify-content: center;
    width: 100%;
    height: 40px;
    background: var(--accent);   /* tp42：按鈕一律綠色 */
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background .15s;
}
.gbook-submit-btn:hover {
    background: var(--accent-hover);
}
/* ===== RWD ===== */
@media (max-width: 900px) {
  .gbook-layout {
        grid-template-columns: 1fr;
  }
  .gbook-form-wrap {
        position: static;
  }
}
@media (max-width: 600px) {
  /* 手機版：留言項目跟留言表單左右內距對齊，維持一致的左右間隔 */
  .gbook-item {
        padding: 14px 16px;
        gap: 12px;
  }
  .gbook-avatar {
        width: 32px;
        height: 32px;
        font-size: 13px;
  }
  .gbook-form-wrap {
        padding: 16px;
  }
  .gbook-main {
        padding-bottom: 80px;
  }
}
