/* [EP3] EatPlan app shell: header layout + CJK-first type. Loaded after AppKit and navigation-chrome CSS. */
:root {
  --eatplan-font: system-ui, -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Noto Sans CJK SC", "Source Han Sans SC", "Microsoft YaHei", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --ep3-header-h: 56px;
}

/* ---- One font stack for the whole shell (AppKit forces "Inter"/"Roboto" with !important; neither is bundled,
   so Latin fell back to a western UI font and Chinese to a different system font). Icon fonts are untouched. ---- */
html, body,
body :where(h1, h2, h3, h4, h5, h6, p, a, span, strong, small, em, b, li, dt, dd, label, input, button, select, textarea, div, td, th, figcaption, blockquote):not(.fa):not(.fas):not(.far):not(.fab):not([class*=" fa-"]):not([class^="fa-"]) {
  font-family: var(--eatplan-font) !important;
}
body { font-size: 15px; line-height: 1.65; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
h1, h2, h3, h4, h5, h6 { font-weight: 600 !important; letter-spacing: 0 !important; line-height: 1.35 !important; color: var(--eatplan-ink, #254b40); }
h1 { font-size: 22px; } h2 { font-size: 20px; } h3 { font-size: 17px; } h4, h5, h6 { font-size: 15px; }
.font-700, .font-800, .font-900 { font-weight: 600 !important; }
p { line-height: 1.7; }
.eatplan-hero-copy h2 { font-size: 26px; font-weight: 700 !important; line-height: 1.3 !important; }
.btn { font-weight: 600 !important; letter-spacing: 0 !important; }

/* ---- Header: back | real page title | grouped actions. Sticky (fixed) with safe-area inset. ---- */
html .header.ep3-header {
  position: fixed; top: 0 !important; left: 0; right: 0; z-index: 98;
  display: flex; align-items: center; gap: 4px;
  box-sizing: border-box; height: calc(var(--ep3-header-h) + env(safe-area-inset-top)) !important;
  padding: env(safe-area-inset-top) max(8px, env(safe-area-inset-right)) 0 max(8px, env(safe-area-inset-left)) !important;
  background: rgba(247, 250, 248, .96) !important; border-bottom: 1px solid var(--eatplan-line, #dce8e2);
  -webkit-backdrop-filter: saturate(1.4) blur(10px); backdrop-filter: saturate(1.4) blur(10px);
}
html .header.ep3-header .header-icon {
  position: static !important; display: inline-flex; align-items: center; justify-content: center;
  width: 44px !important; height: 44px !important; line-height: 1 !important; margin: 0 !important;
  border-radius: 12px; font-size: 17px !important; color: var(--eatplan-ink, #254b40) !important; flex: 0 0 44px;
}
html .header.ep3-header .header-icon:active { background: rgba(37, 75, 64, .08) !important; }
html .header.ep3-header .header-icon:focus-visible { outline: 3px solid #8aa995; outline-offset: -3px; }
.ep3-left { display: flex; align-items: center; flex: 0 0 auto; }
.ep3-title { flex: 1 1 auto; min-width: 0; padding: 0 6px; font-size: 17px; font-weight: 600; color: var(--eatplan-ink, #254b40); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ep3-header:not(.ep3-has-back) .ep3-title { padding-left: 8px; }
.ep3-actions { display: flex; align-items: center; gap: 2px; flex: 0 0 auto; margin-left: auto; }
/* home (发现): brand logo instead of a generic title */
/* [EP7] real wordmark alone (3:1, never cropped/stretched/rounded) */
.ep3-brand { display: flex; align-items: center; min-width: 0; height: 44px; padding-left: 8px; text-decoration: none; }
html .ep3-brand img.ep3-logo { display: block; height: 40px !important; width: auto !important; max-width: 60vw; aspect-ratio: 365 / 119; object-fit: contain; border-radius: 6px !important; }
@media (min-width: 768px) { html .header.ep3-header { left: 50%; right: auto; width: min(100%, 620px); transform: translateX(-50%); } }

/* content starts below the header on every page (home included) */
html .page-content.eatplan-content, html[data-journey-v2] .page-content.eatplan-content:not(.eatplan-home) {
  padding-top: calc(var(--ep3-header-h) + env(safe-area-inset-top) + 8px) !important;
}

/* in-app article summary spacing and Chinese-friendly meta */
.eatplan-live-article { padding: 0 20px; }
.eatplan-live-article .eatplan-live-status { color: #61766c; font-size: 13px; margin: 4px 0 12px; }
.eatplan-live-article .d-flex { gap: 10px !important; margin-bottom: 14px; align-items: center !important; flex-wrap: wrap; }
.eatplan-live-article .btn, .eatplan-wp-content-card .btn { min-height: 44px; display: inline-flex !important; align-items: center; justify-content: center; margin: 0 !important; padding: 0 18px !important; border-radius: 12px !important; }
.eatplan-wp-content-body { line-height: 1.8; color: #3f5149; }
/* data-bridge buttons: 44px targets, secondary buttons visibly outlined on white cards */
main .btn.btn-sm { min-height: 44px; display: inline-flex !important; align-items: center; justify-content: center; padding: 0 18px !important; border-radius: 12px !important; font-size: 14px !important; vertical-align: middle; }
main .btn.btn-sm.bg-theme { border: 1px solid var(--eatplan-line, #dce8e2) !important; }

/* ---- [EP4] 我的 ---- */
.ep-me { padding-bottom: 8px; }
.ep-me .ep-me-card { margin-bottom: 14px; }
.ep-me-who { display: flex; align-items: center; gap: 14px; }
.ep-me-who img { width: 52px; height: 52px; border-radius: 16px; flex: 0 0 52px; }
.ep-me-who h2 { font-size: 19px; margin: 0 0 2px; }
.ep-me-muted { color: #61766c; font-size: 13px; line-height: 1.6; margin: 0; }
.ep-me-balance { display: flex; gap: 12px; margin-top: 16px; }
.ep-me-balance > div { flex: 1; background: #f1f6f3; border-radius: 14px; padding: 10px 14px; display: flex; align-items: baseline; gap: 6px; }
.ep-me-balance strong { font-size: 24px; font-weight: 600; color: var(--eatplan-ink, #254b40); font-variant-numeric: tabular-nums; }
.ep-me-balance span { font-size: 13px; color: #61766c; }
.ep-me-notice { margin-top: 12px; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.ep-me-notice[hidden], .ep-me-balance[hidden], [data-ep-me-settings][hidden], .ep-me-actions[hidden] { display: none !important; }
.ep-me-actions { display: flex; gap: 10px; margin-top: 16px; }
.ep-me-actions .btn { flex: 1; }
.ep-me h3 { font-size: 16px; margin: 0 0 10px; }
.ep-me-rules, .ep-me-entries { list-style: none; margin: 0; padding: 0; }
.ep-me-rules li, .ep-me-entries li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px solid #edf3ef; font-size: 14px; }
.ep-me-rules li:last-child, .ep-me-entries li:last-child { border-bottom: 0; }
.ep-me-rules strong, .ep-me-entries strong { font-weight: 600; color: var(--eatplan-ink, #254b40); white-space: nowrap; }
.ep-me-entries strong.is-plus { color: #2f7a55; }
.ep-me-entry-what { display: flex; flex-direction: column; min-width: 0; }
.ep-me-entry-what span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ep-me-entry-what small { color: #8a9a92; font-size: 12px; }
.ep-me-ledger { margin-top: 10px; padding-top: 10px; border-top: 1px dashed #dce8e2; }
.ep-me-list { padding: 4px 0; overflow: hidden; }
html .ep-me-row { display: flex !important; align-items: center; gap: 12px; width: 100%; min-height: 56px; padding: 8px 16px !important; margin: 0 !important; border: 0 !important; border-radius: 0 !important; box-shadow: none !important; background: transparent !important; text-align: left; color: var(--eatplan-ink, #254b40) !important; text-decoration: none; }
.ep-me-row + .ep-me-row { border-top: 1px solid #edf3ef !important; }
.ep-me-row:active { background: rgba(37, 75, 64, .06) !important; }
.ep-me-ico { width: 36px; height: 36px; border-radius: 11px; background: #eaf3ee; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 36px; color: #3d7a5e; font-size: 15px; }
.ep-me-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ep-me-text strong { font-size: 15px; font-weight: 600; }
.ep-me-text small { font-size: 12px; color: #61766c; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ep-me-text small[hidden] { display: none; }
.ep-me-chev { color: #9fb2a8; }

/* [EP8] 全部功能 menu button: same 44x44 icon box as the other header icons; on 发现 it sits left of the logo */
html .header.ep3-header .ep8-menu-btn { background: transparent; border: 0; padding: 0; cursor: pointer; }
.ep3-home .ep3-left + .ep3-brand { padding-left: 2px; }

/* [E1] 智能导游 entry on 发现 + guide page */
.ep-guide-entry { display: block; text-decoration: none; color: var(--eatplan-ink, #254b40); border: 1px solid #cfe1d8; background: linear-gradient(135deg, #eef6f2, #ffffff); }
.ep-guide-entry .content { min-height: 64px; margin: 12px 16px; }
.ep-guide-entry-ico { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; flex: 0 0 44px; border-radius: 14px; background: #2f7d5b; color: #fff; font-size: 18px; }
.ep-guide-entry-text { display: flex; flex-direction: column; flex: 1 1 auto; min-width: 0; line-height: 1.3; }
.ep-guide-entry-text strong { font-size: 16px; font-weight: 600; }
.ep-guide-entry-text small { font-size: 12px; color: #61766c; }
.ep-guide-status { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border-radius: 12px; background: #fff7e8; border: 1px solid #f0dcb4; }
.ep-guide-status-mark { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; flex: 0 0 24px; border-radius: 50%; background: #c58a2b; color: #fff; font-weight: 700; font-size: 13px; }
.ep-guide-status p, .ep-guide-weather-status p { margin: 2px 0 0; font-size: 13px; }
.ep-guide-weather-status { margin-top: 10px; padding: 10px 12px; border-radius: 12px; background: #f2f6f4; font-size: 13px; }
.ep-guide-locate { min-height: 44px; }
.ep-guide-city-select { min-height: 44px; }

/* [E1] 智能导游 chat + voice */
.ep-guide-status[hidden], .ep-guide-chat [hidden] { display: none !important; }
.ep-guide-chat { margin-top: 12px; }
.ep-guide-chat[data-state="unavailable"] .ep-guide-form, .ep-guide-chat[data-state="login"] .ep-guide-form { display: none; }
.ep-guide-log { display: flex; flex-direction: column; gap: 8px; max-height: 50vh; overflow-y: auto; margin-bottom: 10px; }
.ep-guide-msg { padding: 10px 12px; border-radius: 14px; font-size: 14px; line-height: 1.55; white-space: pre-wrap; max-width: 88%; }
.ep-guide-msg-user { align-self: flex-end; background: #2f7d5b; color: #fff; border-bottom-right-radius: 4px; }
.ep-guide-msg-bot { align-self: flex-start; background: #f2f6f4; color: #254b40; border-bottom-left-radius: 4px; }
.ep-guide-msg.is-pending { opacity: .7; font-style: italic; }
.ep-guide-compose { display: flex; gap: 8px; align-items: center; }
.ep-guide-input { flex: 1 1 auto; min-height: 44px; min-width: 0; }
.ep-guide-mic, .ep-guide-send { flex: 0 0 44px; width: 44px; height: 44px; border-radius: 50%; border: 0; display: inline-flex; align-items: center; justify-content: center; font-size: 17px; }
.ep-guide-mic { background: #e7f1ed; color: #2f7d5b; }
.ep-guide-mic.is-listening { background: #c0392b; color: #fff; animation: ep-guide-pulse 1.2s ease-in-out infinite; }
.ep-guide-send { background: #2f7d5b; color: #fff; }
.ep-guide-mic:disabled, .ep-guide-send:disabled { opacity: .45; }
@keyframes ep-guide-pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(192,57,43,.45); } 50% { box-shadow: 0 0 0 8px rgba(192,57,43,0); } }
@media (prefers-reduced-motion: reduce) { .ep-guide-mic.is-listening { animation: none; } }
.ep-guide-tools { display: flex; gap: 8px; align-items: center; margin-top: 8px; }
.ep-guide-lang { min-height: 44px; border-radius: 10px; border: 1px solid #cfe1d8; padding: 0 8px; background: #fff; font-size: 13px; }
.ep-guide-speaker { min-height: 44px; min-width: 44px; border-radius: 22px; border: 1px solid #cfe1d8; background: #fff; color: #2f7d5b; padding: 0 12px; display: inline-flex; gap: 6px; align-items: center; font-size: 13px; }
.ep-guide-speaker[aria-pressed="false"] { color: #8a9a92; }
.ep-guide-voice-hint, .ep-guide-chat-note { font-size: 12px; color: #61766c; margin: 8px 0 0; }

/* [EP15] 4 tabs when the optional 行程 tab is on: equal widths */
#footer-bar.ep-tabs-4 a{flex:1 1 0;min-width:0}

/* [EP16] 关于与服务 + copyright at the bottom of the 全部功能 drawer (replaces the removed site footer) */
#menu-main .eatplan-menu-meta{margin:22px 0 0;padding:0 0 calc(18px + env(safe-area-inset-bottom,0px))}
#menu-main .eatplan-menu-meta-label{margin:0 0 4px;padding:0 4px;color:#60736d;font-size:12px;font-weight:700;letter-spacing:.04em}
#menu-main .eatplan-menu-meta-links{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));column-gap:14px;padding:0 4px;border-top:1px solid rgba(34,84,71,.12)}
#menu-main .eatplan-menu-meta-link{display:flex;align-items:center;gap:6px;min-width:0;min-height:44px;border-bottom:1px solid rgba(34,84,71,.08);color:#40564e;font-size:14px;line-height:1.3;text-decoration:none;white-space:nowrap}
#menu-main .eatplan-menu-meta-link i{position:static;margin-left:auto;font-size:12px;line-height:1;opacity:.55}
#menu-main .eatplan-menu-copy{margin:12px 0 0;padding:0 4px;color:#71817b;font-size:12px}

/* [EP17] Flat 全部功能 drawer (option eatplan_flat_menu): one list with icons, 48px rows, no groups */
#menu-main .eatplan-menu-content.is-flat .eatplan-menu-group{display:none!important}
#menu-main .eatplan-flat-menu{display:flex;flex-direction:column;margin:4px 0 0;border-top:1px solid rgba(34,84,71,.10)}
#menu-main .eatplan-flat-link{display:flex;align-items:center;gap:14px;min-height:52px;padding:0 6px;border-bottom:1px solid rgba(34,84,71,.08);color:var(--eatplan-ink,#254b40);font-size:16px;font-weight:600;text-decoration:none}
#menu-main .eatplan-flat-link:active{background:rgba(37,75,64,.06)}
#menu-main .eatplan-flat-link[aria-current="page"]{color:#2f7d5b}
#menu-main .eatplan-flat-ico{display:inline-flex;align-items:center;justify-content:center;flex:0 0 34px;width:34px;height:34px;border-radius:10px;background:#e7f1ed;color:#2f7d5b;font-size:15px;position:static!important;line-height:1}
#menu-main .eatplan-flat-link span{flex:1 1 auto;min-width:0}
#menu-main .eatplan-flat-chev{position:static!important;margin-left:auto;font-size:12px;opacity:.45}
#menu-main .eatplan-menu-content.is-flat .eatplan-menu-meta{margin-top:18px}
