:root {
  --color-primary: #1c1917;
  --color-accent: #a16207;
  --color-background: #fafaf9;
  --color-foreground: #0c0a09;
  --color-muted-foreground: #57534e;
  --color-border: #d6d3d1;
  --color-destructive: #b91c1c;
  --color-success: #166534;
  --font-serif: Cormorant, 'Noto Serif TC', serif;
  --font-sans: Montserrat, 'Noto Sans TC', sans-serif;
}

* {
  box-sizing: border-box;
}
[hidden] {
  display: none !important;
}
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  background: var(--color-background);
  color: var(--color-foreground);
  line-height: 1.8;
}
h1,
h2,
.logo {
  font-family: var(--font-serif);
}
a {
  color: inherit;
}
a,
button {
  cursor: pointer;
  transition: color 0.25s, background-color 0.25s, border-color 0.25s;
}
:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 4px;
}
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* 頁首與頁尾 */
header.site {
  text-align: center;
  padding: 36px 20px 0;
}
.logo {
  font-weight: 700;
  font-size: 38px;
  text-decoration: none;
  letter-spacing: 0.08em;
}
header.site nav {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 18px;
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
}
header.site nav a {
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.14em;
  min-height: 48px;
  padding: 10px 18px;
  display: inline-flex;
  align-items: center;
}
header.site nav a:hover,
header.site nav a[aria-current='page'] {
  color: var(--color-accent);
}
footer.site {
  border-top: 1px solid var(--color-border);
  padding: 24px;
  display: flex;
  gap: 28px;
  flex-wrap: wrap;
  justify-content: center;
  font-size: 13px;
  letter-spacing: 0.08em;
  color: var(--color-muted-foreground);
}

/* 版面 */
main {
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 24px 96px;
  min-height: 60vh;
}
.hero {
  text-align: center;
  padding: 88px 0 56px;
}
.page-head {
  padding: 64px 0 32px;
}
.notice {
  text-align: center;
  padding: 88px 0 0;
  max-width: 680px;
  margin: 0 auto;
}
.center {
  text-align: center;
  padding-top: 36px;
}
h1 {
  font-weight: 700;
  font-size: clamp(34px, 5vw, 60px);
  line-height: 1.25;
  margin: 0 0 12px;
  overflow-wrap: anywhere;
}
.hero h1 {
  font-size: clamp(38px, 6vw, 76px);
  margin-bottom: 20px;
}
.view h1 {
  font-size: clamp(28px, 4vw, 40px);
  margin-bottom: 4px;
}
h2 {
  font-weight: 700;
  font-size: 28px;
  line-height: 1.3;
  margin: 0 0 8px;
}
.lead {
  color: var(--color-muted-foreground);
  max-width: 30em;
  margin: 0 auto;
}
.gold {
  width: 56px;
  height: 2px;
  background: var(--color-accent);
  margin: 28px auto;
  border: 0;
}
.hint {
  font-size: 14px;
  color: var(--color-muted-foreground);
}
.cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 72px;
  align-items: start;
}
.three {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin-top: 88px;
  border-top: 1px solid var(--color-foreground);
}
.three > a {
  padding: 36px 32px 8px;
  text-decoration: none;
  display: block;
}
.three > a + a {
  border-left: 1px solid var(--color-border);
}
.three > a:hover h2 {
  color: var(--color-accent);
}
.three p {
  margin: 0;
}

/* 表單 */
.field {
  max-width: 680px;
  margin: 0 auto;
  text-align: left;
}
.field + .field,
.stack > * + * {
  margin-top: 28px;
}
label.lb,
.lb {
  display: block;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.12em;
  margin-bottom: 4px;
  color: var(--color-muted-foreground);
}
input[type='text'],
input[type='password'],
input[type='url'],
input[type='email'],
textarea {
  font: inherit;
  font-size: 18px;
  width: 100%;
  min-height: 52px;
  padding: 10px 0;
  border: 0;
  border-bottom: 1px solid var(--color-foreground);
  border-radius: 0;
  background: none;
  color: var(--color-foreground);
}
textarea {
  min-height: 140px;
  border: 1px solid var(--color-foreground);
  padding: 12px;
  resize: vertical;
}
input:focus-visible,
textarea:focus-visible {
  outline: 0;
  border-color: var(--color-accent);
  box-shadow: 0 1px 0 var(--color-accent);
}
.btn {
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.16em;
  min-height: 52px;
  padding: 12px 34px;
  border: 1px solid var(--color-primary);
  border-radius: 0;
  background: var(--color-primary);
  color: #fff;
  white-space: nowrap;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.btn:hover {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: #fff;
}
.btn.line {
  background: none;
  color: var(--color-primary);
}
.btn.line:hover {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
}
.btn.sm {
  min-height: 44px;
  padding: 8px 18px;
  font-size: 13px;
  letter-spacing: 0.1em;
}
.btn.block {
  width: 100%;
}
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.btn.danger {
  background: var(--color-destructive);
  border-color: var(--color-destructive);
  color: #fff;
}
.row {
  display: flex;
  gap: 24px;
  align-items: flex-end;
}
.row > input {
  flex: 1;
  min-width: 0;
}
.error {
  color: var(--color-destructive);
  font-weight: 500;
  margin: 12px 0 0;
}
.ok {
  color: var(--color-success);
  font-weight: 500;
  margin: 12px 0 0;
}
.set {
  padding: 20px 0;
  border-top: 1px solid var(--color-border);
}
.set.ck {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}
.set.ck b {
  display: block;
  font-weight: 600;
}
input[type='checkbox'] {
  width: 22px;
  height: 22px;
  accent-color: var(--color-primary);
  flex: none;
}
.check {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.check input {
  margin-top: 4px;
}

/* 上傳 */
.drop {
  display: block;
  border: 1px solid var(--color-foreground);
  padding: 64px 20px;
  text-align: center;
  cursor: pointer;
}
.drop.over,
.drop:hover {
  border-color: var(--color-accent);
  background: #f5f0e6;
}
.drop:focus-within {
  outline: 2px solid var(--color-accent);
  outline-offset: 4px;
}
.drop strong {
  display: block;
  font-family: var(--font-serif);
  font-size: 24px;
}
.filelist {
  list-style: none;
  margin: 28px 0 0;
  padding: 0;
}
.filelist li {
  padding: 14px 0;
  border-top: 1px solid var(--color-border);
}
.filelist .name {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font-weight: 500;
  overflow-wrap: anywhere;
}
.filelist button {
  font: inherit;
  font-size: 14px;
  background: none;
  border: 0;
  padding: 0 4px;
  min-height: 32px;
  color: var(--color-muted-foreground);
  text-decoration: underline;
  flex: none;
}
.bar {
  height: 2px;
  background: var(--color-border);
  margin-top: 12px;
}
.bar i {
  display: block;
  width: 0;
  height: 100%;
  background: var(--color-accent);
  transition: width 0.2s;
}
.result {
  border: 1px solid var(--color-foreground);
  padding: 28px;
  margin-top: 36px;
  text-align: left;
}
.result .actions {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 20px;
}

/* 觀看頁 */
.view {
  padding-top: 56px;
}
.player {
  background: var(--color-primary);
  display: grid;
  place-items: center;
}
.player video {
  width: 100%;
  max-height: 78vh;
  display: block;
  background: #000;
}
.audio {
  border: 1px solid var(--color-foreground);
  padding: 48px 24px;
}
.audio audio {
  width: 100%;
}
.gallery {
  display: grid;
  gap: 16px;
  max-width: 820px;
  margin: 0 auto;
}
.gallery img {
  width: 100%;
  height: auto;
  display: block;
  background: #e7e5e4;
}
.preview {
  max-width: 100%;
  max-height: 320px;
  display: block;
  margin: 0 auto 20px;
}
.target {
  overflow-wrap: anywhere;
  color: var(--color-muted-foreground);
  font-size: 14px;
}

/* 我的檔案 */
.table-wrap {
  overflow-x: auto;
}
table.list {
  width: 100%;
  border-collapse: collapse;
  border-top: 1px solid var(--color-foreground);
}
table.list th {
  text-align: left;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--color-muted-foreground);
  padding: 14px 12px 14px 0;
  border-bottom: 1px solid var(--color-border);
  white-space: nowrap;
}
table.list td {
  padding: 16px 12px 16px 0;
  border-bottom: 1px solid var(--color-border);
  vertical-align: middle;
}
table.list td.title {
  overflow-wrap: anywhere;
  min-width: 200px;
}
table.list .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
table.list .acts {
  white-space: nowrap;
  text-align: right;
}
table.list .acts .btn + .btn {
  margin-left: 8px;
}
.tag {
  font-size: 12px;
  letter-spacing: 0.08em;
  border: 1px solid var(--color-accent);
  color: var(--color-accent);
  padding: 1px 8px;
  margin-left: 8px;
  white-space: nowrap;
}

/* QR Code */
.qr-box {
  border: 1px solid var(--color-foreground);
  padding: 24px;
  display: grid;
  place-items: center;
  min-height: 320px;
  background: #fff;
}
.qr-box canvas {
  width: 100%;
  max-width: 320px;
  height: auto;
}

/* 條款等長文 */
.prose {
  max-width: 68ch;
  margin: 0 auto;
}
.prose h2 {
  margin-top: 48px;
}
.prose li {
  margin-bottom: 8px;
}

@media (max-width: 780px) {
  .three,
  .cols {
    grid-template-columns: 1fr;
  }
  .cols {
    gap: 40px;
  }
  .three > a + a {
    border-left: 0;
    border-top: 1px solid var(--color-border);
  }
  .row {
    flex-direction: column;
    align-items: stretch;
  }
  .hero {
    padding: 48px 0 32px;
  }
  .page-head {
    padding-top: 40px;
  }
}
