/* Navbar inline auth controls */
@media (min-width: 768px) {
  .navbar.custom-navbar > .container::before,
  .navbar.custom-navbar > .container::after {
    display: none !important;
    content: none !important;
  }

  .navbar.custom-navbar > .container {
    display: flex !important;
    flex-wrap: wrap;
    align-items: center !important;
    justify-content: space-between;
    gap: 4px clamp(8px, 1.4vw, 20px);
    width: 100%;
    max-width: 1360px !important;
    padding: 6px clamp(10px, 1.3vw, 18px) !important;
    box-sizing: border-box;
  }

  .navbar.custom-navbar .navbar-header {
    float: none !important;
    display: flex !important;
    align-items: center !important;
    flex: 0 0 auto !important;
    flex-shrink: 0 !important;
    margin: 0 !important;
    padding: 0;
  }

  .navbar.custom-navbar .navbar-brand {
    float: none !important;
    display: inline-flex !important;
    align-items: center !important;
    flex-shrink: 0 !important;
    gap: 10px;
    padding: 8px 0 !important;
    margin: 0 !important;
    height: 48px;
    max-width: none !important;
  }

  .navbar.custom-navbar .navbar-brand img,
  .navbar.custom-navbar .navbar-header img {
    flex: 0 0 auto !important;
    flex-shrink: 0 !important;
    width: auto !important;
    height: 42px !important;
    max-height: 42px !important;
    max-width: 42px;
    object-fit: contain;
    object-position: left center;
    display: block;
    margin: 0 !important;
  }

  .navbar.custom-navbar .brand-text {
    flex-shrink: 0 !important;
    white-space: nowrap;
    line-height: 1.15;
    font-size: clamp(15px, 1.2vw + 4px, 20px) !important;
    font-weight: 900 !important;
    letter-spacing: 0.3px;
  }

  .navbar.custom-navbar .navbar-collapse,
  .navbar.custom-navbar .navbar-collapse.collapse,
  .navbar.custom-navbar .navbar-collapse.in {
    float: none !important;
    display: flex !important;
    flex: 1 1 auto;
    min-width: 0 !important;
    width: auto !important;
    max-width: none !important;
    height: auto !important;
    padding: 0 !important;
    margin: 0 !important;
    border-top: 0 !important;
    box-shadow: none !important;
    justify-content: flex-end;
    align-items: center;
    overflow: visible !important;
  }

  .navbar.custom-navbar .navbar-nav,
  .navbar.custom-navbar .navbar-nav.navbar-right {
    float: none !important;
    display: flex !important;
    align-items: center !important;
    /* 放不下時自動換行，避免整排往左溢出蓋住 Logo */
    flex-wrap: wrap;
    row-gap: 2px;
    justify-content: flex-end;
    gap: 2px;
    margin: 0 !important;
    width: auto;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
    /* 不可 overflow-x:auto，否則會裁切下拉選單導致點不到 */
    overflow: visible !important;
  }

  .navbar.custom-navbar .navbar-nav > li.dropdown {
    position: relative !important;
    z-index: 10002;
  }

  .navbar.custom-navbar .navbar-nav > li.dropdown > .dropdown-menu {
    z-index: 10003 !important;
  }

  .navbar.custom-navbar .navbar-nav > li {
    float: none !important;
    display: flex !important;
    align-items: center !important;
    flex-shrink: 0;
  }

  .navbar.custom-navbar .navbar-nav > li > a,
  .navbar.custom-navbar .admin-nav-link-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center;
    min-height: 38px !important;
    /* 隨視窗寬度連續縮放，避免特定解析度突然擠在一起 */
    padding: clamp(7px, 0.7vw, 12px) clamp(5px, 0.65vw, 12px) !important;
    font-size: clamp(12.5px, 0.45vw + 8px, 15px) !important;
    font-weight: 800 !important;
    line-height: 1.2 !important;
    white-space: nowrap;
  }

  .navbar.custom-navbar .navbar-nav > li > a.LINE-pro-btn.navbar-LINE-btn {
    min-height: 38px !important;
    padding: clamp(6px, 0.6vw, 8px) clamp(9px, 0.9vw, 14px) !important;
    font-size: clamp(12px, 0.4vw + 7.5px, 14px) !important;
    gap: clamp(4px, 0.4vw, 6px);
    margin-left: 2px !important;
  }

  .navbar.custom-navbar .navbar-nav > li > a.LINE-pro-btn.navbar-LINE-btn i {
    font-size: clamp(14px, 0.5vw + 9px, 17px);
  }

  .navbar.custom-navbar .navbar-nav > li.admin-auth-item {
    flex-shrink: 0;
  }

  body.linebar-editor-open .navbar.custom-navbar .navbar-nav > li > a,
  body.linebar-editor-open .navbar.custom-navbar .admin-nav-link-btn {
    overflow: visible !important;
    text-overflow: clip !important;
    max-width: none !important;
  }
}

/* 窄桌機：LINE 按鈕只留 icon，節省整排寬度 */
@media (max-width: 1280px) and (min-width: 768px) {
  .navbar.custom-navbar .navbar-nav > li > a.LINE-pro-btn.navbar-LINE-btn span {
    display: none;
  }

  .navbar.custom-navbar .navbar-nav > li > a.LINE-pro-btn.navbar-LINE-btn {
    min-width: 40px;
  }

  .navbar.custom-navbar .navbar-nav > li > a.LINE-pro-btn.navbar-LINE-btn i {
    margin: 0;
  }
}

/* 窄桌機：Logo 與品牌字同步縮小 */
@media (max-width: 1199px) and (min-width: 768px) {
  .navbar.custom-navbar .navbar-brand {
    gap: 7px;
  }

  .navbar.custom-navbar .navbar-brand img,
  .navbar.custom-navbar .navbar-header img {
    height: 34px !important;
    max-height: 34px !important;
    max-width: 34px;
  }
}

.admin-auth-item {
  display: flex;
  align-items: center;
}

html.linebar-editor-open,
body.linebar-editor-open {
  overflow: hidden !important;
  height: 100%;
}

.admin-nav-link-btn {
  border: none;
  background: transparent;
  color: #1f5c3f !important;
  font-size: 15px;
  font-weight: 800;
  border-radius: 999px;
  padding: 14px 12px !important;
  cursor: pointer;
  white-space: nowrap;
  line-height: 1.2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
}

.admin-nav-link-btn:hover,
.admin-nav-link-btn:focus {
  color: #0d8f47 !important;
  background: rgba(6, 199, 85, 0.08) !important;
  outline: none;
}

.navbar-nav > li.admin-auth-item {
  display: flex;
  align-items: center;
}

@media (max-width: 767px) {
  .admin-nav-link-btn {
    width: 100%;
    text-align: left;
    padding: 10px 15px !important;
    font-size: 14px;
  }
}

/* LINE card actions row */
.line-highlight-actions,
.lb-same-category-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}

#line-highlight-list .line-highlight-actions,
#lb-carousel .line-highlight-actions,
#line-carousel .line-highlight-actions {
  margin-top: auto;
  padding-top: 14px;
  width: 100%;
  flex: 0 0 auto;
}

.linebar-add-btn,
.linebar-edit-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 52px;
  height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  border: none;
  font-size: 14px;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
  white-space: nowrap;
}

/* display:inline-flex 會蓋掉 UA 的 [hidden]{display:none}，未登入時必須強制隱藏 */
.linebar-add-btn[hidden],
.linebar-edit-btn[hidden],
.linebar-editor-delete-btn[hidden],
.news-admin-btn[hidden],
#news-section-add-btn[hidden],
#news-admin-col-head[hidden] {
  display: none !important;
}

.linebar-add-btn {
  background: #1a73e8;
  color: #fff;
  box-shadow: 0 4px 12px rgba(26, 115, 232, 0.35);
  border: 1px solid #1558b0 !important;
}

.linebar-add-btn:hover,
.linebar-add-btn:focus {
  background: #1558b0;
  border-color: #124a94 !important;
}

.linebar-edit-btn {
  background: linear-gradient(135deg, #eef5ff 0%, #e3efff 100%);
  color: #1a73e8;
  border: 1px solid #9cc2f5 !important;
  box-shadow: none;
  font-weight: 900;
}

.linebar-edit-btn:hover,
.linebar-edit-btn:focus {
  background: linear-gradient(135deg, #1a73e8 0%, #1558b0 100%);
  color: #fff !important;
  border-color: #1558b0 !important;
}

#line-carousel .line-highlight-actions .linebar-edit-btn,
#lb-carousel .line-highlight-actions .linebar-edit-btn,
#line-highlight-list .line-highlight-actions .linebar-edit-btn,
#line-carousel .line-highlight-actions .linebar-add-btn,
#lb-carousel .line-highlight-actions .linebar-add-btn,
#line-highlight-list .line-highlight-actions .linebar-add-btn {
  padding: 12px 18px;
  min-width: auto;
  height: auto;
  font-size: 14px;
}

.lb-same-category-actions .linebar-edit-btn {
  padding: 10px 16px;
  min-width: auto;
  height: auto;
}

.lb-same-category-head .linebar-add-btn {
  align-self: center;
  margin-top: 4px;
}

.lb-same-category-item .lb-same-category-actions {
  align-self: center;
  margin-top: 0;
}

/* Modals */
.admin-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 10050;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.admin-modal-overlay[hidden] {
  display: none !important;
}

.admin-modal {
  position: relative;
  z-index: 10051;
  pointer-events: auto;
  background: #fff;
  border-radius: 16px;
  width: min(100%, 480px);
  max-height: 90vh;
  overflow: auto;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
  padding: 24px;
}

.admin-modal-wide {
  width: min(100%, 1100px);
}

.admin-modal.linebar-category-modal {
  width: min(96vw, 1480px);
  max-height: none;
  overflow: visible;
  padding: 28px 32px 24px;
}

.linebar-category-modal-desc {
  margin: 0 0 16px;
  color: #60756a;
  font-size: 15px;
}

.linebar-category-modal-grid,
#linebar-category-modal #line-highlight-list.linebar-category-modal-grid {
  display: grid !important;
  grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
  gap: 18px !important;
  max-width: none !important;
  margin: 8px 0 24px !important;
  overflow: visible !important;
}

#linebar-category-modal .line-5col {
  min-width: 0 !important;
  width: auto !important;
}

.linebar-category-modal-grid .line-highlight-card,
#linebar-category-modal .line-highlight-card {
  min-height: 260px !important;
  height: auto !important;
}

.linebar-category-modal-grid .line-highlight-actions {
  margin-top: auto;
  padding-top: 14px;
  width: 100%;
}

#linebar-section-add-btn[hidden] {
  display: none !important;
}

#linebar-section-add-btn.linebar-add-btn {
  background: #1a73e8 !important;
  color: #fff !important;
  border: 1px solid #1558b0 !important;
  box-shadow: 0 4px 12px rgba(26, 115, 232, 0.35) !important;
}

#linebar-section-add-btn.linebar-add-btn:hover,
#linebar-section-add-btn.linebar-add-btn:focus {
  background: #1558b0 !important;
  border-color: #124a94 !important;
}

@media (max-width: 1199px) {
  .admin-modal.linebar-category-modal {
    width: min(96vw, 1100px);
  }

  .linebar-category-modal-grid,
  #linebar-category-modal #line-highlight-list.linebar-category-modal-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 991px) {
  .linebar-category-modal-grid,
  #linebar-category-modal #line-highlight-list.linebar-category-modal-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 575px) {
  .linebar-category-modal-grid,
  #linebar-category-modal #line-highlight-list.linebar-category-modal-grid {
    grid-template-columns: 1fr !important;
  }
}

.admin-modal h3 {
  margin: 0 0 16px;
  color: #1f5c3f;
  font-weight: 800;
}

.admin-modal label {
  display: block;
  margin-bottom: 6px;
  font-weight: 700;
  color: #333;
}

.admin-modal input[type="text"],
.admin-modal input[type="password"],
.admin-modal input[type="date"],
.admin-modal textarea {
  width: 100%;
  border: 1px solid #cfd8d2;
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 14px;
  font-size: 14px;
}

.admin-modal textarea {
  min-height: 120px;
  resize: vertical;
}

.admin-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 8px;
}

.admin-modal-actions .btn-default {
  border: 1px solid #b0b0b0;
  border-radius: 8px;
  padding: 8px 22px;
  background: #e8e8e8;
  color: #333;
}

.admin-modal-actions .btn-default:hover {
  border-color: #999;
  background: #d8d8d8;
}

.admin-modal-actions .btn-primary {
  background: #06c755;
  border-color: #06c755;
}

.admin-modal-actions .btn-primary:hover {
  background: #05a847;
  border-color: #05a847;
}

.admin-error {
  color: #c0392b;
  font-size: 13px;
  min-height: 18px;
  margin-bottom: 8px;
}

/* WYSIWYG editor — matches linebar detail page */
.linebar-editor-overlay {
  position: fixed;
  top: var(--linebar-navbar-offset, 72px);
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9990;
  background: #f3f6f4;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.linebar-editor-overlay[hidden] {
  display: none !important;
}

body.linebar-editor-open .navbar.custom-navbar {
  z-index: 10000;
  overflow: visible !important;
}

.linebar-editor-shell {
  min-height: 100%;
  padding-top: 8px;
}

.linebar-editor-page {
  padding: 20px 16px 60px;
  max-width: 1480px;
  margin: 0 auto;
}

.linebar-editor-stack {
  width: 100%;
}

.linebar-editor-topbar {
  margin: 0 0 14px;
  padding: 0;
}

.linebar-editor-back-btn {
  border: 2px solid #b8d4c4;
  background: #fff;
  color: #1f5c3f;
  border-radius: 999px;
  padding: 14px 28px;
  font-size: 18px;
  font-weight: 800;
  line-height: 1.2;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 6px 16px rgba(31, 92, 63, 0.1);
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.linebar-editor-back-btn:hover,
.linebar-editor-back-btn:focus {
  color: #0d8f47;
  background: rgba(6, 199, 85, 0.08);
  border-color: #06c755;
  transform: translateY(-1px);
  outline: none;
}

/* 回上一頁只在編輯器內，不可出現在 navbar */
.navbar .linebar-editor-back-btn,
.navbar #linebar-editor-back-btn {
  display: none !important;
}

.lb-same-category-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.linebar-editor-footer-actions {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  margin: 32px 0 44px;
  padding: 0 20px;
  flex-wrap: wrap;
}

.linebar-editor-delete-btn,
#linebar-editor-delete.linebar-editor-delete-btn {
  min-width: 160px;
  min-height: 64px;
  padding: 18px 40px !important;
  border: none !important;
  border-radius: 999px !important;
  background: linear-gradient(135deg, #b42318 0%, #d92d20 100%) !important;
  color: #fff !important;
  font-size: 24px !important;
  font-weight: 800 !important;
  letter-spacing: 0.06em;
  line-height: 1.2 !important;
  box-shadow: 0 12px 28px rgba(180, 35, 24, 0.28);
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.linebar-editor-delete-btn:hover,
.linebar-editor-delete-btn:focus,
#linebar-editor-delete.linebar-editor-delete-btn:hover,
#linebar-editor-delete.linebar-editor-delete-btn:focus {
  background: linear-gradient(135deg, #912018 0%, #b42318 100%) !important;
  color: #fff !important;
  transform: translateY(-1px);
  box-shadow: 0 14px 28px rgba(180, 35, 24, 0.32);
}

.linebar-editor-delete-btn:disabled,
#linebar-editor-delete.linebar-editor-delete-btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.linebar-editor-publish-btn,
#linebar-editor-publish.linebar-editor-publish-btn {
  min-width: 220px;
  min-height: 64px;
  padding: 18px 52px !important;
  border: none !important;
  border-radius: 999px !important;
  background: linear-gradient(135deg, #1f5c3f 0%, #2b6b48 100%) !important;
  color: #fff !important;
  font-size: 24px !important;
  font-weight: 800 !important;
  letter-spacing: 0.06em;
  line-height: 1.2 !important;
  box-shadow: 0 12px 28px rgba(31, 92, 63, 0.3);
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.linebar-editor-publish-btn:hover,
.linebar-editor-publish-btn:focus,
#linebar-editor-publish.linebar-editor-publish-btn:hover,
#linebar-editor-publish.linebar-editor-publish-btn:focus {
  background: linear-gradient(135deg, #184a32 0%, #245c3f 100%) !important;
  color: #fff !important;
  transform: translateY(-1px);
  box-shadow: 0 14px 28px rgba(31, 92, 63, 0.32);
}

.linebar-editor-publish-btn:disabled,
#linebar-editor-publish.linebar-editor-publish-btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* SweetAlert2 需蓋過 linebar 編輯器 overlay (z-index ~9990) */
.swal2-container {
  z-index: 20000 !important;
}

.swal2-popup.linebar-swal-popup {
  width: min(800px, 92vw) !important;
  min-height: 450px !important; 
  padding: 4rem 2rem 3rem !important; 
  border-radius: 18px !important;
}

/* 1. 大幅放大圖示 */
.swal2-popup.linebar-swal-popup .swal2-icon {
  margin: 1.5rem auto 2.5rem !important; /* 增加圖示與下方的間距 */
  transform: scale(2) !important; /* 從 1.3 直接放大到 2 倍，並加上 !important 強制執行 */
}

/* 2. 大幅放大標題 */
.swal2-popup.linebar-swal-popup .swal2-title {
  font-size: 3rem !important; /* 從 2.2rem 放大到 3rem (約 48px) */
  font-weight: 800 !important;
  line-height: 1.35 !important;
  padding: 0 0.5rem !important;
}

/* 3. 大幅放大內文 */
.swal2-popup.linebar-swal-popup .swal2-html-container {
  font-size: 3rem !important; /* 從 1.4rem 放大到 1.8rem (約 28px) */
  line-height: 1.7 !important;
  color: #374151 !important;
  margin: 1.5rem 0 1rem !important; /* 增加文字上下的呼吸空間 */
  padding: 0 0.5rem !important;
}

/* 4. 拉開按鈕與上方的距離 */
.swal2-popup.linebar-swal-popup .swal2-actions {
  margin-top: 3.5rem !important; /* 往下推一點，讓畫面不擁擠 */
  gap: 24px !important; /* 兩顆按鈕之間的距離拉開 */
}

/* 5. 將按鈕撐大，並放大按鈕字體 */
.swal2-popup.linebar-swal-popup .swal2-styled.linebar-swal-confirm,
.swal2-popup.linebar-swal-popup .swal2-styled.linebar-swal-cancel {
  font-size: 3rem !important; /* 按鈕字體放大 */
  font-weight: 700 !important;
  padding: 1.2rem 3rem !important; /* 把按鈕的上下左右都撐得更寬厚 */
  border-radius: 999px !important;
  min-width: 220px !important; /* 按鈕最小寬度大幅拉長 (原 150px) */
}

.linebar-editor-upload-btn {
  margin: 0;
  cursor: pointer;
}

.linebar-editor-upload-inline {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin: 16px 0 12px;
  padding: 18px 20px;
  border: 2px dashed #cfe5d6;
  border-radius: 16px;
  background: #f8fcf9;
  color: #1f5c3f;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
  position: relative;
}

.linebar-editor-upload-inline input[type="file"] {
  display: none !important;
}

.linebar-editor-media-url-row {
  display: flex;
  align-items: stretch;
  gap: 10px;
  margin: 0 0 24px;
  flex-wrap: wrap;
}

.linebar-editor-media-url {
  flex: 1 1 280px;
  min-width: 0;
  height: 44px;
  padding: 0 14px;
  border: 1px solid #cfe5d6;
  border-radius: 12px;
  background: #fff;
  color: #1f3d2f;
  font-size: 15px;
}

.linebar-editor-media-url:focus {
  outline: none;
  border-color: #06c755;
  box-shadow: 0 0 0 3px rgba(6, 199, 85, 0.15);
}

.linebar-editor-media-url-btn {
  flex: 0 0 auto;
  height: 44px;
  padding: 0 18px;
  border-radius: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.linebar-editor-file-status {
  flex-basis: 100%;
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  color: #60756a;
  margin-top: 4px;
}

.linebar-editor-file-status.is-uploading {
  color: #1a73e8;
}

.linebar-editor-file-status.is-success {
  color: #0f8b46;
}

.linebar-editor-file-status.is-error {
  color: #c0392b;
}

.linebar-editor-media-preview {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
  margin: 0 0 16px;
  padding: 14px;
  border: 1px solid #dbe8e0;
  border-radius: 16px;
  background: #fff;
}

.linebar-editor-media-preview[hidden] {
  display: none !important;
}

.linebar-editor-media-preview-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.linebar-editor-media-preview-thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 12px;
  overflow: hidden;
  background: #f3f7f4;
  border: 1px solid #dbe8e0;
  box-shadow: 0 6px 16px rgba(20, 64, 40, 0.06);
}

.linebar-media-remove {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 20;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(17, 24, 39, 0.72);
  color: #fff;
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.22);
}

.linebar-media-remove:hover,
.linebar-media-remove:focus-visible {
  background: rgba(192, 57, 43, 0.95);
  outline: none;
}

.linebar-editor-media-preview-thumb .linebar-media-remove {
  top: 6px;
  right: 6px;
  width: 28px;
  height: 28px;
  font-size: 18px;
}

.linebar-media-block {
  position: relative;
}

.linebar-editor-media-preview-thumb img,
.linebar-editor-media-preview-thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background: #000;
}

.linebar-editor-media-preview-embed {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  padding: 12px;
  text-align: center;
  color: #1f5c3f;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.5;
  background: linear-gradient(135deg, #eef8f1 0%, #f8fcf9 100%);
}

.linebar-editor-media-preview-label {
  font-size: 12px;
  font-weight: 700;
  color: #60756a;
  line-height: 1.4;
  word-break: break-all;
}

.linebar-editor-media-preview-item.is-pending .linebar-editor-media-preview-thumb::after {
  content: '上傳中…';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.72);
  color: #1a73e8;
  font-size: 13px;
  font-weight: 800;
}

.linebar-editor-upload-inline:hover {
  background: #eef8f1;
  border-color: #06c755;
}

.linebar-editor-upload-inline.is-disabled {
  opacity: 0.65;
  cursor: wait;
  pointer-events: none;
}

.linebar-editor-upload-inline.is-disabled:hover {
  background: #f8fcf9;
  border-color: #cfe5d6;
}

.linebar-editor-upload-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #06c755;
  color: #fff;
  font-size: 22px;
  line-height: 1;
  font-weight: 700;
}

.linebar-editor-title {
  font-size: 38px;
  font-weight: 800;
  margin: 0 0 8px;
  text-align: center;
  color: #1f4330;
  line-height: 1.45;
  word-break: break-word;
  outline: none;
  border: 2px dashed transparent;
  border-radius: 12px;
  padding: 4px 12px 8px;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.linebar-editor-title:focus {
  border-color: rgba(6, 199, 85, 0.35);
  background: rgba(255, 255, 255, 0.7);
}

.linebar-editor-title:empty::before {
  content: attr(data-placeholder);
  color: #aab8b0;
}

.linebar-editor-meta {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  text-align: center;
  margin-bottom: 18px;
  color: #60756a;
  font-weight: 600;
  font-size: 18px;
}

.linebar-editor-date-field {
  border: none;
  background: transparent;
  color: #60756a;
  font-weight: 600;
  font-size: 18px;
  font-family: inherit;
  cursor: pointer;
  padding: 0;
}

.linebar-editor-date-field:focus {
  outline: none;
  color: #1f5c3f;
}

.linebar-editor-draft-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  background: #fff8e6;
  color: #9a7b00;
  font-size: 12px;
  font-weight: 800;
  border: 1px solid #f0e0a8;
}

.linebar-editor-draft-badge.is-scheduled {
  background: #eef6ff;
  color: #1d4f91;
  border-color: #b7d0f5;
}

.linebar-editor-content {
  background: #fff;
  border: 1px solid #e6efe8;
  border-radius: 22px;
  padding: 32px 28px;
  box-shadow: 0 8px 20px rgba(20, 64, 40, 0.05);
  min-height: 320px;
}

/* 與 linebar.html #lb-content 相同渲染規則 */
#linebar-editor-html,
.linebar-editor-html {
  outline: none;
  min-height: 280px;
  word-break: break-word;
}

#linebar-editor-html img,
.linebar-editor-html img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 20px auto;
}

#linebar-editor-html p,
.linebar-editor-html p {
  font-size: 17px;
  line-height: 1.9;
  margin-bottom: 16px;
  word-break: break-word;
}

#linebar-editor-html h2,
#linebar-editor-html h3,
.linebar-editor-html h2,
.linebar-editor-html h3 {
  word-break: break-word;
}

#linebar-editor-html video,
#linebar-editor-html iframe,
.linebar-editor-html video,
.linebar-editor-html iframe {
  max-width: 100%;
}

#linebar-editor-html section,
.linebar-editor-html section {
  margin-bottom: 14px;
}

[data-linebar-media-slot]:empty {
  display: none;
}

[data-linebar-media-slot] {
  margin-top: 4px;
  margin-bottom: 8px;
  min-height: 8px;
}

[data-linebar-media-slot] img,
[data-linebar-media-slot] video,
[data-linebar-media-slot] iframe {
  display: block;
  max-width: 100%;
}

#linebar-editor-html .linebar-ph-block,
.linebar-editor-html .linebar-ph-block {
  display: block;
  min-height: 1.6em;
}

#linebar-editor-html .linebar-ph-heading,
.linebar-editor-html .linebar-ph-heading {
  display: block;
  min-height: 1.2em;
}

#linebar-editor-html .linebar-ph-signature,
.linebar-editor-html .linebar-ph-signature {
  display: block;
  min-height: 1.2em;
}

#linebar-editor-html .linebar-ph.is-empty::before,
.linebar-editor-html .linebar-ph.is-empty::before {
  content: attr(data-placeholder);
  color: #9aa8a1;
  font-weight: inherit;
  pointer-events: none;
}

#linebar-editor-html .linebar-ph-heading.is-empty::before,
.linebar-editor-html .linebar-ph-heading.is-empty::before {
  font-weight: 900;
  color: #a3b0a9;
}

#linebar-editor-html .linebar-ph-signature.is-empty::before,
.linebar-editor-html .linebar-ph-signature.is-empty::before {
  font-weight: 800;
}

#linebar-editor-html .monthly-quote-card .linebar-ph.is-empty::before,
.linebar-editor-html .monthly-quote-card .linebar-ph.is-empty::before {
  color: rgba(255, 255, 255, 0.72);
}

.linebar-editor-html:empty::before {
  content: '載入範本中…';
  color: #aab8b0;
  font-size: 18px;
}

.linebar-editor-error {
  text-align: center;
  margin-top: 16px;
}

@media (max-width: 768px) {
  .linebar-editor-topbar {
    margin-bottom: 12px;
  }

  .linebar-editor-back-btn {
    padding: 12px 22px;
    font-size: 16px;
  }

  .linebar-editor-title {
    font-size: 28px;
  }

  .linebar-editor-upload-inline {
    font-size: 16px;
    padding: 14px 16px;
  }

  .linebar-editor-content {
    padding: 20px 16px;
  }
}
