:root {
  --paper: rgba(255, 250, 244, 0.94);
  --ink: #1e1a16;
  --ink-soft: #64594d;
  --line: rgba(112, 87, 63, 0.14);
  --accent: #cb5c38;
  --accent-deep: #8a2f1f;
  --gold: #a77c27;
  --olive: #42583f;
  --shadow-lg: 0 20px 64px rgba(80, 45, 23, 0.14);
  --shadow-md: 0 12px 30px rgba(80, 45, 23, 0.1);
  --radius-xl: 24px;
  --radius-lg: 18px;
  --radius-md: 14px;
  --radius-sm: 999px;
  --header-height: 0px;
  --sidebar-width: 220px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  min-height: 100%;
}

#app {
  min-height: 100%;
}

#main-area {
  margin-left: var(--sidebar-width);
}

#page-articles {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

body {
  font-family: "Noto Sans TC", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(203, 92, 56, 0.14), transparent 34%),
    radial-gradient(circle at top right, rgba(167, 124, 39, 0.14), transparent 24%),
    linear-gradient(180deg, #f8efe5 0%, #fdf7f1 44%, #f6f0e7 100%);
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
}

.hidden {
  display: none !important;
}

#header {
  position: sticky;
  top: 0;
  z-index: 1000;
  padding: 12px 18px 0;
}

.header-shell {
  max-width: 1480px;
  margin: 0 auto;
  background: linear-gradient(135deg, rgba(255, 252, 247, 0.95), rgba(255, 246, 239, 0.92));
  border: 1px solid rgba(123, 83, 53, 0.1);
  border-radius: 26px;
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(18px);
  overflow: visible;
}

.badge-label,
.section-label,
.list-kicker,
.detail-item-label {
  display: inline-flex;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 10px;
  font-weight: 700;
}

.control-panel {
  display: grid;
  grid-template-columns: minmax(260px, 1.2fr) minmax(300px, 2fr);
  gap: 14px;
  padding: 14px 18px 14px;
}

.header-shell.collapsed .control-panel {
  grid-template-columns: 1fr;
}

.search-section,
.filter-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.search-hero-text {
  flex: 1;
  min-width: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.search-hero {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.header-shell.collapsed .filter-section {
  gap: 0;
}

.header-shell.collapsed .filter-body {
  display: none;
}

#search-bar {
  position: relative;
}

#search-input,
#cuisine-select {
  width: 100%;
  border: 1px solid rgba(119, 91, 65, 0.14);
  border-radius: 14px;
  background: rgba(255, 253, 250, 0.92);
  color: var(--ink);
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

#search-input {
  min-height: 44px;
  padding: 11px 14px 11px 42px;
  font-size: 13px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' fill='none' viewBox='0 0 24 24'%3E%3Cpath stroke='%23a14c32' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.8' d='m21 21-4.35-4.35m1.85-5.15a7 7 0 1 1-14 0 7 7 0 0 1 14 0Z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 14px center;
  background-size: 18px 18px;
}

#search-input:focus,
#cuisine-select:focus {
  border-color: rgba(203, 92, 56, 0.45);
  box-shadow: 0 0 0 4px rgba(203, 92, 56, 0.1);
}

#search-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  inset-inline: 0;
  z-index: 2200;
  max-height: 248px;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  pointer-events: auto;
  padding: 4px;
  border: 1px solid rgba(119, 91, 65, 0.14);
  border-radius: 16px;
  background: rgba(255, 253, 250, 0.98);
  box-shadow: var(--shadow-md);
}

.search-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px 10px;
  border-radius: 12px;
  transition: background 0.16s ease;
}

.search-item:hover {
  background: rgba(245, 216, 203, 0.42);
}

.search-name {
  font-size: 12px;
  font-weight: 700;
}

.search-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.search-addr {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 10px;
  color: var(--ink-soft);
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.section-head-main {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex-wrap: wrap;
}

.section-label {
  color: var(--accent-deep);
}

#filter-summary {
  font-size: 12px;
  color: var(--ink-soft);
}

.header-toggle-btn {
  border: 1px solid rgba(119, 91, 65, 0.16);
  border-radius: 999px;
  background: rgba(255, 252, 247, 0.88);
  color: var(--ink);
}

.header-toggle-btn.icon-only {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  min-width: 30px;
}

.toggle-arrow {
  font-size: 16px;
  line-height: 1;
  transition: transform 0.18s ease;
}

.header-shell.collapsed .toggle-arrow {
  transform: rotate(180deg);
}

.filter-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.chip-row,
.toolbar-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}

.filter-btn,
.category-btn,
.star-btn,
.toggle-price-btn {
  min-height: 32px;
  padding: 6px 11px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(119, 91, 65, 0.14);
  background: rgba(255, 250, 245, 0.9);
  color: var(--ink);
  font-size: 12px;
  font-weight: 600;
}

.filter-btn.active,
.category-btn.active,
.star-btn.active,
.toggle-price-btn.active {
  color: #fff8f3;
  border-color: transparent;
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
}

#cuisine-select {
  width: auto;
  min-width: 150px;
  min-height: 34px;
  padding: 8px 12px;
  font-size: 12px;
}

.metric-row {
  display: flex;
  gap: 10px;
  align-items: stretch;
}

.slider-card {
  flex: 1;
  padding: 11px 12px;
  border-radius: 16px;
  border: 1px solid rgba(119, 91, 65, 0.14);
  background: rgba(255, 252, 248, 0.88);
}

.slider-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.slider-label,
.slider-value {
  font-size: 12px;
}

.slider-value {
  font-weight: 700;
  color: var(--accent-deep);
}

#price-filter-panel {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

input[type="range"] {
  width: 100%;
  appearance: none;
  height: 5px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(203, 92, 56, 0.2), rgba(167, 124, 39, 0.22));
  outline: none;
}

input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  width: 16px;
  height: 16px;
  border: 2px solid #fff7ef;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
}

input[type="range"]::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border: 2px solid #fff7ef;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
}

#content {
  position: relative;
  max-width: 1480px;
  margin: 14px auto 18px;
  padding: 0 18px 18px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 14px;
  min-height: calc(100vh - var(--header-height) - 32px);
}

#map-stage,
#restaurant-list,
#detail-card {
  border: 1px solid rgba(119, 91, 65, 0.14);
  border-radius: var(--radius-xl);
  background: var(--paper);
  box-shadow: var(--shadow-md);
}

#map-stage {
  position: relative;
  overflow: hidden;
  min-height: calc(100vh - var(--header-height) - 48px);
  z-index: 0;
}

#map {
  position: absolute;
  inset: 0;
  z-index: 0;
}

#search-area-btn {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  min-height: 38px;
  padding: 8px 16px;
  border: none;
  border-radius: 999px;
  background: rgba(41, 28, 20, 0.88);
  color: #fff7ef;
  font-size: 12px;
  font-weight: 700;
}

#restaurant-list {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: calc(100vh - var(--header-height) - 48px);
  min-width: 0;
  z-index: 2;
  isolation: isolate;
}

.list-sheet-handle {
  display: none;
}

#list-header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  padding: 12px 14px 10px;
  border-bottom: 1px solid var(--line);
}

.list-kicker {
  color: var(--accent-deep);
}

.list-count-badge {
  min-width: 84px;
  padding: 8px 10px;
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(58, 34, 24, 0.94), rgba(114, 54, 35, 0.96));
  color: #fff7ef;
  font-size: 14px;
  font-weight: 800;
  text-align: center;
  line-height: 1.1;
}

#list-count {
  display: block;
  margin-top: 3px;
  font-size: 12px;
  color: var(--ink-soft);
}

.list-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-shrink: 0;
}

.sort-control {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 128px;
  font-size: 10px;
  font-weight: 700;
  color: var(--accent-deep);
}

#sort-select {
  min-height: 34px;
  max-width: 158px;
  padding: 7px 28px 7px 10px;
  border: 1px solid rgba(119, 91, 65, 0.14);
  border-radius: var(--radius-sm);
  background: rgba(255, 252, 248, 0.94);
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
  outline: none;
}

#sort-select:focus {
  border-color: rgba(203, 92, 56, 0.45);
  box-shadow: 0 0 0 4px rgba(203, 92, 56, 0.1);
}

#locate-btn {
  flex-shrink: 0;
  min-height: 34px;
  padding: 8px 12px;
  border: none;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--olive), #243720);
  color: #fdf7ef;
  font-size: 12px;
  font-weight: 700;
}

#list-items {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  list-style: none;
  padding: 6px 8px 10px;
}

.list-disclaimer {
  padding: 12px 16px 16px;
  font-size: 11px;
  color: var(--ink-soft);
  text-align: center;
  opacity: 0.7;
  line-height: 1.5;
}

.restaurant-item {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 10px 10px 11px;
  border-radius: 14px;
  background: rgba(255, 252, 247, 0.82);
  border: 1px solid transparent;
  transition: background 0.16s ease, border-color 0.16s ease;
}

.restaurant-item + .restaurant-item {
  margin-top: 4px;
}

.restaurant-item:hover {
  border-color: rgba(203, 92, 56, 0.16);
  background: #fffdf9;
}

.restaurant-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: flex-start;
}

.restaurant-item .name {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.32;
  color: #221914;
}

.distance-pill {
  flex-shrink: 0;
  padding: 4px 7px;
  border-radius: 999px;
  background: rgba(36, 55, 32, 0.08);
  color: var(--olive);
  font-size: 11px;
  font-weight: 700;
}

.meta,
.supporting-line {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  font-size: 11px;
  color: var(--ink-soft);
}

.price-avg {
  color: var(--accent-deep);
  font-weight: 600;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
}

.tag-michelin { background: #fff0cc; color: #8b6010; }
.tag-plate { background: #dcecff; color: #225e9c; }
.tag-influencer { background: #fde2d8; color: #9a472b; }
.tag-both { background: #ece2ff; color: #6848a3; }
.tag-bowl500 { background: #efe4db; color: #765240; }
.tag-asia50 { background: #d8f2ef; color: #146f66; }
.tag-award { background: #f5e2ea; color: #8c3e56; }
.tag-reservation { background: #e3f0e1; color: #2f5d2b; }

.star-row {
  display: inline-flex;
  gap: 1px;
  color: var(--gold);
  font-size: 12px;
}

.google-rating {
  font-weight: 700;
  color: #624a37;
}

.list-empty {
  padding: 24px 14px;
  text-align: center;
  color: var(--ink-soft);
}

#detail-card {
  position: fixed;
  left: calc(var(--sidebar-width) + 18px);
  right: 394px;
  bottom: 28px;
  z-index: 900;
  padding: 18px;
  overflow: auto;
  max-height: min(42vh, 390px);
  transition: transform 0.24s ease, opacity 0.24s ease;
}

#detail-card.hidden {
  transform: translateY(120%);
  opacity: 0;
}

#close-detail {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 50%;
  background: rgba(36, 27, 21, 0.08);
  color: #4a3f35;
  font-size: 22px;
}

.detail-topline {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

#detail-content h2 {
  padding-right: 44px;
  font-family: "Noto Serif TC", serif;
  font-size: clamp(20px, 2.8vw, 28px);
  line-height: 1.2;
  color: #231915;
}

.detail-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.85fr;
  gap: 16px;
  margin-top: 14px;
}

.detail-stack,
.detail-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.detail-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255, 252, 247, 0.84);
  border: 1px solid rgba(119, 91, 65, 0.1);
}

.detail-item-label {
  color: var(--accent-deep);
}

.detail-item-value {
  font-size: 13px;
  line-height: 1.6;
  color: #352a23;
}

.detail-note {
  margin-top: 8px;
  padding: 10px 12px;
  border-left: 3px solid rgba(203, 92, 56, 0.52);
  border-radius: 12px;
  background: rgba(203, 92, 56, 0.08);
  font-size: 12px;
  line-height: 1.55;
  color: #5d4237;
}

.detail-link {
  text-decoration: none;
  color: var(--accent-deep);
  font-weight: 700;
}

.detail-year {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(203, 92, 56, 0.1);
  color: var(--accent-deep);
  font-size: 10px;
  font-weight: 800;
}

.favorite-btn,
.reserve-btn,
.maps-btn,
.article-btn {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  min-height: 42px;
  padding: 10px 16px;
  border-radius: 999px;
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
  transition: opacity 0.15s ease, background 0.15s ease;
}

.favorite-btn {
  background: rgba(203, 92, 56, 0.1);
  color: var(--accent-deep);
  border: 1.5px solid rgba(203, 92, 56, 0.18);
}

.favorite-btn:hover {
  background: rgba(203, 92, 56, 0.16);
}

.favorite-btn.active {
  background: linear-gradient(135deg, var(--gold), #8f6419);
  color: #fff8f0;
  border-color: transparent;
}

.reserve-btn {
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  color: #fff7f0;
}

.reserve-btn:hover { opacity: 0.88; }

.maps-btn {
  background: rgba(36, 55, 32, 0.08);
  color: var(--olive);
}

.maps-btn:hover { background: rgba(36, 55, 32, 0.14); }

.article-btn {
  background: rgba(120, 80, 40, 0.07);
  color: #7a4f28;
  border: 1.5px solid rgba(120, 80, 40, 0.18);
  letter-spacing: 0.01em;
}

.article-btn:hover {
  background: rgba(120, 80, 40, 0.13);
  border-color: rgba(120, 80, 40, 0.28);
}

.leaflet-container {
  background: #ead9c4;
  font: inherit;
}

@media (max-width: 1180px) {
  #content {
    grid-template-columns: 1fr 330px;
  }

  #detail-card {
    right: 360px;
  }

  .detail-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  #header {
    position: relative;
    padding: 10px 10px 0;
  }

  .control-panel {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 10px 14px 12px;
  }

  .search-section,
  .filter-section {
    width: 100%;
  }

  .section-head {
    align-items: flex-start;
  }

  .section-head-main {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  .metric-row,
  #price-filter-panel {
    display: grid;
    grid-template-columns: 1fr;
  }

  #content {
    margin: 10px auto 12px;
    padding: 0 10px 12px;
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
    min-height: auto;
    gap: 10px;
  }

  #map-stage {
    min-height: clamp(280px, 44vh, 480px);
  }

  #restaurant-list {
    position: relative;
    left: auto;
    right: auto;
    bottom: auto;
    min-height: 0;
    height: min(54vh, 520px);
    max-height: min(54vh, 520px);
    z-index: 2;
    border-radius: 22px;
    margin-top: 0;
    transform: none;
    transition: none;
  }

  #restaurant-list.dragging {
    transition: none;
  }

  .list-sheet-handle {
    display: none;
    justify-content: center;
    padding: 8px 0 2px;
  }

  #list-expand-btn {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    border: none;
    background: transparent;
    padding: 0 0 4px;
  }

  .sheet-bar {
    width: 42px;
    height: 5px;
    border-radius: 999px;
    background: rgba(100, 89, 77, 0.34);
  }

  #list-header {
    padding-top: 6px;
    align-items: flex-start;
  }

  .search-hero {
    width: 100%;
    justify-content: space-between;
  }

  .list-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .sort-control,
  #sort-select {
    width: 100%;
    max-width: none;
  }

  #list-items {
    max-height: none;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
  }

  #detail-card {
    left: 10px;
    right: 10px;
    bottom: 10px;
    max-height: min(58vh, 440px);
    z-index: 1300;
  }
}

@media (max-width: 640px) {
  .header-shell {
    border-radius: 22px;
  }

  .section-head {
    align-items: flex-start;
  }

  .section-head-main {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  #search-input {
    min-height: 42px;
    font-size: 12px;
  }

  #search-dropdown {
    max-height: min(40vh, 280px);
  }

  #cuisine-select {
    width: 100%;
    min-width: 0;
  }

  .filter-btn,
  .category-btn,
  .star-btn,
  .toggle-price-btn,
  #cuisine-select {
    font-size: 11px;
  }

  #restaurant-list {
    height: min(52vh, 480px);
    max-height: min(52vh, 480px);
  }

  #list-items {
    max-height: none;
  }

  .restaurant-item {
    padding: 9px 9px 10px;
  }

  .restaurant-item .name {
    font-size: 13px;
  }

  #list-header {
    flex-direction: column;
  }

  .search-hero {
    gap: 8px;
    align-items: center;
  }

  .list-count-badge {
    min-width: 72px;
    font-size: 13px;
    padding: 7px 9px;
  }

  .list-actions {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: end;
  }
}

/* ═══════════════════════════════════════════
   SIDEBAR
═══════════════════════════════════════════ */

#sidebar-toggle {
  display: none;
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: none;
  background: rgba(41, 28, 20, 0.10);
  color: var(--accent-deep);
  font-size: 18px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s ease;
}

#sidebar-toggle:hover {
  background: rgba(41, 28, 20, 0.18);
}

#sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1999;
  background: rgba(0, 0, 0, 0.42);
}

#sidebar-backdrop.active {
  display: block;
}

#sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--sidebar-width);
  z-index: 2000;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, #2b1e14 0%, #1a120b 100%);
  color: #e8d8c8;
  transition: transform 0.24s ease;
  overflow: hidden;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 22px 18px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.sidebar-logo {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  flex-shrink: 0;
}

.sidebar-title {
  font-family: "Noto Serif TC", serif;
  font-size: 15px;
  font-weight: 700;
  color: #f5e6d8;
  letter-spacing: 0.04em;
}

.sidebar-nav {
  flex: 1;
  list-style: none;
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow: hidden;
}

.sidebar-nav-spacer {
  flex: 1;
}

.sidebar-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 11px 12px;
  border: none;
  border-radius: 12px;
  background: transparent;
  color: rgba(232, 216, 200, 0.7);
  font-size: 13px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: background 0.16s ease, color 0.16s ease;
}

.sidebar-btn:hover {
  background: rgba(255, 255, 255, 0.07);
  color: #f5e6d8;
}

.sidebar-btn.active {
  background: rgba(203, 92, 56, 0.22);
  color: #f5c4a8;
}

.sidebar-icon {
  font-size: 16px;
  line-height: 1;
  flex-shrink: 0;
  width: 20px;
  text-align: center;
}

.sidebar-label {
  flex: 1;
}

.sidebar-footer {
  position: relative;
  padding: 12px 10px 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.sidebar-footer .sidebar-login-btn {
  margin-top: 8px;
}

.sidebar-login-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 11px 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  color: rgba(232, 216, 200, 0.8);
  font-size: 13px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: background 0.16s ease, border-color 0.16s ease;
}

.sidebar-login-btn:hover {
  background: rgba(203, 92, 56, 0.18);
  border-color: rgba(203, 92, 56, 0.3);
  color: #f5c4a8;
}

.sidebar-login-btn.logged-in {
  background: rgba(39, 118, 85, 0.14);
  border-color: rgba(39, 118, 85, 0.35);
  color: #c9f1dd;
}

.account-menu {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 68px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px;
  border-radius: 14px;
  background: rgba(35, 25, 18, 0.98);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.24);
  z-index: 20;
}

.account-menu button {
  min-height: 36px;
  padding: 8px 10px;
  border: none;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  color: #f6ebdf;
  font-size: 13px;
  font-weight: 700;
  text-align: left;
}

.account-menu button:hover {
  background: rgba(203, 92, 56, 0.2);
}

/* ═══════════════════════════════════════════
   ARTICLES PAGE
═══════════════════════════════════════════ */

.articles-header {
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 18px 20px 0;
  background: linear-gradient(180deg, #f8efe5 0%, rgba(248, 239, 229, 0.96) 100%);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(112, 87, 63, 0.1);
}

.articles-hero {
  margin-bottom: 14px;
}

.articles-title {
  font-family: "Noto Serif TC", serif;
  font-size: 22px;
  font-weight: 700;
  color: #231915;
  line-height: 1.2;
}

.articles-subtitle {
  margin-top: 3px;
  font-size: 12px;
  color: var(--ink-soft);
}

.articles-search-bar {
  position: relative;
  margin-bottom: 12px;
}

#articles-search-input {
  width: 100%;
  min-height: 44px;
  padding: 11px 14px 11px 42px;
  border: 1px solid rgba(119, 91, 65, 0.14);
  border-radius: 14px;
  background: rgba(255, 253, 250, 0.95) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' fill='none' viewBox='0 0 24 24'%3E%3Cpath stroke='%23a14c32' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.8' d='m21 21-4.35-4.35m1.85-5.15a7 7 0 1 1-14 0 7 7 0 0 1 14 0Z'/%3E%3C/svg%3E") no-repeat 14px center / 18px;
  font: inherit;
  font-size: 13px;
  color: var(--ink);
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

#articles-search-input:focus {
  border-color: rgba(203, 92, 56, 0.45);
  box-shadow: 0 0 0 4px rgba(203, 92, 56, 0.1);
}

.articles-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  padding-bottom: 12px;
}

.articles-tab {
  min-height: 30px;
  padding: 5px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(119, 91, 65, 0.14);
  background: rgba(255, 250, 245, 0.9);
  color: var(--ink);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.16s ease, border-color 0.16s ease;
}

.articles-tab.active {
  color: #fff8f3;
  border-color: transparent;
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
}

.articles-tab:hover:not(.active) {
  background: rgba(245, 216, 203, 0.4);
}

.articles-body {
  flex: 1;
  padding: 18px 20px 24px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 12px;
  align-content: start;
}

.articles-loading,
.articles-empty {
  grid-column: 1 / -1;
  padding: 40px 0;
  text-align: center;
  color: var(--ink-soft);
  font-size: 14px;
}

.article-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px;
  border-radius: 18px;
  background: var(--paper);
  border: 1px solid rgba(119, 91, 65, 0.1);
  box-shadow: var(--shadow-md);
  transition: box-shadow 0.18s ease, border-color 0.18s ease;
  cursor: pointer;
}

.article-card:hover {
  box-shadow: var(--shadow-lg);
  border-color: rgba(203, 92, 56, 0.2);
}

.article-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

.article-card-name {
  font-size: 14px;
  font-weight: 700;
  color: #221914;
  line-height: 1.3;
}

.article-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  align-items: center;
  font-size: 11px;
  color: var(--ink-soft);
}

.article-card-cuisine {
  font-size: 11px;
  color: var(--ink-soft);
}

.article-card-price {
  font-size: 11px;
  color: var(--ink-soft);
}

.article-card-links {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.article-link-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 28px;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 700;
  text-decoration: none;
  border: 1px solid transparent;
  transition: background 0.16s ease;
}

.article-link-btn.influencer-link {
  background: rgba(253, 226, 216, 0.6);
  color: #9a472b;
  border-color: rgba(203, 92, 56, 0.15);
}

.article-link-btn.influencer-link:hover {
  background: rgba(203, 92, 56, 0.15);
}

.article-link-btn.source-link {
  background: rgba(120, 80, 40, 0.07);
  color: #7a4f28;
  border-color: rgba(120, 80, 40, 0.2);
  font-weight: 700;
}

.article-link-btn.source-link:hover {
  background: rgba(120, 80, 40, 0.13);
  border-color: rgba(120, 80, 40, 0.3);
}

.article-link-btn.maps-link {
  background: rgba(36, 55, 32, 0.07);
  color: var(--olive);
  border-color: rgba(36, 55, 32, 0.1);
}

.article-link-btn.maps-link:hover {
  background: rgba(36, 55, 32, 0.12);
}

.article-link-btn.reserve-link {
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  color: #fff7f0;
}

.article-influencer-tag {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 7px;
  border-radius: var(--radius-sm);
  background: rgba(253, 226, 216, 0.6);
  color: #9a472b;
  font-size: 10px;
  font-weight: 700;
}

/* ═══════════════════════════════════════════
   LOGIN MODAL
═══════════════════════════════════════════ */

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(20, 12, 6, 0.52);
  backdrop-filter: blur(4px);
  padding: 16px;
}

.modal-box {
  position: relative;
  width: 100%;
  max-width: 380px;
  padding: 28px 24px 24px;
  border-radius: 24px;
  background: linear-gradient(135deg, #fff9f4, #fffbf7);
  border: 1px solid rgba(119, 91, 65, 0.12);
  box-shadow: 0 32px 80px rgba(50, 28, 14, 0.24);
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 50%;
  background: rgba(36, 27, 21, 0.07);
  color: #4a3f35;
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.modal-logo {
  display: flex;
  justify-content: center;
  margin-bottom: 12px;
}

.modal-title {
  font-family: "Noto Serif TC", serif;
  font-size: 20px;
  font-weight: 700;
  text-align: center;
  color: #231915;
  margin-bottom: 4px;
}

.modal-sub {
  font-size: 12px;
  text-align: center;
  color: var(--ink-soft);
  margin-bottom: 20px;
}

.modal-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.settings-box {
  max-width: 460px;
}

.settings-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 4px;
}

.settings-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid rgba(119, 91, 65, 0.12);
}

.settings-item strong {
  font-size: 13px;
  color: var(--ink);
}

.settings-item span {
  font-size: 12px;
  color: var(--ink-soft);
  line-height: 1.5;
}

.settings-select-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 10px 0 6px;
  font-size: 12px;
  color: var(--ink-soft);
}

.settings-select-wrap select {
  min-height: 38px;
  padding: 8px 12px;
  border-radius: 12px;
  border: 1px solid rgba(119, 91, 65, 0.14);
  background: rgba(255, 252, 248, 0.95);
  color: var(--ink);
  font-weight: 600;
}

.recent-viewed-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 10px 0 8px;
}

.recent-empty {
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 252, 248, 0.8);
  border: 1px dashed rgba(119, 91, 65, 0.14);
  color: var(--ink-soft);
  font-size: 12px;
}

.recent-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(119, 91, 65, 0.12);
  background: rgba(255, 252, 248, 0.92);
  text-align: left;
}

.recent-item strong {
  font-size: 12px;
  color: var(--ink);
}

.recent-item span {
  font-size: 11px;
  color: var(--ink-soft);
}

.settings-action-btn {
  align-self: flex-start;
  min-height: 34px;
  padding: 8px 12px;
  border: none;
  border-radius: 999px;
  background: rgba(119, 91, 65, 0.08);
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
}

.google-login-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 48px;
  padding: 12px 18px;
  border: 1.5px solid rgba(119, 91, 65, 0.18);
  border-radius: 12px;
  background: #fff;
  color: #3c3c3c;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  transition: box-shadow 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.google-login-btn:hover {
  background: #f8f8f8;
  border-color: rgba(66, 133, 244, 0.4);
  box-shadow: 0 4px 14px rgba(66, 133, 244, 0.15);
}

.modal-error {
  margin-top: 8px;
  padding: 8px 12px;
  border-radius: 10px;
  background: rgba(119, 91, 65, 0.08);
  color: #6d4f39;
  font-size: 12px;
  text-align: center;
}

.modal-error.is-error {
  background: rgba(200, 50, 30, 0.08);
  color: #b02020;
}

/* ═══════════════════════════════════════════
   MOBILE SIDEBAR OVERRIDE
═══════════════════════════════════════════ */

@media (max-width: 900px) {
  #sidebar-toggle {
    display: flex;
  }

  #sidebar {
    transform: translateX(calc(-1 * var(--sidebar-width)));
  }

  #sidebar.open {
    transform: translateX(0);
  }

  #main-area {
    margin-left: 0;
  }

  .search-hero {
    display: flex;
    align-items: center;
    gap: 10px;
  }

  #detail-card {
    left: 10px;
    right: 10px;
    bottom: 10px;
  }
}

@media (max-width: 640px) {
  .articles-body {
    grid-template-columns: 1fr;
    padding: 12px 12px 20px;
  }

  .articles-header {
    padding: 14px 12px 0;
  }
}

/* ═══════════════════════════════════════════
   POLICY PAGES (隱私政策 / 服務條款)
═══════════════════════════════════════════ */

.policy-page {
  min-height: 100%;
  background: #faf7f4;
  padding: 40px 20px 60px;
}

.policy-container {
  max-width: 680px;
  margin: 0 auto;
}

.policy-title {
  font-family: "Noto Serif TC", serif;
  font-size: 26px;
  font-weight: 700;
  color: #2b1e14;
  margin: 0 0 6px;
}

.policy-updated {
  font-size: 12px;
  color: #a08060;
  margin: 0 0 36px;
}

.policy-section {
  margin-bottom: 32px;
}

.policy-section h2 {
  font-size: 14px;
  font-weight: 700;
  color: #2b1e14;
  margin: 0 0 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid #e8ddd0;
}

.policy-section p {
  font-size: 13.5px;
  line-height: 1.8;
  color: #4a3828;
  margin: 0 0 10px;
}

.policy-section ul {
  margin: 0 0 10px;
  padding-left: 20px;
}

.policy-section li {
  font-size: 13.5px;
  line-height: 1.8;
  color: #4a3828;
  margin-bottom: 4px;
}

.policy-section a {
  color: #cb5c38;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.policy-section a:hover {
  color: #a03f22;
}

@media (max-width: 900px) {
  .policy-page {
    padding: 24px 16px 48px;
  }

  .policy-title {
    font-size: 22px;
  }
}

