:root {
  --paper: #fffdf8;
  --paper-2: #f7f1ed;
  --ink: #22302c;
  --muted: #65716d;
  --line: #e7ded8;
  --rose: #e1a5bf;
  --rose-soft: #f6e4ec;
  --teal: #29a38d;
  --sky: #139fd0;
  --brown: #725f52;
  --leaf: #6a8f3a;
  --danger: #b64848;
  --shadow: 0 22px 70px rgba(34, 48, 44, 0.12);
  --radius: 8px;
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", system-ui, sans-serif;
  letter-spacing: 0;
}

body,
button,
input,
select,
textarea {
  font-size: 16px;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

:focus-visible {
  outline: 3px solid rgba(19, 159, 208, 0.55);
  outline-offset: 3px;
}

.hidden {
  display: none !important;
}

.sr-only {
  height: 1px;
  left: -10000px;
  overflow: hidden;
  position: absolute;
  top: auto;
  width: 1px;
}

.site-header {
  align-items: center;
  background: rgba(255, 253, 248, 0.94);
  border-bottom: 1px solid rgba(231, 222, 216, 0.8);
  display: flex;
  gap: 24px;
  justify-content: space-between;
  left: 0;
  min-height: 78px;
  padding: 14px min(5vw, 64px);
  position: sticky;
  right: 0;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(18px);
}

.brand {
  align-items: center;
  display: inline-flex;
  gap: 12px;
  min-width: 0;
}

.brand-logo {
  display: block;
  height: auto;
  max-height: 58px;
  object-fit: contain;
  width: 178px;
}

.brand-mark {
  align-items: center;
  background:
    radial-gradient(circle at 32% 28%, #ffffff 0 12%, transparent 13%),
    linear-gradient(135deg, var(--rose), var(--teal));
  border-radius: 50%;
  color: #ffffff;
  display: inline-flex;
  flex: 0 0 46px;
  font-family: "Noto Serif TC", "Songti TC", serif;
  font-size: 1.35rem;
  font-weight: 800;
  height: 46px;
  justify-content: center;
  width: 46px;
}

.brand strong,
.brand small {
  display: block;
  line-height: 1.2;
}

.brand strong {
  font-size: 1.05rem;
}

.brand small {
  color: var(--muted);
  font-size: 0.78rem;
  margin-top: 3px;
}

.site-nav {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.site-nav a {
  border-radius: 999px;
  color: #32413d;
  font-size: 0.92rem;
  padding: 10px 12px;
}

.site-nav a:hover {
  background: var(--rose-soft);
  color: var(--brown);
}

.site-nav .admin-link {
  background: #22302c;
  color: #ffffff;
}

.nav-toggle {
  background: transparent;
  border: 0;
  display: none;
  flex-direction: column;
  gap: 5px;
  height: 42px;
  justify-content: center;
  width: 42px;
}

.nav-toggle span {
  background: var(--ink);
  border-radius: 10px;
  display: block;
  height: 2px;
  width: 24px;
}

.hero {
  align-items: flex-end;
  background:
    linear-gradient(90deg, rgba(34, 48, 44, 0.77), rgba(34, 48, 44, 0.33) 58%, rgba(225, 165, 191, 0.1)),
    var(--hero-image, url("https://www.hoorayhomecare.com.tw/upload/banner/20230523171345t0p5h.jpg")) center / cover no-repeat;
  color: #ffffff;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 420px);
  min-height: 68vh;
  overflow: hidden;
  padding: 96px min(5vw, 64px) 54px;
  position: relative;
}

.hero-scrim {
  background:
    linear-gradient(180deg, transparent, rgba(34, 48, 44, 0.55)),
    repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.08) 0 1px, transparent 1px 18px);
  inset: 0;
  opacity: 0.38;
  pointer-events: none;
  position: absolute;
}

.hero-content {
  max-width: 820px;
  position: relative;
  z-index: 1;
}

.eyebrow,
.section-heading span,
.about-copy span,
.recruit-section span,
.contact-card span,
.admin-topbar span {
  color: var(--rose);
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.hero h1 {
  font-family: "Noto Serif TC", "Songti TC", serif;
  font-size: 3.55rem;
  font-weight: 800;
  line-height: 1.12;
  margin: 14px 0 22px;
  max-width: 780px;
  text-wrap: balance;
}

.hero p {
  color: rgba(255, 255, 255, 0.88);
  font-size: 1.08rem;
  line-height: 1.8;
  margin: 0;
  max-width: 690px;
}

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

.button {
  align-items: center;
  border: 1px solid transparent;
  border-radius: 999px;
  display: inline-flex;
  font-weight: 800;
  justify-content: center;
  min-height: 44px;
  padding: 11px 18px;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button.primary {
  background: var(--teal);
  box-shadow: 0 12px 32px rgba(41, 163, 141, 0.28);
  color: #ffffff;
}

.button.secondary {
  background: var(--ink);
  color: #ffffff;
}

.button.ghost {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.42);
  color: #ffffff;
}

.hero-rail {
  align-self: end;
  display: grid;
  gap: 10px;
  position: relative;
  z-index: 1;
}

.hero-rail div {
  background: rgba(255, 253, 248, 0.88);
  border-left: 4px solid var(--rose);
  border-radius: var(--radius);
  color: var(--ink);
  padding: 16px 18px;
}

.hero-rail strong,
.hero-rail span {
  display: block;
}

.hero-rail strong {
  color: var(--brown);
  font-size: 1.25rem;
}

.hero-rail span {
  color: var(--muted);
  margin-top: 4px;
}

.section {
  padding: 82px min(5vw, 64px);
}

.section-heading {
  margin-bottom: 28px;
  max-width: 700px;
}

.section-heading.wide {
  max-width: 920px;
}

.section-heading h2,
.about-copy h2,
.recruit-section h2,
.contact-card h2 {
  font-family: "Noto Serif TC", "Songti TC", serif;
  font-size: 2.25rem;
  line-height: 1.2;
  margin: 8px 0 12px;
}

.section-heading p,
.about-copy p,
.recruit-section p,
.contact-card address,
.course-card p,
.news-card p,
.service-card p,
.album-card p {
  color: var(--muted);
  line-height: 1.75;
}

.news-grid {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.news-section {
  padding-top: 50px;
}

.news-card,
.course-card,
.album-card,
.service-card {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.news-card {
  display: grid;
  grid-template-rows: 220px 1fr;
}

.news-card img,
.album-card img {
  height: 100%;
  object-fit: cover;
  width: 100%;
}

.news-card div,
.album-card div,
.course-card,
.service-card {
  padding: 20px;
}

.news-meta,
.course-meta,
.album-meta {
  color: var(--brown);
  display: flex;
  flex-wrap: wrap;
  font-size: 0.86rem;
  font-weight: 800;
  gap: 8px;
}

.news-card h3,
.course-card h3,
.service-card h3,
.album-card h3 {
  font-size: 1.22rem;
  line-height: 1.35;
  margin: 10px 0 8px;
}

.about-section {
  align-items: center;
  background:
    linear-gradient(90deg, var(--rose-soft), rgba(246, 228, 236, 0.34)),
    var(--paper);
  display: grid;
  gap: 40px;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 520px);
}

.about-media {
  border: 1px solid rgba(114, 95, 82, 0.16);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.about-media img {
  aspect-ratio: 4 / 3;
  object-fit: cover;
  width: 100%;
}

.contact-strip {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 28px 0 0;
}

.contact-strip div {
  border-left: 4px solid var(--teal);
  padding-left: 14px;
}

.contact-strip dt {
  color: var(--brown);
  font-size: 0.84rem;
  font-weight: 900;
}

.contact-strip dd {
  margin: 4px 0 0;
}

.services-section {
  background: #ffffff;
}

.service-board {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.service-card {
  min-height: 284px;
  position: relative;
}

.service-card::before {
  background: var(--rose);
  content: "";
  height: 4px;
  left: 20px;
  position: absolute;
  right: 20px;
  top: 0;
}

.service-icon {
  align-items: center;
  background: var(--paper-2);
  border-radius: 50%;
  color: var(--brown);
  display: inline-flex;
  font-family: "Noto Serif TC", "Songti TC", serif;
  font-size: 1.45rem;
  font-weight: 900;
  height: 54px;
  justify-content: center;
  width: 54px;
}

.service-group {
  color: var(--teal);
  display: block;
  font-size: 0.82rem;
  font-weight: 900;
  margin-top: 14px;
}

.courses-section {
  background:
    linear-gradient(90deg, rgba(19, 159, 208, 0.08), rgba(106, 143, 58, 0.08)),
    var(--paper);
}

.course-list {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.course-card {
  display: grid;
  gap: 16px;
  grid-template-columns: 170px minmax(0, 1fr);
}

.course-date {
  align-content: center;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: grid;
  justify-items: center;
  min-height: 150px;
}

.course-date strong {
  color: var(--teal);
  font-family: "Noto Serif TC", "Songti TC", serif;
  font-size: 2.4rem;
}

.course-date span {
  color: var(--brown);
  font-weight: 900;
}

.album-grid {
  display: grid;
  gap: 20px;
  grid-template-columns: 1.2fr repeat(2, minmax(0, 0.9fr));
}

.album-card {
  display: grid;
  grid-template-rows: 260px auto;
}

.album-card:first-child {
  grid-row: span 2;
  grid-template-rows: 460px auto;
}

.recruit-section {
  align-items: center;
  background: var(--ink);
  color: #ffffff;
  display: flex;
  gap: 24px;
  justify-content: space-between;
}

.recruit-section p {
  color: rgba(255, 255, 255, 0.76);
  max-width: 760px;
}

.appointment-section {
  align-items: start;
  background:
    linear-gradient(135deg, rgba(41, 163, 141, 0.1), rgba(225, 165, 191, 0.16)),
    #ffffff;
  display: grid;
  gap: 22px;
  grid-template-columns: minmax(280px, 0.78fr) minmax(0, 1.22fr);
}

.appointment-card {
  background: var(--ink);
  border-radius: var(--radius);
  color: #ffffff;
  padding: 30px;
  position: sticky;
  top: 104px;
}

.appointment-card span {
  color: var(--rose);
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 900;
}

.appointment-card h2 {
  font-family: "Noto Serif TC", "Songti TC", serif;
  font-size: 2.15rem;
  line-height: 1.2;
  margin: 8px 0 12px;
}

.appointment-card p {
  color: rgba(255, 255, 255, 0.78);
  line-height: 1.75;
}

.appointment-card ol {
  counter-reset: booking;
  display: grid;
  gap: 10px;
  list-style: none;
  margin: 24px 0 0;
  padding: 0;
}

.appointment-card li {
  align-items: center;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius);
  display: flex;
  gap: 10px;
  padding: 12px;
}

.appointment-card li::before {
  align-items: center;
  background: var(--teal);
  border-radius: 50%;
  color: #ffffff;
  content: counter(booking);
  counter-increment: booking;
  display: inline-flex;
  flex: 0 0 28px;
  font-size: 0.84rem;
  font-weight: 900;
  height: 28px;
  justify-content: center;
  width: 28px;
}

.contact-section {
  background: var(--paper-2);
  display: grid;
  gap: 22px;
  grid-template-columns: minmax(300px, 0.88fr) minmax(0, 1.12fr);
}

.contact-card,
.message-form,
.appointment-form {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px;
}

.contact-card address {
  display: grid;
  font-style: normal;
  gap: 8px;
}

.contact-card a {
  color: var(--teal);
  font-weight: 800;
}

.social-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.social-links a {
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  padding: 9px 13px;
}

.message-form,
.appointment-form {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.message-form .full,
.message-form button,
.message-form .form-status,
.appointment-form .full,
.appointment-form button,
.appointment-form .form-status {
  grid-column: 1 / -1;
}

label span {
  color: var(--brown);
  display: block;
  font-size: 0.84rem;
  font-weight: 900;
  margin-bottom: 6px;
}

input,
select,
textarea {
  background: #ffffff;
  border: 1px solid #d9d0ca;
  border-radius: var(--radius);
  color: var(--ink);
  min-height: 44px;
  padding: 11px 12px;
  width: 100%;
}

textarea {
  resize: vertical;
}

.form-status {
  color: var(--muted);
  margin: 0;
  min-height: 24px;
}

.form-status.error {
  color: var(--danger);
}

.site-footer {
  align-items: center;
  background: #ffffff;
  border-top: 1px solid var(--line);
  display: flex;
  gap: 18px;
  justify-content: space-between;
  padding: 24px min(5vw, 64px);
}

.site-footer div {
  display: grid;
  gap: 3px;
}

.site-footer span,
.site-footer a {
  color: var(--muted);
}

/* Admin */
.admin-body {
  background: #f5f7f4;
}

.admin-app {
  min-height: 100vh;
}

.login-panel {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: grid;
  gap: 24px;
  margin: 12vh auto 0;
  max-width: 440px;
  padding: 30px;
}

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

.login-logo {
  display: block;
  height: auto;
  max-width: 270px;
  width: 100%;
}

.login-brand h1 {
  font-size: 1.6rem;
  margin: 0 0 4px;
}

.login-brand p {
  color: var(--muted);
  margin: 0;
}

.login-panel form {
  display: grid;
  gap: 14px;
}

.admin-shell {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  min-height: 100vh;
}

.admin-sidebar {
  background: #17231f;
  color: #ffffff;
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 22px;
}

.admin-brand small {
  color: rgba(255, 255, 255, 0.64);
}

.admin-brand {
  align-items: flex-start;
  flex-direction: column;
}

.admin-brand .brand-logo {
  filter: drop-shadow(0 8px 20px rgba(0, 0, 0, 0.2));
  width: 184px;
}

.admin-sidebar nav {
  display: grid;
  gap: 6px;
}

.admin-sidebar button,
.admin-sidebar a.nav-item {
  background: transparent;
  border: 0;
  border-radius: var(--radius);
  color: rgba(255, 255, 255, 0.82);
  padding: 12px 14px;
  text-align: left;
}

.admin-sidebar a.nav-item.active,
.admin-sidebar a.nav-item:hover {
  background: rgba(255, 255, 255, 0.11);
  color: #ffffff;
}

.admin-logout {
  margin-top: auto;
}

.admin-workspace {
  min-width: 0;
  padding: 28px;
}

.admin-topbar {
  align-items: center;
  display: flex;
  gap: 18px;
  justify-content: space-between;
  margin-bottom: 20px;
}

.admin-topbar h1 {
  font-size: 2rem;
  margin: 4px 0 0;
}

.admin-panel {
  display: grid;
  gap: 18px;
}

.metric-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

.metric {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
}

.metric span {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
}

.metric strong {
  display: block;
  font-size: 2rem;
  margin-top: 6px;
}

.admin-card {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.admin-card-header {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 16px;
  justify-content: space-between;
  padding: 16px 18px;
}

.admin-card-header h2 {
  font-size: 1.18rem;
  margin: 0;
}

.admin-card-body {
  padding: 18px;
}

.settings-grid,
.editor-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.settings-grid .wide,
.editor-grid .wide {
  grid-column: 1 / -1;
}

.hero-upload {
  align-items: stretch;
  background: #f8faf7;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(260px, 0.95fr) minmax(260px, 1.05fr);
  padding: 14px;
}

.hero-upload-preview {
  background: #e9eee9;
  border-radius: var(--radius);
  min-height: 180px;
  overflow: hidden;
}

.hero-upload-preview img {
  height: 100%;
  min-height: 180px;
  object-fit: cover;
  width: 100%;
}

.hero-upload-controls {
  align-content: center;
  display: grid;
  gap: 12px;
}

.hero-upload-controls p {
  color: var(--muted);
  line-height: 1.6;
  margin: 0;
}

.admin-table-wrap {
  overflow: auto;
}

.admin-table {
  border-collapse: collapse;
  min-width: 760px;
  width: 100%;
}

.admin-table th,
.admin-table td {
  border-bottom: 1px solid var(--line);
  padding: 12px 14px;
  text-align: left;
  vertical-align: top;
}

.admin-table th {
  color: var(--brown);
  font-size: 0.78rem;
  text-transform: uppercase;
}

.admin-table td {
  color: #384641;
}

.table-actions {
  display: flex;
  gap: 8px;
}

.icon-button {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  font-size: 0.88rem;
  font-weight: 800;
  min-height: 34px;
  padding: 7px 11px;
}

.icon-button.danger {
  color: var(--danger);
}

.status-pill {
  border-radius: 999px;
  display: inline-flex;
  font-size: 0.78rem;
  font-weight: 900;
  padding: 5px 9px;
}

.status-pill.ok {
  background: rgba(41, 163, 141, 0.14);
  color: #0c6f60;
}

.status-pill.off {
  background: rgba(182, 72, 72, 0.1);
  color: var(--danger);
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.message-detail {
  color: var(--muted);
  max-width: 420px;
}

.appointment-table {
  min-width: 1120px;
}

.admin-table textarea {
  min-width: 180px;
}

@media (max-width: 1080px) {
  .hero,
  .about-section,
  .appointment-section,
  .contact-section {
    grid-template-columns: 1fr;
  }

  .appointment-card {
    position: static;
  }

  .hero {
    gap: 34px;
  }

  .news-grid,
  .service-board,
  .album-grid,
  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .album-card:first-child {
    grid-row: auto;
    grid-template-rows: 300px auto;
  }

  .course-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 780px) {
  .site-header {
    align-items: flex-start;
    padding: 12px 18px;
  }

  .brand-logo {
    width: 148px;
  }

  .nav-toggle {
    display: flex;
  }

  .site-nav {
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    display: none;
    left: 18px;
    padding: 10px;
    position: absolute;
    right: 18px;
    top: 70px;
  }

  .site-nav.open {
    display: grid;
  }

  .site-nav a {
    border-radius: var(--radius);
  }

  .hero {
    min-height: auto;
    padding: 52px 20px 24px;
  }

  .hero h1 {
    font-size: 2rem;
    margin: 12px 0 16px;
  }

  .hero p {
    font-size: 0.98rem;
    line-height: 1.65;
  }

  .hero-actions {
    margin-top: 20px;
  }

  .hero-rail {
    gap: 8px;
  }

  .hero-rail div {
    padding: 10px 14px;
  }

  .hero-rail strong {
    font-size: 1.05rem;
  }

  .hero-rail span {
    font-size: 0.9rem;
  }

  .section {
    padding: 58px 20px;
  }

  .news-section {
    padding-top: 32px;
  }

  .news-grid,
  .service-board,
  .album-grid,
  .contact-strip,
  .message-form,
  .appointment-form,
  .metric-grid,
  .settings-grid,
  .hero-upload,
  .editor-grid {
    grid-template-columns: 1fr;
  }

  .course-card {
    grid-template-columns: 1fr;
  }

  .course-date {
    min-height: 110px;
  }

  .recruit-section,
  .site-footer,
  .admin-topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .admin-shell {
    grid-template-columns: 1fr;
  }

  .admin-sidebar {
    position: static;
  }

  .admin-workspace {
    padding: 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
