@charset "UTF-8";

:root {
  --red: #a8242c;
  --red-dark: #841b24;
  --ink: #332e2a;
  --muted: #84796f;
  --line: #e7e0d7;
  --paper: #faf8f4;
  --serif: "Noto Serif SC", "Songti SC", "SimSun", serif;
  --sans: "PingFang SC", "Microsoft YaHei", sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 24px; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 14px/1.65 var(--sans); -webkit-font-smoothing: antialiased; }
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
button { cursor: pointer; border: 0; }
button:disabled { cursor: not-allowed; opacity: .55; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin: 0; }
svg { display: block; }
button:focus-visible, a:focus-visible { outline: 3px solid #c58b47; outline-offset: 4px; }
input:focus, textarea:focus, select:focus { outline: 2px solid #cfa683; outline-offset: 2px; }
[hidden] { display: none !important; }
.container { width: min(100%, 1160px); margin: auto; padding: 0 28px; }
.svg-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon { width: 20px; height: 20px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }
.skip-link { position: fixed; left: 12px; top: -100px; padding: 10px; background: white; z-index: 100; }
.skip-link:focus { top: 10px; }

/* Header: identity and two secondary actions only. */
.site-header { background: #fffdf9; border-bottom: 1px solid var(--line); }
.header-inner { min-height: 50px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: flex; align-items: center; gap: 17px; }
.brand-word { font: 900 36px/.95 Arial, sans-serif; letter-spacing: -2px; color: var(--red); }
.brand-name { padding-left: 17px; border-left: 1px solid #ddd3c8; font-size: 17px; font-weight: 700; line-height: 1.5; }
.brand-name > span { display: block; color: var(--muted); font-size: 11px; letter-spacing: 3px; font-weight: 400; }
.header-actions { display: flex; align-items: center; gap: 24px; }
.text-button { padding: 10px 0; background: transparent; color: #76675b; }
.text-button:hover { color: var(--red); }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 12px; min-height: 44px; padding: 10px 20px; border-radius: 7px; font-weight: 600; transition: background .18s, border-color .18s; }
.button-outline { border: 1px solid #d9cdbf; background: transparent; color: #76604d; }
.button-outline:hover { background: #f5eee5; border-color: #c9ae90; }
.button-red { background: var(--red); color: white; }
.button-red:hover { background: var(--red-dark); }
.header-mine { min-height: 39px; padding: 7px 17px; font-size: 13px; }

/* Compact work list below the anniversary header. */
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 19px; }
.section-heading h2 { font-size: 22px; font-weight: 600; letter-spacing: 1px; }
.vote-credit { color: var(--muted); font-size: 13px; }
.vote-credit strong { color: var(--red); font-size: 18px; margin: 0 4px; }
.works-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 22px; margin-bottom: 22px; }
.tabs { display: flex; gap: 4px; padding: 4px; border: 1px solid var(--line); background: #f2ede6; border-radius: 7px; }
.tab { min-height: 35px; min-width: 65px; padding: 6px 17px; border-radius: 4px; background: transparent; color: #8d7b69; }
.tab.active { background: #fffdf9; color: var(--red); box-shadow: 0 1px 4px #49301a0d; font-weight: 600; }
.search { display: flex; align-items: center; gap: 10px; padding: 10px 13px; border: 1px solid var(--line); border-radius: 7px; background: #fffdf9; width: 290px; }
.search > .icon { width: 17px; height: 17px; color: #a39483; }
.search input { width: 100%; min-width: 0; outline: none; border: 0; background: transparent; font-size: 13px; color: var(--ink); }
.search input::placeholder { color: #9f9386; }
.search:focus-within { outline: 2px solid #cfa683; outline-offset: 2px; }
.entries-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.entry-card { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; grid-template-areas: "number title actions" "number author actions"; align-items: center; column-gap: 20px; row-gap: 4px; border: 1px solid var(--line); border-radius: 9px; padding: 19px 24px; background: #fffefa; min-height: 108px; }
.card-number { grid-area: number; color: #aa9985; font-size: 17px; font-variant-numeric: tabular-nums; }
.slogan-title { grid-area: title; min-width: 0; margin: 0; font: 600 23px/1.65 var(--sans); letter-spacing: .6px; }
.slogan-link { display: block; padding: 0; color: inherit; font: inherit; letter-spacing: inherit; background: none; text-align: left; white-space: normal; overflow-wrap: anywhere; }
.slogan-link:hover { color: var(--red); }
.card-author { grid-area: author; min-width: 0; color: #958473; font-size: 12px; overflow-wrap: anywhere; }
.entry-card:has(.card-author[hidden]) .slogan-title { grid-row: 1 / -1; }
.card-bottom { grid-area: actions; display: flex; align-items: center; justify-content: space-between; gap: 22px; padding-left: 22px; border-left: 1px solid #eee7dd; }
.card-bottom .vote-total, .card-bottom .vote-button { flex-shrink: 0; white-space: nowrap; }
.vote-total { font-size: 22px; color: #9b423a; line-height: 1; }
.vote-total small { font-size: 12px; color: #a4917d; margin-left: 6px; }
.vote-button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 39px; padding: 8px 14px; color: var(--red); border: 1px solid #d9b6a9; border-radius: 5px; background: #fff8f1; font-size: 13px; }
.vote-button .icon { width: 16px; height: 16px; }
.vote-button:hover:not(:disabled) { background: #f7e6d9; }
.vote-button.voted { background: #f2e7de; }
.vote-button.voted .icon { fill: currentColor; }
.more-wrap { display: flex; justify-content: center; padding: 24px 0 36px; }
.more-wrap:has(> [hidden]) { padding: 18px 0; }
.empty-state, .loading-state { grid-column: 1/-1; padding: 48px 20px; border: 1px dashed #dcccba; border-radius: 8px; text-align: center; color: #8e7a65; }
.empty-state h3 { font-size: 18px; font-weight: 500; margin-bottom: 8px; }
.empty-state p { font-size: 13px; }
.empty-state .button { margin-top: 20px; }
.site-footer { margin-top: 18px; border-top: 1px solid var(--line); }
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding-top: 22px; padding-bottom: 25px; color: #9a8874; font-size: 12px; }
.footer-inner a:hover { color: var(--red); }

/* Supplied anniversary artwork contains the lettering and the visible button. */
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.invitation {
  position: relative; margin: 6px 0 38px; isolation: isolate;
  border-radius: 15px; background: #fffdfa;
  /* Centered shadows lift all four sides; the lower shadow adds depth. */
  box-shadow: 0 0 10px 2px #57331d12, 0 0 26px 6px #67412424, 0 16px 30px -8px #67412430;
}
.invitation-picture { display: block; border-radius: inherit; }
.invitation-art { display: block; width: 100%; height: auto; aspect-ratio: 3257 / 525; border-radius: inherit; pointer-events: none; }
.invitation-action { position: absolute; left: 82.95%; top: 31.5%; width: 14.25%; height: 27%; padding: 0; border: 0; border-radius: 18px; background: transparent; color: transparent; }
.invitation-action .icon { display: none; }
.invitation-action:hover:not(:disabled) { background: #fff2cf12; box-shadow: 0 0 20px #efb24855; }
.invitation-action:focus-visible { outline: 3px solid var(--red-dark); outline-offset: 5px; }
.invitation-action:disabled { color: var(--red-dark); background: #fff8e9; border: 1px solid #d4ac62; opacity: .96; font-size: clamp(10px, 1.1vw, 14px); }
@media (max-width: 760px) {
  /* Keep the supplied long strip intact on small screens; only scale it to the card width. */
  .invitation { margin: 12px 0 36px; padding: 0; overflow: hidden; border: 1px solid #e2d5c4; border-radius: 15px; background: #fffdfa; box-shadow: 0 0 8px 1px #57331d12, 0 0 18px 4px #67412424, 0 13px 24px -8px #67412430; }
  .invitation::before, .invitation::after { display: none; }
  .invitation-art { display: block; width: 100%; height: auto; }
  .invitation-action { position: absolute; left: 82.95%; top: 45%; display: block; width: 14.25%; min-width: 44px; height: 27%; min-height: 44px; margin: 0; border-radius: 8px; background: transparent; transform: translateY(-50%); }
  .invitation-action:hover:not(:disabled) { background-color: #fff2cf12; box-shadow: 0 0 14px #efb24855; }
  .invitation-action:disabled { background: #fff8e9; font-size: 13px; }
}

/* Details and rules appear only when requested. */
.modal { width: min(560px, calc(100vw - 32px)); max-height: 90dvh; padding: 28px; border: 1px solid #dfd1bf; border-radius: 12px; background: #fffdf9; color: var(--ink); box-shadow: 0 22px 90px #3318154d; }
.modal::backdrop { background: #29141980; backdrop-filter: blur(3px); }
body:has(dialog[open]) { overflow: hidden; }
.modal-header { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.modal-header h2 { font-size: 23px; font-weight: 600; }
.icon-button { width: 34px; height: 34px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; color: #94785f; background: #f3ece4; border-radius: 50%; }
.icon-button .icon { width: 17px; height: 17px; }
.form-intro { margin: 13px 0 22px; color: var(--muted); font-size: 13px; }
.modal form > label, .form-row > label, .settings-form > label { display: block; font-size: 13px; color: #715f4e; margin-bottom: 18px; }
.required { color: var(--red); margin-left: 3px; }
.field-hint { float: right; color: #a08a74; font-size: 12px; }
.optional { margin-left: 6px; color: #a3907b; font-size: 11px; font-weight: 400; }
.modal input:not([type=checkbox]), .modal textarea, .settings-form input:not([type=checkbox]), .settings-form textarea { display: block; width: 100%; margin-top: 7px; padding: 11px 12px; border: 1px solid #ded2c3; border-radius: 6px; background: #fffdf9; color: #5e4f41; font-size: 14px; resize: vertical; }
.modal input::placeholder, .modal textarea::placeholder { color: #ac9b88; font-size: 13px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.honeypot { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.form-error { color: var(--red); font-size: 13px; margin-bottom: 10px; }
.submit-button { width: 100%; }
.success-state { text-align: center; padding: 30px 5px 12px; }
.success-icon { width: 60px; height: 60px; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; background: #f4eadb; color: #9d7442; font-size: 30px; }
.success-state h3 { font-size: 23px; margin: 18px 0 12px; font-weight: 500; }
.success-state p { font-size: 13px; color: var(--muted); margin-bottom: 12px; }
.success-state .button { margin-top: 14px; }
.detail-slogan { margin: 25px 0 18px; font: 600 27px/1.7 var(--sans); color: var(--red); white-space: pre-line; overflow-wrap: anywhere; }
.detail-meta { color: #998570; font-size: 12px; }
.detail-story { margin: 20px 0; color: #7f6c59; font-size: 14px; line-height: 1.95; white-space: pre-wrap; overflow-wrap: anywhere; }
.detail-footer { display: flex; align-items: center; justify-content: space-between; border-top: 1px solid var(--line); margin-top: 22px; padding-top: 20px; gap: 16px; }
.mine-item { border: 1px solid var(--line); border-radius: 7px; padding: 17px; margin: 15px 0; }
.mine-item h3 { font: 600 18px/1.7 var(--sans); overflow-wrap: anywhere; }
.mine-meta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-top: 13px; font-size: 11px; color: #9c856e; }
.status { padding: 3px 8px; border-radius: 4px; background: #f3eadc; color: #9d7844; font-size: 11px; }
.status.approved { background: #e8eee4; color: #637e50; }
.status.rejected { background: #f7e7e2; color: #ad5f50; }
.rules-block { padding-top: 22px; }
.rules-block + .rules-block { border-top: 1px solid var(--line); margin-top: 22px; }
.rules-block h3 { font-size: 15px; font-weight: 600; margin-bottom: 9px; }
.rules-block p { color: #8a7560; font-size: 13px; line-height: 1.9; margin-top: 9px; }
.toast { position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%); max-width: calc(100% - 32px); width: max-content; padding: 13px 22px; background: #49332c; color: #fff5e8; border-radius: 8px; font-size: 14px; box-shadow: 0 5px 20px #44211133; z-index: 1000; }

/* Administration retains all existing review and configuration controls. */
.admin-page { background: #f7f4ef; }
.admin-top { background: #fffdf8; border-bottom: 1px solid var(--line); padding: 22px 0; }
.admin-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.admin-header h1 { font-size: 20px; }
.admin-header p { font-size: 12px; color: #9b846d; margin-top: 5px; }
.admin-main { padding-top: 30px; padding-bottom: 50px; }
.admin-login { max-width: 450px; margin: 70px auto; padding: 30px; background: #fffdfa; border: 1px solid var(--line); border-radius: 10px; }
.admin-login h2 { font-size: 24px; }
.admin-login p { font-size: 13px; color: #927a63; margin: 10px 0 20px; }
.admin-login input { width: 100%; margin: 8px 0 20px; padding: 12px; border: 1px solid #dacbb8; border-radius: 6px; }
.admin-login label { font-size: 13px; }
.admin-login .button { width: 100%; }
.admin-login code { overflow-wrap: anywhere; }
.admin-dashboard { display: grid; grid-template-columns: minmax(0,1fr) 300px; gap: 24px; align-items: start; }
.admin-panel { border: 1px solid var(--line); background: #fffdf8; padding: 24px; border-radius: 9px; }
.admin-panel h2 { font-size: 20px; margin-bottom: 16px; }
.admin-panel .form-intro { margin-top: 0; }
.admin-toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 20px; flex-wrap: wrap; }
.admin-toolbar select { padding: 9px; border: 1px solid #dacdbf; background: white; border-radius: 5px; }
.admin-toolbar .button { font-size: 12px; min-height: 36px; }
.admin-entry { padding: 20px 0; border-top: 1px solid var(--line); }
.admin-entry h3 { font: 600 20px/1.7 var(--serif); margin: 10px 0; overflow-wrap: anywhere; }
.admin-entry p { font-size: 13px; color: #8b755f; white-space: pre-wrap; overflow-wrap: anywhere; margin: 8px 0; }
.admin-entry .entry-info { font-size: 12px; }
.admin-actions { display: flex; gap: 8px; margin-top: 13px; flex-wrap: wrap; }
.admin-actions button { font-size: 12px; min-height: 34px; padding: 6px 12px; }
.admin-actions .admin-delete { color: #b32430; border-color: #dca9a8; }
.admin-actions .admin-delete:hover { background: #fbeaea; }
.delete-slogan { margin: 22px 0 14px; font-size: 20px; font-weight: 700; overflow-wrap: anywhere; }
.delete-actions { display: flex; justify-content: flex-end; gap: 12px; margin-top: 24px; }
.settings-form .toggle-label { display: flex; align-items: center; gap: 8px; }
.settings-form input[type=checkbox] { accent-color: var(--red); }
.settings-form .button { width: 100%; }
.admin-count { font-size: 12px; color: #9d8268; }
.admin-message { padding: 20px; border: 1px solid var(--line); border-radius: 7px; background: #fff9ef; line-height: 2; overflow-wrap: anywhere; }
.admin-top .button { font-size: 12px; }

@media (max-width: 900px) {
  .container { padding-left: 24px; padding-right: 24px; }
  .entry-card { grid-template-columns: 24px minmax(0, 1fr) auto; column-gap: 16px; }
  .slogan-title { font-size: 21px; }
  .admin-dashboard { grid-template-columns: minmax(0, 1fr) 270px; gap: 18px; }
}
@media (max-width: 760px) {
  /* Share the first line with the number; let the action row span the card. */
  .entry-card { grid-template-columns: max-content minmax(0, 1fr); grid-template-areas: "number title" ". author" "actions actions"; align-items: baseline; min-height: 0; padding: 14px 16px; column-gap: 10px; row-gap: 10px; }
  .slogan-title { font-size: 21px; line-height: 1.5; }
  .slogan-link { text-wrap: balance; }
  .card-bottom { flex-direction: row-reverse; min-width: 0; border-left: 0; padding-left: 0; gap: 12px; }
  .entry-card:has(.card-author[hidden]) { grid-template-areas: "number title" "actions actions"; }
  .entry-card:has(.card-author[hidden]) .slogan-title { grid-row: auto; }
}
@media (max-width: 600px) {
  .container { padding-left: 18px; padding-right: 18px; }
  .header-inner { min-height: 44px; gap: 14px; }
  .brand { gap: 10px; }
  .brand-word { font-size: 29px; letter-spacing: -1.5px; }
  .brand-name { padding-left: 10px; font-size: 14px; }
  .brand-name > span { font-size: 10px; letter-spacing: 1px; }
  .header-actions { gap: 13px; }
  .header-actions .text-button { font-size: 12px; }
  .header-mine { min-height: 35px; padding: 6px 10px; font-size: 12px; }
  .section-heading { gap: 12px; margin-bottom: 17px; }
  .section-heading h2 { font-size: 20px; }
  .vote-credit { font-size: 12px; }
  .vote-credit strong { font-size: 17px; }
  .works-toolbar { gap: 12px; margin-bottom: 19px; }
  .tabs { padding: 3px; gap: 2px; }
  .tab { min-height: 34px; min-width: 48px; padding: 5px 10px; font-size: 13px; }
  .search { width: 100%; flex: 1; min-width: 0; padding: 10px; gap: 7px; }
  .search input { font-size: 12px; }
  .search .icon { width: 15px; height: 15px; }
  .entries-grid { gap: 12px; }
  .entry-card { padding: 14px 16px; }
  .slogan-title { font-size: 20px; letter-spacing: 0; }
  .vote-button { min-height: 41px; }
  .footer-inner { font-size: 11px; }
  .modal { padding: 23px 20px; max-height: 92dvh; }
  .modal-header h2 { font-size: 21px; }
  .modal input:not([type=checkbox]), .modal textarea { font-size: 16px; }
  .form-row { gap: 13px; }
  .form-intro { font-size: 12px; }
  .detail-slogan { font-size: 25px; }
  .rules-block p { font-size: 13px; }
  .admin-dashboard { grid-template-columns: 1fr; }
  .admin-panel { padding: 19px; }
  .admin-header { align-items: flex-start; flex-direction: column; gap: 15px; }
  .admin-header h1 { font-size: 18px; }
  .admin-login { margin: 25px auto; padding: 22px; }
}
@media (max-width: 359px) {
  .container { padding-left: 15px; padding-right: 15px; }
  .brand { gap: 8px; }
  .brand-word { font-size: 24px; }
  .brand-name { padding-left: 8px; font-size: 12px; }
  .brand-name > span { font-size: 9px; }
  .header-actions { gap: 8px; }
  .header-mine { padding: 6px 8px; }
  .works-toolbar { gap: 9px; }
  .search { gap: 5px; padding: 10px 8px; }
  .search input { font-size: 11px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *:before, *:after { transition: none !important; animation: none !important; }
}
