:root {
  --ink: #17212b;
  --muted: #66717d;
  --line: #dde5eb;
  --paper: #ffffff;
  --soft: #f5f8fa;
  --accent: #7c6a86;
  --accent-dark: #66566f;
  --sun: #f5b84b;
  --rose: #d8666b;
  --shadow: 0 18px 50px rgba(23, 33, 43, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--soft);
  font-family: "Noto Sans SC", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
textarea {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px clamp(18px, 5vw, 72px);
  border-bottom: 1px solid rgba(221, 229, 235, 0.86);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(18px);
}

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

.brand-logo {
  width: 54px;
  height: 54px;
  border-radius: 8px;
  object-fit: cover;
}

.brand strong,
.brand small {
  display: block;
}

.brand small {
  color: var(--muted);
  font-size: 12px;
}

.top-nav {
  display: flex;
  align-items: center;
  gap: 18px;
  color: var(--muted);
  font-weight: 600;
}

main {
  padding: 0 clamp(18px, 5vw, 72px) 56px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
  gap: 40px;
  align-items: center;
  padding: 46px 0 52px;
}

.hero-copy {
  max-width: 760px;
}

.eyebrow,
.section-kicker {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1,
h2,
p,
dd,
.hero-text,
.stat-label {
  text-wrap: pretty;
}

h1 {
  max-width: 720px;
  margin-bottom: 20px;
  font-size: clamp(46px, 7vw, 84px);
  line-height: 1.08;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(26px, 4vw, 40px);
  line-height: 1.15;
}

.hero-text {
  max-width: 680px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.8;
}

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

.primary-button,
.secondary-button,
.ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 700;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.primary-button {
  color: #fff;
  background: var(--accent);
}

.primary-button:hover {
  background: var(--accent-dark);
  transform: translateY(-1px);
}

.secondary-button,
.ghost-button {
  color: var(--ink);
  background: #fff;
  border-color: var(--line);
}

.secondary-button:hover,
.ghost-button:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.hero-panel {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--line);
  box-shadow: var(--shadow);
}

.hero-panel div {
  min-height: 142px;
  padding: 22px;
  background: var(--paper);
}

.stat-number,
.stat-label {
  display: block;
}

.stat-number {
  margin-bottom: 12px;
  font-size: clamp(24px, 3vw, 36px);
  font-weight: 800;
  white-space: nowrap;
}

.stat-label {
  color: var(--muted);
  font-weight: 600;
  white-space: nowrap;
}

.toolbar,
.service-section,
.admin-section {
  margin-top: 24px;
  padding: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}

.toolbar,
.service-section,
.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

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

.search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  width: min(420px, 100%);
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: var(--soft);
  font-weight: 700;
}

.search-box span {
  flex: 0 0 auto;
  white-space: nowrap;
}

.search-box input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
}

.coach-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-top: 18px;
}

.coach-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: 0 10px 30px rgba(23, 33, 43, 0.06);
}

.coach-photo {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: contain;
  object-position: center;
  background: linear-gradient(135deg, #dde5eb, #fff);
}

.coach-body {
  padding: 20px;
}

.coach-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}

.coach-title h3 {
  margin: 0;
  font-size: 22px;
}

.price {
  flex: 0 0 auto;
  color: var(--rose);
  font-weight: 800;
}

.meta-list {
  display: grid;
  gap: 9px;
  margin: 0;
  color: var(--muted);
}

.meta-list div {
  display: grid;
  grid-template-columns: 76px 1fr;
  gap: 10px;
}

.meta-list dt {
  color: var(--ink);
  font-weight: 700;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.tag {
  padding: 6px 10px;
  border-radius: 999px;
  color: var(--accent);
  background: rgba(124, 106, 134, 0.16);
  font-size: 13px;
  font-weight: 700;
}

.service-section {
  position: relative;
  align-items: stretch;
  overflow: hidden;
  border: 0;
  box-shadow: 0 22px 55px rgba(23, 33, 43, 0.1);
}

.service-section::after {
  content: "";
  position: absolute;
  inset: 0 0 0 58%;
  background:
    linear-gradient(180deg, rgba(248, 243, 250, 0.96), rgba(243, 236, 248, 0.86)),
    radial-gradient(circle at top right, rgba(124, 106, 134, 0.14), transparent 52%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.1), transparent 42%);
  pointer-events: none;
}

.service-copy,
.service-panel {
  position: relative;
  z-index: 1;
}

.service-copy {
  max-width: 560px;
}

.service-copy h2 {
  margin-bottom: 14px;
}

.service-copy p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.8;
}

.service-list {
  display: grid;
  gap: 12px;
  margin: 28px 0 0;
  padding: 0;
  list-style: none;
}

.service-list li {
  position: relative;
  padding-left: 28px;
  color: var(--ink);
  font-weight: 600;
}

.service-list li::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: -1px;
  color: var(--accent);
  font-weight: 800;
}

.service-panel {
  display: grid;
  justify-items: center;
  gap: 16px;
  min-width: 250px;
  padding: 30px 26px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 18px 40px rgba(23, 33, 43, 0.1);
  backdrop-filter: blur(8px);
}

.service-panel-copy {
  display: grid;
  gap: 6px;
  text-align: center;
}

.service-panel-copy strong {
  font-size: 24px;
  line-height: 1.1;
}

.service-panel-copy span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.qr-card {
  position: relative;
  display: grid;
  width: 240px;
  min-height: 240px;
  place-items: center;
  padding: 12px;
  border: 1px solid rgba(221, 229, 235, 0.82);
  border-radius: 20px;
  background: linear-gradient(180deg, #ffffff, #f8f4fb);
  color: var(--muted);
  text-align: center;
  font-size: 14px;
  font-weight: 700;
}

.qr-card img {
  display: none;
  width: 100%;
  height: 100%;
  padding: 12px;
  border-radius: 16px;
  object-fit: contain;
  object-position: center;
  background: #fff;
}

.qr-card.has-image img {
  display: block;
}

.qr-card.has-image span {
  display: none;
}

.admin-section {
  box-shadow: var(--shadow);
}

.is-hidden {
  display: none;
}

.admin-form {
  margin-top: 24px;
}

.cloud-status {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.cloud-status.is-ready {
  color: var(--accent);
}

.cloud-status.is-error {
  color: #9f3036;
}

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

.form-grid label {
  display: grid;
  gap: 8px;
  color: var(--ink);
  font-weight: 700;
}

.form-grid .wide {
  grid-column: 1 / -1;
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 13px;
  color: var(--ink);
  background: #fff;
  outline: 0;
}

input:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(124, 106, 134, 0.16);
}

.admin-list {
  display: grid;
  gap: 12px;
  margin-top: 28px;
}

.admin-item {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}

.admin-item img {
  display: block;
  width: 64px;
  height: 64px;
  padding: 4px;
  border-radius: 8px;
  object-fit: contain;
  object-position: center;
  background: #fff;
}

.admin-item h3,
.admin-item p {
  margin: 0;
}

.admin-item p {
  color: var(--muted);
}

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

.icon-button,
.danger-button,
.text-button {
  border: 0;
  cursor: pointer;
  font-weight: 800;
  background: transparent;
}

.icon-button,
.danger-button {
  min-height: 38px;
  padding: 0 12px;
  border-radius: 8px;
}

.icon-button {
  color: var(--accent);
  background: rgba(124, 106, 134, 0.14);
}

.danger-button {
  color: #9f3036;
  background: rgba(216, 102, 107, 0.14);
}

.empty-state {
  padding: 44px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: var(--paper);
  text-align: center;
  font-weight: 700;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  padding: 30px clamp(18px, 5vw, 72px) 44px;
  border-top: 1px solid rgba(221, 229, 235, 0.75);
  color: var(--muted);
}

.footer-brand {
  display: grid;
  gap: 10px;
}

.footer-brand strong {
  color: var(--ink);
  font-size: 18px;
}

.footer-copy {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  font-size: 13px;
  line-height: 1.7;
}

.footer-actions {
  display: flex;
  align-items: center;
  gap: 20px;
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  font-size: 13px;
  font-weight: 700;
}

.footer-nav a {
  color: var(--muted);
}

.footer-record {
  color: var(--muted);
}

.footer-nav a:hover,
.footer-record:hover {
  color: var(--accent);
}

.text-button {
  color: var(--accent);
}

.login-modal {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(23, 33, 43, 0.42);
  backdrop-filter: blur(10px);
}

.login-modal.is-hidden {
  display: none;
}

.login-card {
  position: relative;
  width: min(420px, 100%);
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 0;
  border-radius: 8px;
  color: var(--muted);
  background: var(--soft);
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
}

.login-form {
  display: grid;
  gap: 16px;
  margin-top: 22px;
}

.login-form label {
  display: grid;
  gap: 8px;
  font-weight: 700;
}

.login-error {
  min-height: 22px;
  margin: 0;
  color: #9f3036;
  font-weight: 700;
}

@media (max-width: 980px) {
  .hero,
  .coach-grid {
    grid-template-columns: 1fr 1fr;
  }

  .hero {
    min-height: auto;
  }

  .hero-copy,
  .hero-panel,
  .toolbar,
  .service-section {
    grid-column: 1 / -1;
  }

  .service-section {
    flex-direction: column;
  }

  .service-section::after {
    inset: 55% 0 0;
  }

  .service-copy {
    max-width: none;
  }
}

@media (max-width: 720px) {
  .site-header,
  .top-nav,
  .toolbar,
  .service-section,
  .admin-header,
  .admin-actions,
  .site-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .top-nav {
    gap: 10px;
  }

  .top-nav a,
  .top-nav button {
    width: 100%;
  }

  .hero,
  .coach-grid,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    padding-top: 30px;
  }

  .hero-panel {
    grid-template-columns: 1fr;
  }

  .stat-number {
    font-size: 32px;
  }

  .toolbar,
  .service-section,
  .admin-section {
    padding: 22px;
  }

  .service-section::after {
    inset: auto 0 0;
    min-height: 42%;
  }

  .service-list {
    gap: 10px;
    margin-top: 22px;
  }

  .service-panel {
    width: 100%;
    min-width: 0;
    padding: 20px 18px;
    border-radius: 18px;
  }

  .service-panel-copy strong {
    font-size: 20px;
  }

  .coach-body {
    padding: 18px 16px;
  }

  .coach-title {
    flex-direction: column;
    gap: 6px;
    margin-bottom: 14px;
  }

  .coach-title h3 {
    font-size: 20px;
  }

  .price {
    font-size: 18px;
  }

  .meta-list {
    gap: 12px;
  }

  .meta-list div {
    grid-template-columns: 1fr;
    gap: 4px;
    padding-bottom: 10px;
    border-bottom: 1px dashed rgba(221, 229, 235, 0.9);
  }

  .meta-list div:last-child {
    padding-bottom: 0;
    border-bottom: 0;
  }

  .meta-list dd {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
  }

  .tag-row {
    gap: 6px;
    margin-top: 14px;
  }

  .tag {
    padding: 5px 9px;
    font-size: 12px;
  }

  .qr-card {
    width: 100%;
    max-width: 180px;
    margin-inline: auto;
  }

  .qr-card img {
    padding: 12px;
  }

  .admin-item {
    grid-template-columns: 56px minmax(0, 1fr);
    gap: 12px;
    padding: 10px;
  }

  .admin-item img {
    width: 56px;
    height: 56px;
  }

  .admin-item h3 {
    font-size: 16px;
  }

  .admin-item p {
    font-size: 13px;
    line-height: 1.5;
  }

  .item-actions {
    grid-column: 1 / -1;
    justify-content: flex-end;
  }

  .footer-copy {
    justify-content: center;
  }

  .footer-brand,
  .footer-actions,
  .footer-nav {
    justify-content: center;
    text-align: center;
  }
}
