:root {
  /* Tông màu: giấy ấm + xanh chàm (藍色). Tên biến cũ giữ nguyên để trang quản trị không vỡ. */
  --honey: #2d3a6b;
  --honey-dark: #1f2a52;
  --text: #22252e;
  --muted: #646876;
  --bg: #f7f4ee;
  --card: #ffffff;
  --border: #e2ddd2;
  --shopee: #2d3a6b;
  --accent: #a8432c;
  --serif: "Hiragino Mincho ProN", "Yu Mincho", YuMincho, "Noto Serif JP", "BIZ UDPMincho", serif;
  --sans: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic", YuGothic, "Noto Sans JP", Meiryo, system-ui, sans-serif;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
}
a { color: var(--honey-dark); }
img { max-width: 100%; height: auto; }
.container { max-width: 1040px; margin: 0 auto; padding: 0 16px; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 10; background: rgba(255, 255, 255, 0.94); backdrop-filter: blur(8px); border-bottom: 1px solid var(--border); box-shadow: 0 2px 12px rgba(120, 80, 10, 0.06); }
.site-header .container { display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: center; justify-content: space-between; min-height: 72px; padding-block: 10px; }
.logo { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.32rem; letter-spacing: -0.01em; text-decoration: none; color: var(--honey-dark); }
.main-nav { display: flex; gap: 4px; }
.main-nav a { padding: 8px 14px; border-radius: 999px; font-size: 1rem; font-weight: 600; text-decoration: none; color: var(--text); white-space: nowrap; transition: background 0.15s, color 0.15s; }
.main-nav a:hover { background: #fbefd6; color: var(--honey-dark); }
.main-nav a.active { background: var(--honey); color: #fff; }
@media (max-width: 900px) {
  .site-header .container { min-height: 0; }
  .main-nav { width: 100%; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 0 16px 2px; }
  .main-nav::-webkit-scrollbar { display: none; }
  .main-nav a { padding: 7px 12px; font-size: 0.95rem; }
}

/* main.container: .container đặt padding 0 16px nên phải ghi đè với độ ưu tiên cao hơn */
main.container { padding-top: 28px; padding-bottom: 72px; min-height: 60vh; }
.breadcrumbs { font-size: 0.88rem; color: var(--muted); margin-bottom: 20px; }
.breadcrumbs a { color: var(--muted); }
.lead { font-size: 1.08rem; color: var(--muted); max-width: 720px; }
.empty { color: var(--muted); font-style: italic; }

/* Home */
.hero { display: grid; grid-template-columns: 1.1fr 1fr; gap: 40px; align-items: center; padding: 16px 0 8px; }
.hero h1 { font-size: clamp(2rem, 5vw, 2.8rem); line-height: 1.15; margin: 0 0 14px; }
.eyebrow { margin: 0 0 10px; font-size: 0.8rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--honey-dark); }
.hero-lead { font-size: 1.08rem; color: var(--muted); margin: 0; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
.hero:not(:has(.hero-image)) { grid-template-columns: 1fr; max-width: 760px; }
.hero-image img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 16px; box-shadow: 0 12px 32px rgba(120, 80, 10, 0.18); }
@media (max-width: 760px) {
  .hero { grid-template-columns: 1fr; gap: 24px; }
  .hero-image { order: -1; }
}

/* Bài nổi bật */
.featured-post { display: grid; grid-template-columns: 1.2fr 1fr; background: var(--card); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; }
.featured-image { display: block; aspect-ratio: 16 / 10; }
.featured-image img { display: block; width: 100%; height: 100%; object-fit: cover; }
.featured-body { padding: 24px 28px; display: flex; flex-direction: column; gap: 10px; justify-content: center; }
.featured-body h3 { margin: 0; font-size: 1.5rem; line-height: 1.3; }
.featured-body h3 a { color: var(--text); text-decoration: none; }
.featured-body h3 a:hover { color: var(--honey-dark); }
.featured-body p { margin: 0; color: var(--muted); }
.read-more { font-weight: 600; text-decoration: none; }
@media (max-width: 760px) {
  .featured-post { grid-template-columns: 1fr; }
  .featured-image { aspect-ratio: 16 / 9; }
}

/* Hai cột chuyên mục */
.topic-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }
@media (max-width: 760px) { .topic-columns { grid-template-columns: 1fr; } }
.topic-column { background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 20px 22px; }
.topic-column .section-head h2 { margin-bottom: 12px; }
.post-list-compact { list-style: none; margin: 0; padding: 0; }
.post-list-compact li + li { border-top: 1px solid var(--border); }
.post-list-compact a { display: flex; gap: 14px; align-items: center; padding: 12px 0; text-decoration: none; color: var(--text); }
.post-list-compact a:hover strong { color: var(--honey-dark); }
.post-list-compact img, .thumb-placeholder { flex: none; width: 88px; height: 66px; object-fit: cover; border-radius: 8px; background: var(--border); }
.post-list-compact span { display: flex; flex-direction: column; gap: 2px; }
.post-list-compact strong { line-height: 1.35; }
section { margin-top: 40px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.section-head h2 { margin: 0 0 16px; }

/* Buttons */
.btn { display: inline-block; background: var(--honey); color: #fff; border: 1px solid var(--honey); padding: 10px 20px; border-radius: 8px; text-decoration: none; font: inherit; cursor: pointer; text-align: center; }
.btn:hover { background: var(--honey-dark); border-color: var(--honey-dark); }
.btn-outline { background: transparent; color: var(--honey-dark); }
.btn-outline:hover { color: #fff; }
.btn-shopee { background: var(--shopee); border-color: var(--shopee); }
.btn-shopee:hover { background: #d73211; border-color: #d73211; }

/* Cards */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.card { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 16px; }
.card h3 { margin: 0 0 4px; font-size: 1.05rem; }
.product-card { display: flex; flex-direction: column; gap: 6px; }
.product-card img { aspect-ratio: 1; object-fit: cover; border-radius: 8px; width: 100%; }
.product-card p { margin: 0; color: var(--muted); font-size: 0.92rem; flex: 1; }
.product-card .price { color: var(--shopee); font-size: 1.1rem; }
.price-note { color: var(--muted); font-size: 0.78rem; margin-top: -4px; }
.product-card .btn { margin-top: 6px; }
.disclosure { margin-top: 24px; font-size: 0.85rem; color: var(--muted); }

.post-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }
.post-card { background: var(--card); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; display: flex; flex-direction: column; }
.post-card-image img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.post-card-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 6px; }
.post-card h3 { margin: 0; font-size: 1.1rem; line-height: 1.35; }
.post-card h3 a { color: var(--text); text-decoration: none; }
.post-card h3 a:hover { color: var(--honey-dark); }
.post-card p { margin: 0; color: var(--muted); font-size: 0.92rem; }
.tag { align-self: flex-start; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em; text-decoration: none; color: var(--honey-dark); font-weight: 600; }
time { color: var(--muted); font-size: 0.88rem; }

/* Article */
.post-header h1 { font-size: clamp(1.8rem, 5vw, 2.4rem); line-height: 1.2; margin: 0 0 8px; }
.post-meta { color: var(--muted); font-size: 0.92rem; margin: 0 0 24px; }
.prose { max-width: 720px; font-size: 1.05rem; }
.prose h2 { margin-top: 2em; line-height: 1.3; }
.prose h3 { margin-top: 1.6em; }
.prose figure { margin: 28px 0; }
.prose figure img { display: block; width: 100%; border-radius: 10px; background: var(--border); }
.prose figure.narrow { max-width: 420px; margin-inline: auto; }
.prose figcaption { margin-top: 8px; font-size: 0.92rem; color: var(--muted); line-height: 1.5; }
.prose figcaption small { display: block; margin-top: 2px; font-size: 0.8rem; opacity: 0.85; }
.prose figcaption a { color: inherit; }
.prose table { display: block; overflow-x: auto; border-collapse: collapse; margin: 20px 0; font-size: 0.95rem; }
.prose th, .prose td { border: 1px solid var(--border); padding: 8px 10px; text-align: left; vertical-align: top; }
.prose th { background: #f6ecd6; }
.prose tr:nth-child(even) td { background: #fffdf7; }
.related { border-top: 1px solid var(--border); padding-top: 24px; }

/* Forms */
.form { display: grid; gap: 12px; max-width: 480px; }
.form label { display: grid; gap: 4px; }
.form input, .form textarea { font: inherit; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; background: #fff; }
.notice { padding: 10px 14px; border-radius: 8px; }
.notice.success { background: #e8f5e4; }
.notice.error { background: #fbe4e1; }

/* Footer */
.site-footer { border-top: 1px solid var(--border); background: var(--card); padding-block: 36px 28px; color: var(--muted); font-size: 0.9rem; }
.footer-grid { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; }
.footer-grid p { margin: 4px 0 0; }
.footer-links { display: flex; flex-direction: column; gap: 4px; }
.footer-links a, .footer-grid a { color: var(--muted); }
.login-box { max-width: 380px; margin: 40px auto; }
/* Trang quản trị */
.admin-layout { display: grid; grid-template-columns: 210px 1fr; gap: 28px; align-items: start; }
.admin-side { position: sticky; top: 92px; display: flex; flex-direction: column; gap: 16px; background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 12px; }
.admin-side nav { display: flex; flex-direction: column; gap: 2px; }
.admin-side nav a { padding: 8px 12px; border-radius: 8px; text-decoration: none; color: var(--text); font-weight: 500; }
.admin-side nav a:hover { background: #fbefd6; }
.admin-side nav a.active { background: var(--honey); color: #fff; }
.admin-main { min-width: 0; }
.admin-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.admin-bar h1 { margin: 0; font-size: 1.6rem; }
.admin-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.admin-actions form, .inline-form { margin: 0; display: inline; }
.admin-form { margin: 8px 0 0; max-width: 480px; }
.admin-form-wide { max-width: 900px; }
.admin-table { width: 100%; border-collapse: collapse; background: var(--card); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.admin-table th, .admin-table td { padding: 10px 12px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: middle; }
.admin-table th { background: #f6ecd6; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.03em; color: var(--muted); }
.admin-table tr:last-child td { border-bottom: 0; }
.admin-table a { text-decoration: none; }
.row-actions { white-space: nowrap; text-align: right; }
.row-actions a + a { margin-left: 12px; }
.row-muted td { opacity: 0.55; }
.muted { color: var(--muted); font-size: 0.88rem; }
.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 0.8rem; font-weight: 600; white-space: nowrap; }
.badge-on { background: #e3f3df; color: #2f6b22; }
.badge-off { background: #eee; color: #666; }
.btn-danger { background: #c0392b; border-color: #c0392b; }
.btn-danger:hover { background: #962d22; border-color: #962d22; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form .checkbox { display: flex; flex-direction: row; align-items: center; gap: 8px; }
.checkbox-group { display: flex; flex-direction: column; gap: 6px; justify-content: center; }
.form select { font: inherit; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; background: #fff; }
.markdown-input { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: 0.92rem; line-height: 1.5; }
.form-actions { display: flex; align-items: center; gap: 16px; }
.admin-thumb { width: 48px; height: 48px; object-fit: cover; border-radius: 6px; display: block; }
.admin-thumb-lg { width: 160px; height: 160px; object-fit: cover; border-radius: 8px; }
.product-group + .product-group { margin-top: 32px; }
@media (max-width: 800px) {
  .admin-layout { grid-template-columns: 1fr; }
  .admin-side { position: static; }
  .admin-side nav { flex-direction: row; flex-wrap: wrap; }
  .form-row { grid-template-columns: 1fr; }
  .admin-table { display: block; overflow-x: auto; }
}
.contact-table { display: grid; gap: 12px; max-width: 720px; }
.contact-item p { margin: 6px 0 0; }
.contact-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; }
.contact-message { white-space: pre-wrap; color: var(--text); }
.contact-list { list-style: none; padding: 0; font-size: 1.05rem; }
.contact-list li { margin-bottom: 6px; }
.copyright { margin-top: 16px; font-size: 0.82rem; }

/* Tải ảnh & thư viện ảnh (quản trị) */
.upload-widget { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin: -.25rem 0 1rem; font-size: .9rem; }
.upload-widget input[type=file] { max-width: 100%; }
.upload-preview[hidden] { display: none; }
.upload-panel { margin-bottom: 1rem; }
.btn-sm { padding: .3rem .6rem; font-size: .8rem; }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem; }
.media-item { margin: 0; border: 1px solid #e5dccb; border-radius: 8px; overflow: hidden; background: #fff; display: flex; flex-direction: column; }
.media-item img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; background: #f4efe6; }
.media-item figcaption { padding: .5rem; display: flex; flex-direction: column; gap: .35rem; font-size: .8rem; }
.media-item code { word-break: break-all; }
.media-actions { display: flex; flex-wrap: wrap; gap: .35rem; }
.admin-fieldset { border: 1px solid var(--border); border-radius: 12px; padding: 16px; margin: 0 0 20px; display: flex; flex-direction: column; gap: 12px; }
.admin-fieldset legend { font-weight: 700; padding: 0 6px; }
.footer-about p { margin: 0 0 8px; }
.product-picker { display: flex; flex-direction: column; gap: 4px; margin-bottom: 8px; }

/* ===== Giao diện trang công khai (tiếng Nhật) ===== */
body { font-family: var(--sans); line-height: 1.85; letter-spacing: 0.02em; }
h1, h2, h3, .logo { font-family: var(--serif); font-weight: 600; letter-spacing: 0.04em; }
a { color: var(--honey); }

.site-header { background: rgba(255, 255, 255, 0.96); box-shadow: none; }
.logo { font-size: 1.2rem; font-weight: 600; color: var(--text); }
.main-nav { gap: 2px; }
.main-nav a { border-radius: 0; padding: 8px 14px; font-weight: 500; font-size: 0.95rem; border-bottom: 2px solid transparent; }
.main-nav a:hover { background: transparent; color: var(--honey); border-bottom-color: var(--border); }
.main-nav a.active { background: transparent; color: var(--honey); border-bottom-color: var(--honey); }

.hero { padding: 40px 0 24px; gap: 56px; }
.hero h1 { font-size: clamp(2.2rem, 6vw, 3.4rem); letter-spacing: 0.12em; margin-bottom: 20px; }
.eyebrow { text-transform: none; letter-spacing: 0.12em; font-size: 0.85rem; color: var(--accent); display: flex; align-items: center; gap: 12px; }
.eyebrow::before { content: ""; width: 32px; height: 1px; background: var(--accent); }
.hero-lead { line-height: 2; color: var(--text); opacity: 0.85; }
.hero-image img { border-radius: 4px; box-shadow: 0 20px 40px rgba(31, 42, 82, 0.15); }

section { margin-top: 64px; }
.section-head { border-bottom: 1px solid var(--border); margin-bottom: 20px; }
.section-head h2 { margin: 0 0 12px; font-size: 1.4rem; }
.section-head a { font-size: 0.9rem; text-decoration: none; }

.btn { border-radius: 2px; padding: 11px 26px; letter-spacing: 0.08em; }
.btn-outline { background: transparent; color: var(--honey); }

.featured-post, .topic-column, .post-card, .card { border-radius: 4px; border-color: var(--border); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03); transition: box-shadow 0.2s, transform 0.2s; }
.post-card:hover, .product-card:hover, .featured-post:hover { box-shadow: 0 10px 28px rgba(31, 42, 82, 0.10); transform: translateY(-2px); }
.featured-body h3 a:hover, .post-card h3 a:hover, .post-list-compact a:hover strong { color: var(--honey); }
.tag { text-transform: none; letter-spacing: 0.08em; color: var(--accent); }

/* Thẻ sách: ảnh theo tỉ lệ bìa sách, mô tả cắt gọn */
.grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 24px; }
.product-card { padding: 20px; }
.product-card img { aspect-ratio: 3 / 4; object-fit: contain; background: #f1ede5; border-radius: 2px; padding: 12px; }
.product-card h3 { font-size: 1.1rem; line-height: 1.5; margin-top: 8px; }
.product-card p { white-space: pre-line; display: -webkit-box; -webkit-line-clamp: 6; -webkit-box-orient: vertical; overflow: hidden; font-size: 0.88rem; line-height: 1.8; }
.product-card .price { color: var(--text); font-family: var(--serif); }

.prose { font-size: 1.02rem; line-height: 2; }
.prose h2 { font-size: 1.35rem; padding-left: 14px; border-left: 3px solid var(--honey); }
.prose ul { padding-left: 1.3em; }
.prose li + li { margin-top: 4px; }
.post-header h1 { line-height: 1.5; }

.site-footer { background: var(--honey-dark); color: rgba(255, 255, 255, 0.78); border-top: 0; }
.site-footer strong { font-family: var(--serif); color: #fff; font-size: 1.05rem; letter-spacing: 0.06em; }
.footer-links a, .footer-grid a { color: rgba(255, 255, 255, 0.85); text-decoration: none; }
.footer-links a:hover, .footer-grid a:hover { color: #fff; text-decoration: underline; }
.copyright { border-top: 1px solid rgba(255, 255, 255, 0.15); padding-top: 16px; color: rgba(255, 255, 255, 0.6); }
.unofficial-note { margin: 0 0 6px; font-size: 0.8rem; }

.form input, .form textarea, .form select { border-radius: 2px; }
.form input:focus, .form textarea:focus { outline: 2px solid var(--honey); outline-offset: 1px; }

/* Bài giới thiệu video YouTube */
.prose .video-embed { position: relative; aspect-ratio: 16 / 9; margin: 24px 0 14px; border-radius: 10px; overflow: hidden; background: #000; }
.prose .video-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.prose .video-cta { margin: 0 0 28px; text-align: center; }
.prose .video-cta .btn { color: #fff; font-weight: 700; padding: 12px 26px; }

/* Bài nghe âm thanh */
.prose .audio-player { margin: 24px 0 28px; padding: 16px 18px; border: 1px solid var(--border); border-radius: 12px; background: #fffdf7; }
.prose .audio-player p { margin: 0 0 10px; font-weight: 700; color: var(--honey-dark); }
.prose .audio-player audio { display: block; width: 100%; }

/* Phân trang danh sách bài */
.pagination { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px; margin: 36px 0 12px; }
.pagination a, .pagination span { min-width: 40px; padding: 8px 12px; border: 1px solid var(--border); border-radius: 8px; text-align: center; text-decoration: none; line-height: 1.2; }
.pagination a:hover { background: #fbefd6; color: var(--honey-dark); }
.pagination .current { background: var(--honey); border-color: var(--honey); color: #fff; font-weight: 700; }
.pagination .disabled { opacity: 0.4; }
.pagination .pg-gap { border: 0; min-width: 0; padding: 8px 2px; }
.pagination .pg-info { flex-basis: 100%; margin: 10px 0 0; text-align: center; font-size: 0.88rem; color: var(--muted); }
.pg-title { margin-left: 8px; font-size: 0.6em; font-weight: 600; color: var(--muted); }
@media (max-width: 480px) { .pagination a, .pagination span { min-width: 36px; padding: 7px 9px; } }

/* Thành viên: khung khoá trình phát, form đăng ký/đăng nhập */
.prose .member-lock { margin: 24px 0 28px; padding: 22px 20px; border: 2px dashed var(--honey); border-radius: 12px; background: #fffdf7; text-align: center; }
.prose .member-lock p { margin: 0 0 10px; }
.prose .member-lock .member-lock-title { font-size: 1.1rem; font-weight: 700; color: var(--honey-dark); }
.prose .member-lock-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 14px !important; }
.prose .member-lock .btn { color: #fff; font-weight: 700; }
.prose .member-lock .btn-outline { color: var(--honey-dark); }
.prose .member-lock .btn-outline:hover { color: #fff; }
.member-box { max-width: 440px; }
.member-box .lead { font-size: 0.95rem; }
.member-box h2 { margin-top: 32px; font-size: 1.15rem; }
.member-switch { margin-top: 16px; text-align: center; }
.member-links { display: flex; flex-wrap: wrap; gap: 10px; }
.member-logout { margin-top: 28px; }
.form .hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.main-nav .nav-member { border: 1px solid var(--honey); }
.admin-search { display: flex; gap: 8px; margin: 0 0 16px; max-width: 480px; }
.admin-search input { flex: 1; font: inherit; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; }
.temp-pass { font-size: 1.1rem; padding: 2px 8px; background: #fff; border: 1px solid var(--border); border-radius: 6px; user-select: all; }

/* Diễn đàn みんなの相談広場 */
.forum-hero { margin-bottom: 8px; }
.forum-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 16px 0 8px; }
.forum-boards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin: 12px 0 28px; }
.forum-board { display: grid; gap: 4px; padding: 14px 16px; border: 1px solid var(--border); border-radius: 12px; background: var(--card, #fff); text-decoration: none; color: inherit; }
.forum-board:hover { border-color: var(--honey); }
.forum-board strong { color: var(--honey-dark); font-size: 1.05rem; }
.forum-board span { font-size: 0.9rem; color: var(--muted); }
.forum-board small { font-size: 0.8rem; color: var(--muted); }
.forum-threads { list-style: none; padding: 0; margin: 12px 0; border-top: 1px solid var(--border); }
.forum-threads li { padding: 12px 4px; border-bottom: 1px solid var(--border); }
.forum-thread-title { font-weight: 700; text-decoration: none; font-size: 1.02rem; }
.forum-thread-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 4px; font-size: 0.82rem; color: var(--muted); }
.forum-tag { display: inline-block; padding: 1px 8px; border-radius: 999px; background: #f6ecd6; color: var(--honey-dark); font-size: 0.78rem; text-decoration: none; }
.forum-thread h1 { margin-top: 4px; }
.forum-thread-board { margin: 0; }
.forum-post { margin: 14px 0; padding: 14px 16px; border: 1px solid var(--border); border-radius: 12px; background: var(--card, #fff); }
.forum-post.is-op { border-color: var(--honey); }
.forum-post header { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: 0.88rem; }
.forum-post header time { color: var(--muted); font-size: 0.8rem; }
.forum-no { color: var(--muted); font-weight: 700; }
.forum-body { margin-top: 8px; line-height: 1.9; overflow-wrap: anywhere; }
.forum-body p { margin: 0 0 0.8em; }
.forum-removed { margin: 8px 0 0; }
.forum-post footer { display: flex; justify-content: flex-end; align-items: center; gap: 12px; font-size: 0.82rem; }
.forum-report summary { cursor: pointer; color: var(--muted); }
.forum-report form { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.forum-report select { font: inherit; font-size: 0.85rem; padding: 4px 6px; border: 1px solid var(--border); border-radius: 6px; }
.forum-report .btn { padding: 4px 12px; font-size: 0.85rem; }
.link-button { background: none; border: 0; padding: 0; font: inherit; color: var(--muted); text-decoration: underline; cursor: pointer; }
.forum-reply-form { margin-top: 28px; }
.forum-reply-form .form, .forum-form .form { max-width: 720px; }
.form textarea { font: inherit; line-height: 1.7; }
.forum-cta { margin: 28px 0; padding: 20px; border: 2px dashed var(--honey); border-radius: 12px; background: #fffdf7; text-align: center; }
.forum-cta .member-lock-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.forum-cta .btn-outline { color: var(--honey-dark); }
.forum-safety { display: block; margin: 32px 0 8px; padding: 14px 16px; border-radius: 10px; background: #f3f1ea; font-size: 0.88rem; line-height: 1.8; }
.forum-safety strong { display: block; margin-bottom: 4px; }
.forum-mod-list { display: grid; gap: 12px; }
.forum-mod-item { padding: 14px 16px; }
.forum-mod-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.forum-mod-body { white-space: pre-wrap; background: #fffdf7; padding: 10px 12px; border-radius: 8px; }
.forum-mod-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-start; }
.admin-tabs { display: flex; gap: 8px; }

/* Khu vực xoá trong trang sửa */
.danger-zone { margin-top: 36px; padding: 16px 18px; border: 1px solid #e6b8b2; border-radius: 12px; background: #fdf4f2; max-width: 480px; }
.danger-zone h2 { margin-top: 0; font-size: 1.05rem; color: #962d22; }

/* Theo dõi YouTube */
.yt-actions { margin: 12px 0 20px; }
.yt-settings { margin-bottom: 28px; }
.yt-test { display: block; margin: -12px 0 24px; }

/* Quản lý kênh YouTube */
.yt-channel-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; margin: 12px 0; }
.yt-channel { display: flex; align-items: center; gap: 12px; padding: 12px 14px; text-decoration: none; color: inherit; }
.yt-channel img { border-radius: 50%; }
.yt-channel span { display: grid; gap: 4px; }
.yt-guide { margin: 8px 0 16px; padding: 12px 16px; border: 1px solid var(--border); border-radius: 10px; background: #fffdf7; }
.yt-guide summary { cursor: pointer; font-weight: 700; }
.yt-guide li { margin: 6px 0; line-height: 1.7; }
.yt-note { margin-top: 20px; font-size: 0.9rem; line-height: 1.7; }
.yt-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 8px 0 20px; }
.yt-stats .card { display: grid; padding: 14px; text-align: center; }
.yt-stats strong { font-size: 1.5rem; color: var(--honey-dark); }
.yt-stats span { font-size: 0.85rem; color: var(--muted); }
.yt-videos img { display: block; border-radius: 6px; }
.seo-score { display: inline-block; min-width: 2.4em; padding: 2px 8px; border-radius: 999px; text-align: center; font-weight: 700; color: #fff; }
.seo-score.good { background: #2e7d32; }
.seo-score.mid { background: #c77d00; }
.seo-score.bad { background: #c0392b; }
.yt-form { max-width: 820px; }
.yt-form textarea { font: inherit; line-height: 1.6; }
.yt-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.yt-suggest-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.yt-title-options { display: grid; gap: 6px; }
.yt-title-options p { margin: 0; }
.yt-title-option { text-align: left; font: inherit; padding: 8px 10px; border: 1px dashed var(--honey); border-radius: 8px; background: #fffdf7; cursor: pointer; }
.yt-title-option:hover { background: #fbefd6; }
.seo-panel { padding: 12px 16px; border: 1px solid var(--border); border-radius: 10px; background: #fff; }
.seo-panel h3 { margin: 0 0 8px; font-size: 1rem; }
.seo-panel ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: 0.9rem; }
.seo-panel small { color: var(--muted); }
.yt-progress { display: flex; align-items: center; gap: 10px; }
.yt-progress progress { flex: 1; height: 18px; }
@media (max-width: 640px) { .yt-stats, .yt-row { grid-template-columns: 1fr; } }
.yt-steps { margin: 4px 0 24px; padding: 16px 18px; border: 2px solid var(--honey); border-radius: 12px; background: #fffdf7; }
.yt-step-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.yt-step-list li { display: grid; gap: 6px; justify-items: start; padding: 12px 14px; border-radius: 10px; background: #fff; border: 1px solid var(--border); }
.yt-step-list li.done { border-color: #9ccc9c; background: #f3faf3; }
.yt-step-list span { color: var(--muted); font-size: 0.92rem; }
.yt-connect { font-size: 1.05rem; padding: 12px 22px; }
.btn.disabled { opacity: 0.45; cursor: not-allowed; }
/* Quản lý hàng loạt video YouTube */
.yt-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 12px; }
.yt-tabs button { font: inherit; padding: 6px 14px; border: 1px solid var(--border); border-radius: 999px; background: #fff; cursor: pointer; }
.yt-tabs button.active { background: var(--honey); border-color: var(--honey); color: #fff; }
.yt-tabs button.active .muted { color: #dfe3f3; }
.yt-bulk-bar { position: sticky; top: 72px; z-index: 5; display: grid; gap: 10px; margin-bottom: 14px; padding: 12px 16px; border: 2px solid var(--honey); border-radius: 12px; background: #fffdf7; box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06); }
.yt-bulk-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
.yt-bulk-row > span { display: contents; }
.yt-bulk-row > span[hidden] { display: none; }
.yt-bulk-bar label.inline { display: inline-flex; align-items: center; gap: 6px; font-size: 0.92rem; }
.yt-bulk-bar input, .yt-bulk-bar select { font: inherit; padding: 5px 8px; border: 1px solid var(--border); border-radius: 6px; background: #fff; }
.yt-bulk-bar input[type='number'] { width: 4.5em; }
.yt-bulk-bar .notice { margin: 0; }
.yt-bulk-table td[data-plan] input { display: block; margin-top: 4px; font: inherit; padding: 3px 6px; border: 1px solid var(--border); border-radius: 6px; }
.yt-bulk-table td:first-child, .yt-bulk-table th:first-child { width: 28px; }
.yt-bulk-table input[type='checkbox'] { width: 18px; height: 18px; }
.yt-kind { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 0.82rem; font-weight: 600; white-space: nowrap; background: #eceef4; color: #3b4060; }
.yt-kind.public { background: #e3f2e5; color: #1f6b27; }
.yt-kind.unlisted { background: #fff1d6; color: #8a5a00; }
.yt-kind.scheduled { background: #e3ecfb; color: #1f4a99; }
.yt-ok { color: #1f6b27; font-weight: 600; }
.yt-fail { color: #b03024; font-size: 0.88rem; }
@media (max-width: 640px) {
  .yt-bulk-bar { position: static; }
  .yt-bulk-table th:nth-child(2), .yt-bulk-table td:nth-child(2) { display: none; }
}
/* Tự động đặt lịch */
.yt-weekdays { display: flex; flex-wrap: wrap; gap: 8px 18px; border: 1px solid var(--border); border-radius: 10px; padding: 10px 14px; margin: 0; }
.yt-weekdays legend { font-weight: 600; padding: 0 6px; }
.yt-auto-plan { padding: 14px 18px; margin: 12px 0 20px; display: grid; gap: 10px; }
.yt-auto-plan h3 { margin: 0; font-size: 1.05rem; }
.btn.btn-small { padding: 3px 10px; font-size: 0.82rem; }

/* ===== Giao diện máy tính: khung rộng hơn, logo + menu cùng hàng, nội dung + cột bên phải ===== */
.container { max-width: none; padding: 0 clamp(16px, 3vw, 64px); }
.main-col { min-width: 0; }
.with-sidebar { display: grid; grid-template-columns: minmax(0, 1fr); gap: 40px; }
.sidebar { display: grid; gap: 20px; align-content: start; }
.side-box { background: var(--card); border: 1px solid var(--border); border-radius: 4px; padding: 18px 20px; }
.side-box h2 { margin: 0 0 12px; padding-bottom: 10px; border-bottom: 1px solid var(--border); font-size: 1.05rem; }
.side-box p { margin: 0 0 14px; color: var(--muted); font-size: 0.9rem; line-height: 1.8; }
.side-box .btn { display: block; }
.side-member { border-top: 3px solid var(--honey); }
.side-login { display: block; margin-top: 10px; text-align: center; font-size: 0.88rem; }
.side-cats { list-style: none; margin: 0; padding: 0; }
.side-cats a { display: flex; justify-content: space-between; padding: 8px 4px; border-bottom: 1px dashed var(--border); color: var(--text); text-decoration: none; }
.side-cats li:last-child a { border-bottom: 0; }
.side-cats a::after { content: "›"; color: var(--muted); }
.side-cats a:hover, .side-cats a.active { color: var(--honey); }
.sidebar .post-list-compact a { padding: 10px 0; gap: 12px; }
.sidebar .post-list-compact img, .sidebar .thumb-placeholder { width: 76px; height: 57px; border-radius: 4px; }
.sidebar .post-list-compact strong { font-size: 0.86rem; font-weight: 500; line-height: 1.55; }
.main-col .post-grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
@media (min-width: 1024px) {
  .site-header .container { flex-wrap: nowrap; min-height: 76px; }
  .with-sidebar { grid-template-columns: minmax(0, 1fr) 340px; gap: 56px; }
  .main-col .post-grid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 24px; }
  .main-col .prose { max-width: none; }
  .hero { gap: 72px; padding: 56px 0 32px; }
  .topic-columns { gap: 40px; }
  .footer-grid { gap: 32px 64px; }
  .footer-grid > div:first-child { max-width: 640px; }
}
@media (min-width: 1600px) { .with-sidebar { grid-template-columns: minmax(0, 1fr) 380px; gap: 64px; } }
@media (min-width: 1400px) {
  .hero-image img { aspect-ratio: 16 / 9; }
  .featured-image { aspect-ratio: 16 / 9; max-height: 480px; }
}

/* ===== Trang trí Nhật Bản: hoa anh đào, sóng 青海波 (seigaiha) — chỉ trang công khai ===== */
:root { --sakura: #f4b6c6; --sakura-deep: #d9668a; }
body.site-public {
  background:
    radial-gradient(1100px 600px at 100% 0, rgba(246, 188, 203, 0.30), transparent 62%),
    radial-gradient(900px 520px at 0 100%, rgba(246, 188, 203, 0.20), transparent 60%),
    var(--bg);
  background-attachment: fixed;
}
.site-public .site-header::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 3px; background: linear-gradient(90deg, transparent, var(--sakura) 20%, var(--sakura-deep) 50%, var(--sakura) 80%, transparent); opacity: 0.55; }

/* Cành hoa ở đầu trang chủ + bông hoa ở góc ảnh */
.site-public .hero { position: relative; padding-top: calc(min(46vw, 560px) * 0.42); }
.site-public .hero::before { content: ""; position: absolute; top: -20px; left: calc(-1 * clamp(16px, 3vw, 64px)); width: min(46vw, 560px); aspect-ratio: 620 / 280; background: url(/img/sakura-branch.svg) no-repeat left top / contain; pointer-events: none; }
.site-public .hero > * { position: relative; }
.site-public .hero-image::after { content: ""; position: absolute; right: -14px; bottom: -30px; width: clamp(64px, 8vw, 120px); aspect-ratio: 1; background: url(/img/sakura-flower.svg) no-repeat center / contain; filter: drop-shadow(0 6px 10px rgba(217, 102, 138, 0.25)); pointer-events: none; }

/* Biểu tượng hoa cạnh tiêu đề mục */
.site-public .section-head h2::before, .site-public .related > h2::before, .site-public .side-box h2::before { content: ""; display: inline-block; width: 1.05em; height: 1.05em; margin-right: 0.45em; vertical-align: -0.14em; background: url(/img/sakura-flower.svg) no-repeat center / contain; }
.site-public .main-col > h1 { position: relative; padding-bottom: 14px; border-bottom: 1px solid var(--border); }
.site-public .main-col > h1::after { content: ""; position: absolute; right: 0; bottom: 6px; width: min(40%, 260px); aspect-ratio: 620 / 280; background: url(/img/sakura-branch.svg) no-repeat right bottom / contain; opacity: 0.85; pointer-events: none; }

/* Thẻ bài, khung bên phải */
.site-public .post-card:hover, .site-public .featured-post:hover { border-color: #f1c4d0; }
.site-public .topic-column, .site-public .side-box { position: relative; overflow: hidden; }
.site-public .side-member { border-top-color: var(--sakura-deep); background: linear-gradient(160deg, #fff5f8, #fff 55%); }
.site-public .side-member::after { content: ""; position: absolute; right: -22px; top: -22px; width: 96px; aspect-ratio: 1; background: url(/img/sakura-flower.svg) no-repeat center / contain; opacity: 0.45; pointer-events: none; }
.site-public .topic-column::after { content: ""; position: absolute; right: -28px; bottom: -28px; width: 110px; aspect-ratio: 1; background: url(/img/sakura-flower.svg) no-repeat center / contain; opacity: 0.18; pointer-events: none; }

/* Chân trang: hoa văn sóng seigaiha trên nền chàm */
.site-public .site-footer { background-color: var(--honey-dark); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='20' viewBox='0 0 40 20'%3E%3Cdefs%3E%3Cg id='s'%3E%3Ccircle r='20' fill='%231f2a52'/%3E%3Cg fill='none' stroke='%23ffffff' stroke-opacity='.09'%3E%3Ccircle r='19'/%3E%3Ccircle r='15'/%3E%3Ccircle r='11'/%3E%3Ccircle r='7'/%3E%3Ccircle r='3'/%3E%3C/g%3E%3C/g%3E%3C/defs%3E%3Cuse href='%23s' x='0' y='0'/%3E%3Cuse href='%23s' x='40' y='0'/%3E%3Cuse href='%23s' x='20' y='10'/%3E%3Cuse href='%23s' x='0' y='20'/%3E%3Cuse href='%23s' x='40' y='20'/%3E%3C/svg%3E"); background-size: 56px 28px; position: relative; }
.site-public .site-footer::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: linear-gradient(90deg, var(--sakura-deep), var(--sakura), var(--sakura-deep)); opacity: 0.8; }

/* Cánh hoa rơi */
.sakura-fall { position: fixed; inset: 0; z-index: 9; overflow: hidden; pointer-events: none; }
.sakura-fall i { position: absolute; top: -40px; background: url(/img/sakura-petal.svg) no-repeat center / contain; opacity: 0.75; animation-name: sakura-fall; animation-timing-function: linear; animation-iteration-count: infinite; will-change: transform; }
@keyframes sakura-fall {
  0% { transform: translate(0, 0) rotate(0deg); }
  25% { transform: translate(var(--dx), 28vh) rotate(90deg); }
  50% { transform: translate(0, 56vh) rotate(200deg); }
  75% { transform: translate(var(--dx), 84vh) rotate(290deg); }
  100% { transform: translate(0, 112vh) rotate(380deg); }
}
.sakura-fall i:nth-child(1) { left: 1.6%; width: 12px; height: 15px; animation-duration: 17.3s; animation-delay: -0.8s; --dx: -86px; }
.sakura-fall i:nth-child(2) { left: 10.0%; width: 16px; height: 20px; animation-duration: 15.4s; animation-delay: -1.3s; --dx: 48px; }
.sakura-fall i:nth-child(3) { left: 15.4%; width: 16px; height: 20px; animation-duration: 17.7s; animation-delay: -14.6s; --dx: -68px; }
.sakura-fall i:nth-child(4) { left: 24.5%; width: 16px; height: 20px; animation-duration: 23.4s; animation-delay: -13.5s; --dx: 46px; }
.sakura-fall i:nth-child(5) { left: 33.3%; width: 10px; height: 12px; animation-duration: 19.1s; animation-delay: -2.5s; --dx: 58px; }
.sakura-fall i:nth-child(6) { left: 38.2%; width: 16px; height: 20px; animation-duration: 16.4s; animation-delay: -13.4s; --dx: -53px; }
.sakura-fall i:nth-child(7) { left: 45.5%; width: 18px; height: 22px; animation-duration: 15.1s; animation-delay: -1.5s; --dx: -112px; }
.sakura-fall i:nth-child(8) { left: 50.0%; width: 12px; height: 15px; animation-duration: 18.5s; animation-delay: -9.8s; --dx: 99px; }
.sakura-fall i:nth-child(9) { left: 59.7%; width: 14px; height: 18px; animation-duration: 17.0s; animation-delay: -4.2s; --dx: -71px; }
.sakura-fall i:nth-child(10) { left: 64.3%; width: 13px; height: 16px; animation-duration: 18.8s; animation-delay: -16.5s; --dx: 76px; }
.sakura-fall i:nth-child(11) { left: 74.0%; width: 10px; height: 12px; animation-duration: 14.3s; animation-delay: -6.0s; --dx: 59px; }
.sakura-fall i:nth-child(12) { left: 82.8%; width: 14px; height: 18px; animation-duration: 13.4s; animation-delay: -9.0s; --dx: 83px; }
.sakura-fall i:nth-child(13) { left: 88.7%; width: 16px; height: 20px; animation-duration: 18.5s; animation-delay: -14.7s; --dx: -51px; }
.sakura-fall i:nth-child(14) { left: 97.0%; width: 14px; height: 18px; animation-duration: 20.7s; animation-delay: -1.3s; --dx: 113px; }
@media (max-width: 760px) { .sakura-fall i:nth-child(n + 8) { display: none; } }
@media (prefers-reduced-motion: reduce) { .sakura-fall { display: none; } }
