:root {
  --panel: #f7f5ef;
  --panel-strong: #ebe7dd;
  --ink: #1d2422;
  --muted: #5f6963;
  --accent: #006d77;
  --accent-dark: #074f57;
  --map-bg: #d9ded7;
  --line: #d5d0c4;
  --white: #ffffff;
  font-family:
    "Noto Sans TC",
    "Microsoft JhengHei",
    system-ui,
    -apple-system,
    sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--map-bg);
}

.theme-expressway {
  --panel: #e7f3e5;
  --panel-strong: #cfe4c8;
  --accent: #16834a;
  --accent-dark: #0d5f33;
  --line: #afcaa5;
  --map-bg: #c8ddc2;
}

.theme-provincial {
  --panel: #e2f0fb;
  --panel-strong: #c4dff2;
  --accent: #176fb3;
  --accent-dark: #0c4d82;
  --line: #a6c9e3;
  --map-bg: #bfd7ea;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(320px, 420px) minmax(360px, 1fr);
}

.control-panel {
  z-index: 2;
  padding: 28px;
  background: var(--panel);
  border-right: 1px solid var(--line);
  box-shadow: 0 18px 50px rgb(31 45 37 / 18%);
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.theme-expressway .control-panel {
  background:
    linear-gradient(180deg, rgb(231 243 229 / 96%), rgb(213 232 207 / 96%)),
    var(--panel);
}

.theme-provincial .control-panel {
  background:
    linear-gradient(180deg, rgb(226 240 251 / 96%), rgb(207 226 241 / 96%)),
    var(--panel);
}

.brand {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.brand-mark {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--accent);
  color: var(--white);
  font-weight: 800;
}

.theme-expressway .brand-mark {
  background: #0f7a43;
}

.theme-provincial .brand-mark {
  background: #126aa5;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 24px;
  line-height: 1.28;
}

.brand p {
  color: var(--muted);
  margin-top: 8px;
  line-height: 1.55;
}

.seo-summary {
  border-left: 3px solid var(--accent);
  padding-left: 12px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.home-content {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgb(255 255 255 / 62%);
  padding: 14px;
  display: grid;
  gap: 10px;
}

.home-content h2 {
  color: var(--ink);
  font-size: 18px;
}

.home-content p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

.page-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.page-tabs a {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: var(--white);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  text-align: center;
  text-decoration: none;
  font-size: 14px;
  font-weight: 800;
}

.page-tabs a.active {
  color: var(--white);
  border-color: var(--accent);
  background: var(--accent);
}

.language-switch {
  align-self: flex-end;
  margin-top: -14px;
  color: var(--accent-dark);
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
}

.language-switch:hover {
  text-decoration: underline;
}

.theme-expressway .page-tabs a.active,
.theme-expressway button,
.theme-expressway .primary-link {
  background: #16834a;
}

.theme-provincial .page-tabs a.active,
.theme-provincial button,
.theme-provincial .primary-link {
  background: #176fb3;
}

.theme-expressway button:hover,
.theme-expressway .primary-link:hover {
  background: #0d5f33;
}

.theme-provincial button:hover,
.theme-provincial .primary-link:hover {
  background: #0c4d82;
}

.search-form {
  display: grid;
  gap: 16px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

select,
input,
button {
  width: 100%;
  min-height: 44px;
  border-radius: 8px;
  border: 1px solid var(--line);
  font: inherit;
}

select,
input {
  background: var(--white);
  color: var(--ink);
  padding: 0 12px;
}

.mileage-input {
  display: grid;
  grid-template-columns: 1fr 58px;
  align-items: center;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.mileage-input input {
  border: 0;
  border-radius: 0;
}

.mileage-input span {
  color: var(--muted);
  font-weight: 700;
  text-align: center;
  border-left: 1px solid var(--line);
}

button,
.primary-link,
.secondary-link {
  border: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 14px;
  border-radius: 8px;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

button,
.primary-link {
  background: var(--accent);
  color: var(--white);
}

button:hover,
.primary-link:hover {
  background: var(--accent-dark);
}

.secondary-link {
  background: var(--panel-strong);
  color: var(--ink);
}

.secondary-link:hover {
  background: #ded8cb;
}

.result-panel,
.data-note {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgb(255 255 255 / 70%);
}

.result-panel {
  padding: 18px;
  display: grid;
  gap: 16px;
}

.eyebrow {
  display: block;
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  margin-bottom: 6px;
}

#resultTitle {
  font-size: 20px;
}

#resultMeta {
  color: var(--muted);
  margin-top: 8px;
  line-height: 1.6;
}

.actions {
  display: grid;
  gap: 10px;
}

.streetview-note {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.data-note {
  padding: 14px;
  margin-top: auto;
  display: grid;
  gap: 6px;
  color: var(--muted);
  line-height: 1.5;
}

.data-note strong {
  color: var(--ink);
}

.data-note a {
  color: var(--accent-dark);
  font-weight: 800;
}

.view-counter {
  color: var(--accent-dark);
  font-weight: 900;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  padding-top: 4px;
}

.footer-links a {
  font-size: 13px;
}

.content-page {
  min-height: 100vh;
  background: var(--panel);
  color: var(--ink);
}

.content-shell {
  width: min(920px, calc(100% - 32px));
  margin: 0 auto;
  padding: 40px 0;
}

.content-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 24px;
}

.content-nav a {
  color: var(--accent-dark);
  font-weight: 800;
}

.content-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgb(255 255 255 / 78%);
  padding: 28px;
}

.content-card h1 {
  margin-bottom: 12px;
}

.content-card h2 {
  margin-top: 28px;
  margin-bottom: 10px;
  font-size: 20px;
}

.content-card p,
.content-card li {
  color: var(--muted);
  line-height: 1.75;
}

.content-card ul {
  padding-left: 20px;
}

.content-card a {
  color: var(--accent-dark);
  font-weight: 800;
}

.map-area,
#map {
  min-height: 100vh;
}

.map-area {
  position: relative;
}

#map {
  width: 100%;
  height: 100%;
}

.address-search {
  position: absolute;
  top: 16px;
  left: 50%;
  z-index: 5;
  width: min(520px, calc(100% - 32px));
  transform: translateX(-50%);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgb(255 255 255 / 94%);
  box-shadow: 0 10px 30px rgb(0 0 0 / 16%);
  padding: 10px;
}

.address-search-row {
  display: grid;
  grid-template-columns: 1fr 112px;
  gap: 8px;
}

.address-search input,
.address-search button {
  min-height: 40px;
}

.address-search p {
  margin-top: 7px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.address-search a {
  color: var(--accent-dark);
  font-weight: 800;
}

.loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  background: rgb(23 31 28 / 34%);
  backdrop-filter: blur(2px);
  transition:
    opacity 180ms ease,
    visibility 180ms ease;
}

.loading-overlay.hidden {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

.loading-box {
  width: min(320px, calc(100vw - 40px));
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgb(255 255 255 / 94%);
  box-shadow: 0 18px 50px rgb(0 0 0 / 22%);
  padding: 22px;
  display: grid;
  gap: 8px;
  text-align: center;
}

.loading-box strong {
  color: var(--accent-dark);
  font-size: 20px;
}

.loading-box span {
  color: var(--muted);
  line-height: 1.5;
}

.loading-overlay.error .loading-box {
  border-color: #bf4a43;
}

.loading-overlay.error .loading-box strong {
  color: #9f2f2a;
}

.marker {
  width: 18px;
  height: 18px;
  border: 3px solid var(--white);
  border-radius: 50%;
  background: #c7352d;
  box-shadow: 0 4px 16px rgb(0 0 0 / 28%);
}

.address-marker {
  width: 22px;
  height: 22px;
  border: 3px solid var(--white);
  border-radius: 50% 50% 50% 0;
  background: #176fb3;
  box-shadow: 0 4px 16px rgb(0 0 0 / 30%);
  transform: rotate(-45deg);
}

.address-marker::after {
  content: "";
  position: absolute;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--white);
  inset: 5px;
}

@media (max-width: 820px) {
  .app-shell {
    min-height: 100dvh;
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(420px, 1fr) auto;
  }

  .control-panel {
    padding: 18px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .map-area,
  #map {
    min-height: 420px;
  }

  .address-search {
    top: 12px;
    width: calc(100% - 24px);
  }

  .address-search-row {
    grid-template-columns: 1fr;
  }

}

/* Editorial Content Portal & Article Layout (Blue Theme matching Portal) */
.portal-page {
  --panel: #f1f4f9;
  --accent: #1d4ed8;
  --accent-dark: #0f3d91;
  --line: #d5dfec;
  min-height: 100vh;
  background: #f1f4f9;
  color: #182230;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgb(255 255 255 / 96%);
  border-bottom: 2px solid #1d4ed8;
  backdrop-filter: blur(8px);
}

.site-header-inner {
  width: min(1080px, calc(100% - 32px));
  margin: 0 auto;
  min-height: 64px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 20px;
  padding: 10px 0;
}

.site-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
  font-weight: 800;
  font-size: 18px;
}

.site-brand-badge {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 6px;
  background: #1d4ed8;
  color: var(--white);
  font-size: 13px;
  letter-spacing: 0.04em;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  align-items: center;
}

.site-nav a {
  text-decoration: none;
  color: #1e293b;
  font-size: 14px;
  font-weight: 700;
  padding: 6px 8px;
  border-radius: 4px;
}

.site-nav a:hover,
.site-nav a.active {
  color: #1d4ed8;
  background: #eff6ff;
}

.portal-main {
  width: min(1080px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0 56px;
  display: grid;
  gap: 40px;
}

.portal-hero {
  background: linear-gradient(135deg, #ffffff 0%, #e7f3e5 100%);
  border: 1px solid #cfe0ce;
  border-radius: 12px;
  padding: 36px 32px;
  display: grid;
  gap: 16px;
}

.portal-kicker {
  display: inline-block;
  width: fit-content;
  padding: 4px 10px;
  border-radius: 999px;
  background: #0d5f33;
  color: var(--white);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.portal-hero h1 {
  margin: 0;
  font-size: clamp(26px, 3.6vw, 36px);
  line-height: 1.25;
  color: #14221a;
}

.portal-hero p {
  margin: 0;
  max-width: 72ch;
  color: #3f4d45;
  font-size: 16px;
  line-height: 1.7;
}

.portal-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 6px;
}

.btn-primary,
.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
}

.btn-primary {
  background: #0d5f33;
  color: var(--white);
}

.btn-primary:hover {
  background: #094726;
}

.btn-secondary {
  background: var(--white);
  color: #0d5f33;
  border: 1px solid #9dc1a5;
}

.btn-secondary:hover {
  background: #f1f8f0;
}

.portal-section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 18px;
}

.portal-section-head h2 {
  margin: 0;
  font-size: 22px;
  color: #14221a;
}

.portal-section-head span {
  color: var(--muted);
  font-size: 14px;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
}

.editorial-card {
  background: var(--white);
  border: 1px solid #dde4dd;
  border-radius: 10px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: 0 2px 10px rgb(0 0 0 / 3%);
}

.card-tag {
  display: inline-block;
  width: fit-content;
  font-size: 12px;
  font-weight: 800;
  color: #0d5f33;
  background: #e7f3e5;
  padding: 3px 9px;
  border-radius: 999px;
}

.editorial-card h3 {
  margin: 0;
  font-size: 18px;
  line-height: 1.4;
}

.editorial-card h3 a {
  color: #14221a;
  text-decoration: none;
}

.editorial-card h3 a:hover {
  color: #0d5f33;
  text-decoration: underline;
}

.editorial-card p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
  flex: 1;
}

.card-link {
  color: #0d5f33;
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
  margin-top: 4px;
}

.card-link:hover {
  text-decoration: underline;
}

.author-box {
  background: var(--white);
  border: 1px solid #dde4dd;
  border-radius: 10px;
  padding: 24px 28px;
  display: grid;
  gap: 10px;
}

.author-box h2 {
  margin: 0;
  font-size: 20px;
}

.author-box p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
  font-size: 15px;
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.site-footer {
  border-top: 1px solid #d5dfec;
  background: var(--white);
  padding: 24px 0 36px;
}

.site-footer-inner {
  width: min(1080px, calc(100% - 32px));
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px 24px;
  color: var(--muted);
  font-size: 13px;
}

.site-footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
}

.site-footer-links a {
  color: #1d4ed8;
  font-weight: 700;
  text-decoration: none;
}

.site-footer-links a:hover {
  text-decoration: underline;
}

@media (max-width: 640px) {
  .portal-hero {
    padding: 24px 18px;
  }
}

/* Yahoo-style Blue Portal Homepage */
.yp-page {
  min-height: 100vh;
  background: #f1f4f9;
  color: #182230;
}

.yp-topbar {
  background: #0f3d91;
  color: #ffffff;
  font-size: 12px;
}

.yp-topbar-inner {
  width: min(1160px, calc(100% - 24px));
  margin: 0 auto;
  min-height: 34px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  padding: 4px 0;
}

.yp-topbar a {
  color: #dbeafe;
  text-decoration: none;
  font-weight: 600;
}

.yp-topbar a:hover {
  color: #ffffff;
  text-decoration: underline;
}

.yp-topbar-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.yp-header {
  background: #ffffff;
  border-bottom: 2px solid #1d4ed8;
}

.yp-header-inner {
  width: min(1160px, calc(100% - 24px));
  margin: 0 auto;
  padding: 14px 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
}

.yp-logo {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  text-decoration: none;
  color: #1d4ed8;
  font-weight: 900;
  font-size: 28px;
  letter-spacing: -0.02em;
}

.yp-logo small {
  font-size: 13px;
  font-weight: 700;
  color: #475569;
  letter-spacing: 0;
}

.yp-search {
  display: flex;
  max-width: 520px;
  width: 100%;
}

.yp-search input {
  flex: 1;
  min-height: 38px;
  border: 2px solid #1d4ed8;
  border-right: 0;
  border-radius: 4px 0 0 4px;
  padding: 6px 12px;
  font-size: 14px;
  outline: none;
}

.yp-search button {
  min-height: 38px;
  padding: 0 18px;
  border: 2px solid #1d4ed8;
  border-radius: 0 4px 4px 0;
  background: #1d4ed8;
  color: #ffffff;
  font-weight: 800;
  font-size: 14px;
  cursor: pointer;
}

.yp-search button:hover {
  background: #1e40af;
}

.yp-header-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.yp-header-cta a {
  text-decoration: none;
  font-size: 13px;
  font-weight: 800;
  padding: 7px 12px;
  border-radius: 4px;
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}

.yp-header-cta a:hover {
  background: #dbeafe;
}

.yp-lang-switch {
  display: inline-flex;
  border: 1px solid #1d4ed8;
  border-radius: 4px;
  overflow: hidden;
  background: #ffffff;
}

.yp-lang-btn {
  width: auto;
  min-height: 0;
  flex: 0 0 auto;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #1d4ed8;
  font-size: 12.5px;
  font-weight: 800;
  padding: 6px 10px;
  cursor: pointer;
  white-space: nowrap;
}

.yp-lang-btn.active {
  background: #1d4ed8;
  color: #ffffff;
}

.yp-subnav {
  background: #1e40af;
}

.yp-subnav-inner {
  width: min(1160px, calc(100% - 24px));
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.yp-subnav a {
  color: #eff6ff;
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
  padding: 9px 14px;
}

.yp-subnav a:hover,
.yp-subnav a.active {
  background: #1d4ed8;
  color: #ffffff;
}

.yp-container {
  width: min(1160px, calc(100% - 24px));
  margin: 18px auto 36px;
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr) 280px;
  gap: 16px;
  align-items: start;
}

.yp-center,
.yp-left,
.yp-right {
  min-width: 0;
}

.yp-box {
  background: #ffffff;
  border: 1px solid #d5dfec;
  border-radius: 4px;
  padding: 14px;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

.yp-box + .yp-box {
  margin-top: 14px;
}

.yp-box-title {
  margin: 0 0 10px;
  padding-bottom: 8px;
  border-bottom: 2px solid #1d4ed8;
  font-size: 15px;
  font-weight: 800;
  color: #0f3d91;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.yp-box-title span {
  font-size: 11px;
  font-weight: 700;
  color: #64748b;
}

.yp-menu {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 4px;
}

.yp-menu a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 8px;
  border-radius: 4px;
  text-decoration: none;
  color: #1e293b;
  font-size: 13px;
  font-weight: 700;
}

.yp-menu a:hover {
  background: #eff6ff;
  color: #1d4ed8;
}

.yp-menu small {
  font-size: 11px;
  color: #64748b;
  font-weight: 600;
}

.yp-headline {
  display: grid;
  gap: 8px;
  padding-bottom: 14px;
  margin-bottom: 12px;
  border-bottom: 1px solid #e2e8f0;
}

.yp-headline-badge {
  display: inline-block;
  width: fit-content;
  background: #1d4ed8;
  color: #ffffff;
  font-size: 11px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 3px;
}

.yp-headline h1 {
  margin: 0;
  font-size: 21px;
  line-height: 1.35;
}

.yp-headline h1 a {
  color: #0f172a;
  text-decoration: none;
}

.yp-headline h1 a:hover {
  color: #1d4ed8;
  text-decoration: underline;
}

.yp-headline p {
  margin: 0;
  color: #475569;
  font-size: 14px;
  line-height: 1.6;
}

.yp-news-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  min-width: 0;
  width: 100%;
}

.yp-news-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 8px 10px;
  align-items: baseline;
  padding: 9px 4px;
  border-bottom: 1px dashed #e2e8f0;
  font-size: 14px;
  min-width: 0;
  width: 100%;
}

.yp-news-item:last-child {
  border-bottom: 0;
}

.yp-cat {
  display: inline-block;
  max-width: 185px;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 11px;
  font-weight: 800;
  color: #1d4ed8;
  background: #eff6ff;
  border: 1px solid #dbeafe;
  padding: 1px 6px;
  border-radius: 3px;
  white-space: nowrap;
}

.yp-news-item a {
  color: #1e293b;
  text-decoration: none;
  font-weight: 700;
  font-size: clamp(13.5px, 1.15vw, 15px);
  line-height: 1.45;
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.yp-news-item a:hover {
  color: #1d4ed8;
  text-decoration: underline;
}

.yp-date {
  font-size: 12px;
  color: #64748b;
  white-space: nowrap;
}

.yp-abstract {
  grid-column: 1 / -1;
  margin: 2px 0 0;
  color: #475569;
  font-size: 13px;
  line-height: 1.55;
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.yp-abstract-more {
  grid-column: 1 / -1;
  font-size: 12px;
  color: #1d4ed8;
  min-width: 0;
}

.yp-abstract-more summary {
  cursor: pointer;
  font-weight: 700;
  list-style: none;
}

.yp-abstract-more p {
  margin: 6px 0 0;
  color: #475569;
  font-size: 13px;
  line-height: 1.6;
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.yp-zh-intro {
  grid-column: 1 / -1;
  margin: 4px 0 0;
  color: #1e293b;
  font-size: 13px;
  line-height: 1.6;
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.yp-highlights {
  grid-column: 1 / -1;
  margin: 4px 0 2px;
  padding-left: 18px;
  color: #0f3d91;
  font-size: 12.5px;
  line-height: 1.55;
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.yp-highlights li {
  margin-bottom: 2px;
}

.yp-hero-visual {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 14px;
  align-items: center;
  padding-bottom: 14px;
  margin-bottom: 14px;
  border-bottom: 1px solid #e2e8f0;
}

.yp-hero-img-link {
  display: block;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid #cbd5e1;
  background: #0f172a;
}

.yp-hero-img-link img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  transition: transform 180ms ease;
}

.yp-hero-img-link:hover img {
  transform: scale(1.03);
}

.yp-featured-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  padding-bottom: 14px;
  margin-bottom: 14px;
  border-bottom: 1px solid #e2e8f0;
}

.yp-featured-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-decoration: none;
  color: #0f172a;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  overflow: hidden;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.yp-featured-card:hover {
  border-color: #1d4ed8;
  box-shadow: 0 4px 12px rgb(29 78 216 / 10%);
}

.yp-featured-card img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 10;
  object-fit: cover;
}

.yp-featured-card strong {
  padding: 0 8px 8px;
  font-size: 12.5px;
  line-height: 1.4;
  color: #1e293b;
}

.yp-featured-card:hover strong {
  color: #1d4ed8;
}

.yp-news-item.has-thumb {
  grid-template-columns: 96px auto minmax(0, 1fr) auto;
  align-items: start;
}

.yp-item-thumb-link {
  grid-row: 1 / span 2;
  display: block;
  width: 96px;
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid #cbd5e1;
}

.yp-item-thumb-link img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 10;
  object-fit: cover;
}

.yp-news-item.has-thumb .yp-abstract {
  grid-column: 2 / -1;
}

@media (max-width: 720px) {
  .yp-hero-visual {
    grid-template-columns: 1fr;
  }
  .yp-featured-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .yp-news-item.has-thumb {
    grid-template-columns: 80px auto 1fr;
  }
}

/* Yahoo Taiwan Top Banner + Tabs + Left Overlay Card / Right News Split */
.yp-top-banner {
  position: relative;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid #cbd5e1;
  margin-bottom: 14px;
  background: #0b2559;
  color: #ffffff;
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  min-height: 170px;
}

.yp-top-banner-copy {
  padding: 18px 20px 18px 46px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(90deg, #0b2559 0%, #1e3a8a 90%, rgb(30 58 138 / 85%) 100%);
  z-index: 2;
}

.yp-top-banner-kicker {
  display: inline-block;
  width: fit-content;
  background: #facc15;
  color: #0f172a;
  font-size: 11px;
  font-weight: 900;
  padding: 2px 8px;
  border-radius: 3px;
}

.yp-top-banner-copy h2 {
  margin: 0;
  font-size: clamp(17px, 1.7vw, 21px);
  line-height: 1.32;
  color: #ffffff;
}

.yp-top-banner-copy p {
  margin: 0;
  font-size: clamp(12px, 1.1vw, 13.5px);
  color: #dbeafe;
  line-height: 1.5;
}

.yp-top-banner-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.yp-top-banner-actions a {
  text-decoration: none;
  font-size: 12.5px;
  font-weight: 800;
  padding: 6px 12px;
  border-radius: 4px;
  background: #ffffff;
  color: #0f3d91;
}

.yp-top-banner-actions a.alt {
  background: rgb(255 255 255 / 16%);
  color: #ffffff;
  border: 1px solid rgb(255 255 255 / 40%);
}

.yp-top-banner-photos {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
  background: #0f172a;
}

.yp-top-banner-photos img {
  width: 100%;
  height: 100%;
  max-height: 190px;
  object-fit: cover;
  display: block;
}

.yp-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding-bottom: 10px;
  margin-bottom: 14px;
  border-bottom: 2px solid #e2e8f0;
}

.yp-inline-search {
  display: grid;
  gap: 8px;
  padding: 10px 12px;
  margin-bottom: 12px;
  background: #f8fafc;
  border: 1px solid #dbeafe;
  border-radius: 6px;
}

.yp-inline-search-row {
  display: flex;
  align-items: stretch;
  width: 100%;
}

.yp-inline-search-row input {
  width: auto;
  min-width: 0;
  flex: 1 1 auto;
  min-height: 36px;
  padding: 6px 12px;
  border: 1px solid #93c5fd;
  border-right: 0;
  border-radius: 4px 0 0 4px;
  font-size: clamp(13px, 1.1vw, 14px);
  background: #ffffff;
  outline: none;
}

.yp-inline-search-row button {
  width: auto;
  min-height: 36px;
  flex: 0 0 auto;
  padding: 0 16px;
  border: 1px solid #1d4ed8;
  border-radius: 0 4px 4px 0;
  background: #1d4ed8;
  color: #ffffff;
  font-size: clamp(12.5px, 1.05vw, 13.5px);
  font-weight: 800;
  white-space: nowrap;
  cursor: pointer;
}

.yp-hot-tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: clamp(11.5px, 1vw, 12.5px);
  color: #475569;
}

.yp-hot-tag {
  width: auto;
  min-height: 0;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  border: 1px solid #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
  border-radius: 999px;
  padding: 4px 11px;
  font-size: clamp(11.5px, 1vw, 12.5px);
  font-weight: 700;
  line-height: 1.3;
  white-space: nowrap;
  cursor: pointer;
}

.yp-hot-tag:hover {
  background: #dbeafe;
  color: #1e40af;
}

.yp-tab {
  text-decoration: none;
  font-size: 14px;
  font-weight: 800;
  color: #334155;
  padding: 5px 12px;
  border-radius: 6px;
}

.yp-tab:hover {
  background: #eff6ff;
  color: #1d4ed8;
}

.yp-tab.active {
  background: #0f172a;
  color: #ffffff;
}

.yp-yahoo-split {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  padding-bottom: 16px;
  margin-bottom: 16px;
  border-bottom: 1px solid #e2e8f0;
}

.yp-yahoo-left {
  min-width: 0;
}

.yp-overlay-card {
  position: relative;
  display: block;
  border-radius: 8px;
  overflow: hidden;
  background: #0f172a;
  text-decoration: none;
  margin-bottom: 10px;
  border: 1px solid #cbd5e1;
}

.yp-overlay-card img {
  display: block;
  width: 100%;
  height: 200px;
  object-fit: cover;
  transition: transform 200ms ease;
}

.yp-overlay-card:hover img {
  transform: scale(1.03);
}

.yp-overlay-caption {
  position: absolute;
  inset: auto 0 0 0;
  padding: 28px 14px 12px;
  background: linear-gradient(180deg, rgb(15 23 42 / 0%) 0%, rgb(15 23 42 / 88%) 48%, rgb(15 23 42 / 96%) 100%);
  color: #ffffff;
}

.yp-overlay-caption strong {
  display: block;
  font-size: clamp(14.5px, 1.4vw, 17px);
  line-height: 1.35;
}

.yp-sub-thumb-list {
  display: grid;
  gap: 10px;
}

.yp-sub-thumb-item {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  text-decoration: none;
}

.yp-sub-thumb-item > div {
  min-width: 0;
}

.yp-sub-thumb-item img {
  width: 92px;
  height: 62px;
  object-fit: cover;
  border-radius: 5px;
  border: 1px solid #cbd5e1;
  display: block;
}

.yp-sub-thumb-item strong {
  display: block;
  font-size: 13.5px;
  color: #0f172a;
  line-height: 1.35;
  margin-bottom: 2px;
}

.yp-sub-thumb-item:hover strong {
  color: #1d4ed8;
  text-decoration: underline;
}

.yp-sub-thumb-item span {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 12px;
  color: #64748b;
  line-height: 1.4;
}

.yp-stack-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 11px;
  min-width: 0;
}

.yp-stack-item {
  min-width: 0;
}

.yp-stack-item a {
  display: block;
  text-decoration: none;
}

.yp-stack-item strong {
  display: block;
  font-size: 14px;
  color: #0f172a;
  line-height: 1.38;
  margin-bottom: 2px;
}

.yp-stack-item a:hover strong {
  color: #1d4ed8;
  text-decoration: underline;
}

.yp-stack-item span {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 12px;
  color: #64748b;
  line-height: 1.45;
}

.yp-tool-showcase-card {
  display: block;
  text-decoration: none;
  border: 1px solid #d5dfec;
  border-radius: 6px;
  overflow: hidden;
  background: #f8fafc;
  margin-top: 10px;
}

.yp-tool-showcase-card img {
  display: block;
  width: 100%;
  height: 130px;
  object-fit: cover;
  border-bottom: 1px solid #e2e8f0;
}

.yp-tool-showcase-body {
  padding: 9px 10px;
}

.yp-tool-showcase-body strong {
  display: block;
  font-size: 13.5px;
  color: #0f3d91;
  margin-bottom: 3px;
}

.yp-tool-showcase-body span {
  display: block;
  font-size: 12px;
  color: #475569;
  line-height: 1.45;
}

/* Dynamic Carousel Banner (Left/Right Auto & Manual Switch) */
.yp-carousel {
  position: relative;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid #cbd5e1;
  margin-bottom: 14px;
  background: #0b2559;
  color: #ffffff;
  min-height: 196px;
}

.yp-carousel-slide {
  display: none;
  grid-template-columns: 1.18fr 1fr;
  min-height: 224px;
  align-items: stretch;
}

.yp-carousel-slide.active {
  display: grid;
}

.yp-carousel-photo {
  position: relative;
  background: #0f172a;
  overflow: hidden;
}

.yp-carousel-photo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.yp-carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 5;
  width: 34px;
  height: 34px;
  min-height: 0;
  padding: 0;
  border-radius: 50%;
  border: 1px solid rgb(255 255 255 / 45%);
  background: rgb(15 23 42 / 65%);
  color: #ffffff;
  font-size: 20px;
  font-weight: 900;
  line-height: 1;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.yp-carousel-btn:hover {
  background: #1d4ed8;
}

.yp-carousel-btn.prev {
  left: 8px;
}

.yp-carousel-btn.next {
  right: 8px;
}

.yp-carousel-dots {
  position: absolute;
  bottom: 8px;
  right: 14px;
  z-index: 5;
  display: flex;
  gap: 6px;
}

.yp-carousel-dot {
  width: 9px;
  height: 9px;
  min-height: 0;
  padding: 0;
  border-radius: 50%;
  border: 1px solid #ffffff;
  background: rgb(255 255 255 / 35%);
  cursor: pointer;
}

.yp-carousel-dot.active {
  background: #facc15;
  border-color: #facc15;
  transform: scale(1.15);
}

.yp-main-paper-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 12px;
}

.yp-main-paper-tab {
  width: 100%;
  min-height: 42px;
  padding: 8px 14px;
  border-radius: 6px;
  border: 2px solid #bfdbfe;
  background: #eff6ff;
  color: #0f3d91;
  font-size: clamp(13.5px, 1.2vw, 15.5px);
  font-weight: 800;
  cursor: pointer;
  text-align: center;
  transition: background 150ms ease, color 150ms ease, border-color 150ms ease;
}

.yp-main-paper-tab:hover {
  background: #dbeafe;
}

.yp-main-paper-tab.active {
  background: #1d4ed8;
  border-color: #1d4ed8;
  color: #ffffff;
}

.yp-topic-bar {
  display: grid;
  gap: 8px;
  padding: 12px;
  margin-bottom: 12px;
  background: linear-gradient(135deg, #eff6ff 0%, #f8fafc 100%);
  border: 1px solid #bfdbfe;
  border-radius: 6px;
}

.yp-topic-bar-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  font-size: 13px;
  font-weight: 800;
  color: #0f3d91;
}

.yp-topic-bar-head small {
  font-size: 12px;
  font-weight: 600;
  color: #475569;
}

.yp-topic-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.yp-topic-pill {
  width: auto;
  min-height: 36px;
  flex: 1 1 auto;
  padding: 6px 12px;
  border-radius: 6px;
  border: 1.5px solid #93c5fd;
  background: #ffffff;
  color: #1e3a8a;
  font-size: clamp(12.5px, 1.05vw, 13.5px);
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
  text-align: center;
  transition: all 140ms ease;
}

.yp-topic-pill:hover {
  background: #dbeafe;
  border-color: #1d4ed8;
}

.yp-topic-pill.active {
  background: #0f3d91;
  border-color: #0f3d91;
  color: #ffffff;
  box-shadow: 0 2px 8px rgb(15 61 145 / 22%);
}

@media (max-width: 820px) {
  .yp-top-banner,
  .yp-carousel-slide.active,
  .yp-yahoo-split {
    grid-template-columns: 1fr;
  }
}

.yp-quick-form {
  display: grid;
  gap: 8px;
}

.yp-quick-form p {
  margin: 0;
  font-size: 13px;
  color: #475569;
  line-height: 1.5;
}

.yp-quick-btn {
  display: block;
  text-align: center;
  padding: 9px 12px;
  border-radius: 4px;
  background: #1d4ed8;
  color: #ffffff;
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}

.yp-quick-btn:hover {
  background: #1e40af;
}

.yp-quick-btn.secondary {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}

.yp-quick-btn.secondary:hover {
  background: #dbeafe;
}

.yp-profile-card p {
  margin: 0 0 8px;
  font-size: 13px;
  color: #475569;
  line-height: 1.6;
}

.yp-footer {
  background: #ffffff;
  border-top: 1px solid #d5dfec;
  padding: 20px 0 32px;
  font-size: 13px;
  color: #475569;
}

.yp-footer-inner {
  width: min(1160px, calc(100% - 24px));
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px 20px;
}

.yp-footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.yp-footer-links a {
  color: #1d4ed8;
  font-weight: 700;
  text-decoration: none;
}

.yp-footer-links a:hover {
  text-decoration: underline;
}

@media (max-width: 980px) {
  .yp-container {
    grid-template-columns: 1fr 280px;
  }
  .yp-left {
    grid-column: 1 / -1;
  }
}

@media (max-width: 720px) {
  .yp-header-inner {
    grid-template-columns: 1fr;
  }
  .yp-container {
    grid-template-columns: 1fr;
  }
  .yp-news-item {
    grid-template-columns: auto 1fr;
  }
  .yp-date {
    display: none;
  }
}
