:root {
  color-scheme: light;
  --paper: #f8f7f2;
  --ink: #181f19;
  --forest: #1c382d;
  --muted: #536157;
  --line: #dedfd5;
  --lime: #e4f28d;
  --white: #fffefa;
  font-family: "DM Sans", "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-width: 300px; }
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 3px solid #618254; outline-offset: 3px; }
[hidden] { display: none !important; }
.wrap { width: min(100% - 64px, 1060px); margin-inline: auto; }
.site-header { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 82px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-size: 19px; font-weight: 750; white-space: nowrap; }
.brand-mark { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 11px; background: var(--forest); color: var(--lime); font-size: 24px; font-weight: 450; line-height: 1; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-height: 44px; border: 1px solid transparent; border-radius: 10px; padding: 0 15px; font-weight: 690; font-size: 14px; white-space: nowrap; }
.button.add { color: #fff; background: var(--forest); }
.button.add:hover { background: #2d503f; }
.button.add > span { font-size: 17px; }
.hero { position: relative; isolation: isolate; overflow: hidden; display: flex; justify-content: space-between; align-items: center; min-height: 326px; padding: 42px 49px; border-radius: 26px; background: var(--forest); color: #fffdf3; }
.hero-copy { z-index: 1; }
.hero h1 { margin: 0 0 17px; font-size: clamp(50px, 7.3vw, 86px); font-weight: 780; letter-spacing: -.07em; line-height: 1.1; }
.hero h1 span { color: var(--lime); }
.hero p { margin: 0 0 24px; color: #e0e9d7; line-height: 1.62; font-size: 16px; }
.button.pick { color: #202e1a; background: var(--lime); }
.button.pick:hover { background: #f0f9ae; }
.button.pick span { font-size: 18px; line-height: 1; }
.button.pick:focus-visible { outline-color: var(--lime); }
.hero-art { position: absolute; inset: 0 0 0 auto; width: 48%; pointer-events: none; }
.orbit { position: absolute; border: 1px solid #9bac7a58; border-radius: 50%; width: min(78%, 365px); aspect-ratio: 1; top: 50%; left: 50%; transform: translate(-50%, -50%); }
.orbit-inner { width: min(62%, 290px); border-style: dashed; }
.art-card { position: absolute; top: 50%; left: 50%; width: 130px; aspect-ratio: .77; border-radius: 19px; }
.art-card-back { transform: translate(-67%, -55%) rotate(-23deg); border: 1px solid #9bad74; background: #385744; }
.art-card-front { display: grid; place-items: center; transform: translate(-38%, -46%) rotate(13deg); background: var(--lime); color: var(--forest); box-shadow: 0 12px 32px #091a1080; }
.art-card-front span { font-size: 85px; font-weight: 400; line-height: 1; transform: rotate(-13deg); }
.spark, .planet { position: absolute; background: var(--lime); }
.spark { width: 20px; aspect-ratio: 1; clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%); }
.spark-large { top: 21%; left: 76%; }
.spark-small { bottom: 22%; left: 18%; width: 13px; }
.planet { top: 26%; left: 22%; width: 5px; height: 5px; border-radius: 50%; }
.collection { padding: 38px 0 0; }
.collection-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.collection-heading h2 { display: flex; align-items: baseline; gap: 10px; margin: 0; font-size: 27px; letter-spacing: -.04em; }
#total-count { color: var(--muted); font-size: 14px; font-weight: 550; letter-spacing: normal; }
.view-toggle { border: 0; border-radius: 9px; min-height: 44px; padding: 0 10px; color: var(--muted); background: transparent; font-size: 14px; }
.view-toggle:hover, .view-toggle[aria-pressed="true"] { color: var(--forest); background: #e7eadf; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0; }
.filters button { min-height: 44px; border: 1px solid var(--line); border-radius: 24px; padding: 0 15px; background: transparent; color: var(--muted); font-size: 14px; }
.filters button:hover { background: #eeefe7; }
.filters button[aria-pressed="true"] { border-color: var(--forest); background: var(--forest); color: #fff; }
.collection-tools { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.collection-tools input, .collection-tools select { min-height: 44px; min-width: 0; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--white); color: var(--ink); font-size: 16px; }
.collection-tools input { flex: 1 1 210px; }
.collection-tools input::placeholder { color: var(--muted); }
.collection-tools select { flex: 0 1 185px; }
.button.pick:disabled { opacity: .65; cursor: default; }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.card { position: relative; display: grid; grid-template-columns: 50px minmax(0, 1fr) 30px; gap: 15px; min-height: 118px; padding: 18px; border: 1px solid var(--line); border-radius: 16px; background: var(--white); }
.card:hover { border-color: #9bab8c; }
.tile-icon { display: grid; width: 50px; height: 50px; place-items: center; border-radius: 12px; background: #e9eddf; color: #365b3e; font-size: 25px; font-weight: 650; }
.card[data-category="video"] .tile-icon { background: #f5e2d8; color: #8f3f2c; font-size: 20px; }
.card[data-category="rest"] .tile-icon { background: #eee5f6; color: #6a437c; }
.card[data-category="learning"] .tile-icon { background: #e4ebf7; color: #345a80; }
.card-content { align-self: center; }
.card-category { margin: 0 0 5px; color: var(--muted); font-size: 12px; }
.card h3 { margin: 0; line-height: 1.4; font-size: 17px; overflow-wrap: anywhere; }
.card-note { display: -webkit-box; margin: 4px 0 0; color: var(--muted); font-size: 13px; line-height: 1.45; overflow: hidden; overflow-wrap: anywhere; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.card-target { position: absolute; inset: 0; z-index: 1; width: 100%; border: 0; border-radius: inherit; background: transparent; cursor: pointer; }
.card-arrow { align-self: start; text-align: center; color: var(--forest); font-size: 21px; }
.icon-button { display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 10px; background: transparent; color: var(--muted); font-size: 23px; }
.icon-button:hover { background: #edf0e7; color: var(--forest); }
.card-edit { position: absolute; z-index: 2; bottom: 5px; right: 10px; }
.empty { grid-column: 1 / -1; padding: 28px 18px; border: 1px dashed #adb5a8; border-radius: 14px; text-align: center; color: var(--muted); }
.footer { padding: 24px 0 max(22px, env(safe-area-inset-bottom)); color: var(--muted); font-size: 13px; }
.toast { position: fixed; z-index: 3; bottom: max(20px, env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); width: max-content; max-width: calc(100% - 28px); margin: 0; padding: 12px 16px; border-radius: 9px; background: var(--forest); color: white; box-shadow: 0 8px 18px #21312640; }
dialog { width: min(480px, calc(100% - 24px)); max-height: calc(100% - 24px); margin: auto; padding: 20px; border: 1px solid var(--line); border-radius: 18px; background: var(--white); color: var(--ink); box-shadow: 0 16px 60px #101f1840; }
dialog::backdrop { background: #172a22a1; }
.dialog-header { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 12px; }
.dialog-header h2 { margin: 0; font-size: 22px; overflow-wrap: anywhere; }
.dialog-header button { flex: none; }
dialog label { display: block; margin: 12px 0 5px; color: var(--ink); font-size: 14px; font-weight: 650; }
dialog label span { color: var(--muted); font-weight: 450; }
dialog input, dialog textarea, dialog select { width: 100%; padding: 9px 10px; border: 1px solid #bcc4b7; border-radius: 8px; background: white; color: var(--ink); font-size: 16px; }
dialog textarea { display: block; resize: vertical; min-height: 54px; }
.dialog-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.button.secondary { border-color: var(--line); background: var(--paper); color: var(--ink); }
.button.secondary:hover { background: #efefe7; }
.button.delete { margin-right: auto; background: transparent; color: #a33327; }
.button.delete:hover { background: #f7e8e4; }
.button.danger { background: #9a3026; color: white; }
.form-error { margin: 8px 0 0; color: #a33327; font-size: 14px; }
.details-note, #delete-name { color: var(--muted); line-height: 1.65; white-space: pre-wrap; overflow-wrap: anywhere; }
@media (max-width: 650px) {
  .wrap { width: calc(100% - 32px); }
  .site-header { min-height: 68px; }
  .brand { font-size: 17px; gap: 8px; }
  .hero { min-height: 242px; padding: 26px 22px; border-radius: 19px; }
  .hero h1 { font-size: clamp(37px, 10.3vw, 58px); margin-bottom: 13px; }
  .hero p { font-size: 14px; margin-bottom: 18px; }
  .hero-art { width: 44%; }
  .art-card { width: 67px; border-radius: 12px; }
  .art-card-front span { font-size: 48px; }
  .orbit { width: min(130%, 240px); }
  .orbit-inner { width: min(102%, 190px); }
  .spark { width: 13px; }
  .spark-small { width: 8px; }
  .collection { padding-top: 24px; }
  .collection-heading h2 { font-size: 23px; }
  .filters { gap: 6px; }
  .filters button { padding-inline: 12px; }
  .grid { grid-template-columns: 1fr; gap: 8px; }
  .card { min-height: 100px; padding: 14px; gap: 12px; }
  .card-edit { right: 7px; bottom: 2px; }
}
@media (max-width: 350px) {
  .hero-art { left: 62%; opacity: .55; }
  .site-header .button { padding-inline: 8px; }
}
