@import url("https://fonts.googleapis.com/css2?family=M+PLUS+Rounded+1c:wght@400;500;700;800&family=Space+Grotesk:wght@500;700&display=swap");

:root {
  --bg: #e4fbfa;
  --surface: rgba(246, 255, 255, 0.82);
  --surface-strong: rgba(255, 255, 255, 0.92);
  --sheet: rgba(247, 255, 255, 0.96);
  --ink: #11222e;
  --muted: #53707f;
  --line: rgba(36, 179, 181, 0.18);
  --accent: #1ccfd0;
  --accent-strong: #08aeb0;
  --accent-soft: #d7ffff;
  --accent-pink: #ff5fb2;
  --activity: #ff5fb2;
  --store: #00a99d;
  --shadow: 0 22px 60px rgba(18, 79, 101, 0.14);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  position: relative;
  margin: 0;
  font-family: "M PLUS Rounded 1c", "PingFang TC", "Noto Sans TC", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 18%, rgba(28, 207, 208, 0.32), transparent 24%),
    radial-gradient(circle at 88% 10%, rgba(255, 95, 178, 0.18), transparent 18%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.64) 0%, rgba(28, 207, 208, 0.06) 30%, rgba(17, 34, 46, 0.08) 100%),
    linear-gradient(180deg, #f8ffff 0%, var(--bg) 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(17, 34, 46, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(17, 34, 46, 0.035) 1px, transparent 1px);
  background-size: 26px 26px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.5), transparent 90%);
}

body.sheet-open {
  overflow: hidden;
}

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

.app-shell {
  width: min(760px, calc(100% - 20px));
  margin: 0 auto;
  padding: max(18px, env(safe-area-inset-top)) 0 calc(24px + env(safe-area-inset-bottom));
}

.app-bar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 4px 14px;
  margin-bottom: 14px;
  background: transparent;
}

.app-bar::after {
  display: none;
}

.app-label {
  margin: 0 0 4px;
  color: var(--accent-strong);
  font-family: "Space Grotesk", "M PLUS Rounded 1c", sans-serif;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
}

h1 {
  font-size: clamp(1.9rem, 5vw, 2.5rem);
  line-height: 1.05;
  letter-spacing: -0.03em;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.7);
}

.feed-panel {
  position: relative;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(239, 255, 255, 0.84)),
    var(--surface);
  backdrop-filter: blur(20px);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.feed-panel::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 5px;
  background: linear-gradient(90deg, var(--accent), #8affec, var(--accent-pink));
}

.admin-shell {
  padding-bottom: 40px;
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 18px;
  padding: 10px 4px 0;
}

.footer-link {
  position: relative;
  min-height: 42px;
  padding: 10px 18px;
  border: 1px solid rgba(28, 207, 208, 0.22);
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(215, 255, 255, 0.74));
  color: var(--accent-strong);
  font-family: "Space Grotesk", "M PLUS Rounded 1c", sans-serif;
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  box-shadow: 0 12px 28px rgba(28, 207, 208, 0.14);
  transition: transform 120ms ease, box-shadow 120ms ease, color 120ms ease;
}

.footer-link:hover {
  color: var(--accent-pink);
  transform: translateY(-1px);
  box-shadow: 0 16px 32px rgba(255, 95, 178, 0.14);
}

.footer-separator {
  color: rgba(17, 34, 46, 0.2);
}

.footer-popup-copy {
  display: grid;
  gap: 12px;
}

.footer-popup-copy p {
  margin: 0;
  color: var(--muted);
  line-height: 1.75;
  font-size: 0.95rem;
}

.admin-login-panel {
  max-width: 520px;
  margin: 48px auto 0;
}

.admin-entries {
  gap: 18px;
}

.admin-contact-panel {
  margin-top: 16px;
}

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

.admin-ip {
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.84rem;
}

.admin-item > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  cursor: pointer;
  list-style: none;
}

.admin-item > summary::-webkit-details-marker {
  display: none;
}

.admin-summary-main h3 {
  margin: 0;
}

.admin-summary-date {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.admin-detail {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.feed-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 4px 10px;
}

.feed-head h2 {
  font-size: 1.05rem;
  letter-spacing: -0.01em;
}

.entries {
  display: grid;
  gap: 12px;
}

.entry {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(240, 255, 255, 0.92));
  box-shadow: 0 14px 28px rgba(18, 79, 101, 0.06);
}

.entry-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.entry-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 700;
}

.badge.activity {
  background: rgba(255, 95, 178, 0.14);
  color: var(--activity);
}

.badge.store {
  background: rgba(0, 169, 157, 0.14);
  color: var(--store);
}

.status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 700;
}

.status-badge.ok {
  background: rgba(0, 169, 157, 0.12);
  color: var(--store);
}

.status-badge.aging {
  background: rgba(255, 95, 178, 0.12);
  color: var(--activity);
}

.status-badge.review {
  background: rgba(17, 34, 46, 0.08);
  color: var(--accent-strong);
}

.entry time,
.meta,
.empty,
.success,
.entry-form span {
  color: var(--muted);
}

.entry time {
  font-size: 0.8rem;
}

.entry h3 {
  margin: 12px 0 10px;
  font-size: 1.08rem;
  line-height: 1.35;
  letter-spacing: -0.02em;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.86rem;
}

.entry p {
  margin: 12px 0 0;
  line-height: 1.65;
  font-size: 0.95rem;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.entry a {
  display: inline-block;
  margin-top: 12px;
  color: var(--accent);
  font-size: 0.92rem;
  font-weight: 700;
  text-decoration: none;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.entry-signals {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.entry-signals span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(215, 255, 255, 0.82), rgba(255, 255, 255, 0.9));
  color: var(--accent-strong);
  font-size: 0.8rem;
  font-weight: 700;
}

.entry-updates {
  margin-top: 14px;
  padding: 12px;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255, 247, 251, 0.94), rgba(248, 255, 255, 0.96));
  border: 1px solid rgba(255, 95, 178, 0.16);
}

.entry-updates h4 {
  margin: 0 0 10px;
  font-size: 0.9rem;
  letter-spacing: -0.01em;
}

.update-list {
  display: grid;
  gap: 10px;
}

.update-item {
  padding-left: 10px;
  border-left: 3px solid rgba(255, 95, 178, 0.36);
}

.update-item time {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 0.78rem;
}

.update-type {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  margin-bottom: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 700;
}

.update-type.update {
  background: rgba(0, 122, 255, 0.08);
  color: var(--accent);
}

.update-type.incorrect {
  background: rgba(255, 95, 178, 0.14);
  color: var(--accent-pink);
}

.update-item p {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.55;
}

.entry-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.action-form {
  margin: 0;
}

.action-button {
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid rgba(28, 207, 208, 0.16);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(221, 255, 255, 0.82));
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 10px 22px rgba(28, 207, 208, 0.09);
}

.action-button.helpful {
  background: rgba(0, 122, 255, 0.08);
  color: var(--accent);
}

.action-button.incorrect {
  background: linear-gradient(180deg, rgba(255, 238, 247, 0.94), rgba(255, 255, 255, 0.9));
  border-color: rgba(255, 95, 178, 0.18);
  color: var(--accent-pink);
}

.action-button.primary {
  background: linear-gradient(135deg, var(--accent-strong), var(--accent));
  border-color: rgba(0, 122, 255, 0.2);
  color: #fff;
}

.action-button:active,
.compose-trigger:active,
.sheet-close:active {
  transform: scale(0.98);
}

.sheet-shell {
  position: fixed;
  inset: 0;
  z-index: 60;
  pointer-events: none;
  opacity: 0;
}

.sheet-shell.is-open {
  pointer-events: auto;
  opacity: 1;
}

.sheet-shell.is-open .sheet-card {
  transform: translate(-50%, -50%);
}

.sheet-shell[aria-hidden="true"] .sheet-card {
  pointer-events: none;
}

.sheet-shell[aria-hidden="true"] .sheet-backdrop {
  pointer-events: none;
}

.sheet-shell[aria-hidden="false"] .sheet-backdrop {
  pointer-events: auto;
}

.sheet-shell[aria-hidden="false"] .sheet-card {
  pointer-events: auto;
}

.empty {
  padding: 24px 10px 12px;
  text-align: center;
  line-height: 1.7;
}

.compose-trigger {
  appearance: none;
  border: 0;
  cursor: pointer;
}

.desktop-trigger,
.entry-form button,
.sheet-close {
  min-height: 46px;
  border-radius: 999px;
}

.desktop-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
  background: linear-gradient(135deg, var(--accent-strong), var(--accent));
  color: #ffffff;
  font-weight: 700;
  box-shadow: 0 14px 30px rgba(28, 207, 208, 0.24);
}

.sheet-backdrop {
  position: fixed;
  inset: 0;
  border: 0;
  background: rgba(10, 26, 38, 0.34);
  backdrop-filter: blur(8px);
}

.sheet-dismiss {
  width: 100%;
  height: 100%;
  border: 0;
  background: transparent;
}

.sheet-card {
  position: fixed;
  left: 50%;
  top: 50%;
  bottom: auto;
  transform: translate(-50%, -50%);
  width: min(680px, calc(100vw - 24px));
  max-height: min(80vh, 760px);
  padding: 12px 14px calc(22px + env(safe-area-inset-bottom));
  border-radius: 28px;
  border: 1px solid rgba(28, 207, 208, 0.22);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(238, 255, 255, 0.94)),
    var(--sheet);
  box-shadow: 0 24px 58px rgba(18, 79, 101, 0.18);
  overflow: auto;
}

.sheet-handle {
  display: none;
}

.sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.sheet-head h2 {
  font-family: "Space Grotesk", "M PLUS Rounded 1c", sans-serif;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}

.sheet-subtitle {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.4;
}

.sheet-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  min-width: 42px;
  padding: 0;
  border: 0;
  background: rgba(28, 207, 208, 0.1);
  color: var(--accent-strong);
  font-size: 1.4rem;
  line-height: 1;
}

.entry-form {
  display: grid;
  gap: 12px;
}

.entry-form.is-submitted > :not(.form-result) {
  display: none;
}

.entry-form.is-submitted .form-result {
  min-height: 0;
  padding: 18px 4px 6px;
}

.entry-form.is-hidden {
  display: none;
}

.manage-editor {
  display: none;
}

.manage-editor.is-verified {
  display: grid;
}

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

.entry-form label {
  display: grid;
  gap: 8px;
}

.entry-form span {
  font-size: 0.9rem;
  font-weight: 600;
}

.entry-form input,
.entry-form select,
.entry-form textarea {
  width: 100%;
  min-height: 48px;
  padding: 13px 14px;
  border: 1px solid rgba(28, 207, 208, 0.18);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink);
  font-size: 16px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.entry-form input:focus,
.entry-form select:focus,
.entry-form textarea:focus {
  outline: none;
  border-color: rgba(28, 207, 208, 0.44);
  box-shadow:
    0 0 0 4px rgba(28, 207, 208, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.entry-form textarea {
  min-height: 132px;
  resize: vertical;
}

.usage-rules {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(217, 255, 255, 0.72), rgba(255, 255, 255, 0.78));
}

.usage-rules h3 {
  margin: 0;
  font-size: 1rem;
}

.usage-rules-list {
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.65;
}

.agreement-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.agreement-check input {
  width: 18px;
  min-width: 18px;
  min-height: 18px;
  margin-top: 2px;
  padding: 0;
}

.agreement-check span {
  font-size: 0.92rem;
  font-weight: 600;
}

.date-range-error {
  min-height: 20px;
  margin: -4px 2px 0;
  color: #d64c8f;
  font-size: 0.86rem;
  font-weight: 700;
}

.submit-row {
  margin-top: 4px;
}

.entry-form button {
  width: 100%;
  border: 0;
  background: linear-gradient(135deg, var(--accent-strong), var(--accent));
  color: #fff;
  font-weight: 800;
  box-shadow: 0 16px 30px rgba(28, 207, 208, 0.2);
}

#form-result {
  min-height: 20px;
}

.form-result {
  min-height: 20px;
}

.success {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0 2px;
  font-size: 0.9rem;
  font-weight: 600;
}

.success p {
  margin: 0;
}

.manage-code-note {
  color: var(--ink);
}

.manage-code {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(28, 207, 208, 0.14);
  color: var(--accent-strong);
  letter-spacing: 0.08em;
}

.manage-help {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.5;
}

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

.danger-button {
  background: linear-gradient(135deg, #ff5fb2, #ff7cc5);
}

@media (max-width: 640px) {
  .app-shell {
    width: min(100% - 12px, 760px);
    padding-top: max(10px, env(safe-area-inset-top));
  }

  .app-bar {
    padding: 6px 4px 12px;
  }

  h1 {
    font-size: 1.75rem;
  }

  .feed-panel {
    padding: 10px;
    border-radius: 24px;
  }

  .feed-head {
    padding-bottom: 8px;
  }

  .entry-actions {
    grid-template-columns: 1fr;
  }

  .desktop-trigger {
    padding: 0 14px;
  }

  .sheet-card {
    width: calc(100vw - 16px);
    max-height: min(84vh, 760px);
    padding-inline: 12px;
    border-radius: 24px;
  }

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

  .manage-actions {
    grid-template-columns: 1fr;
  }
}
