@import url("/web/web-conversations.css");

:root {
  --paper: #faf9f6;
  --ink: #211e1c;
  --muted: #655e59;
  --line: #ddd8d1;
  --accent: #ac1928;
  --tint: #efece6;
  --serif: "Iowan Old Style", "Palatino Linotype", "Songti SC", Georgia, serif;
  font:
    16px / 1.5 -apple-system,
    BlinkMacSystemFont,
    "PingFang SC",
    "Microsoft YaHei",
    "Segoe UI",
    sans-serif;
  color: var(--ink);
  background: var(--paper);
  color-scheme: light;
}

* {
  box-sizing: border-box;
}
body {
  margin: 0;
  min-height: 100dvh;
}
[hidden] {
  display: none !important;
}
a {
  color: var(--accent);
  text-underline-offset: 0.18em;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
summary {
  cursor: pointer;
}
button,
a,
summary {
  -webkit-tap-highlight-color: transparent;
}
button {
  min-height: 44px;
  border: 1px solid var(--line);
  padding: 0.48rem 0.9rem;
  border-radius: 7px;
  color: var(--ink);
  background: transparent;
  font-weight: 590;
}
button:hover,
summary:hover {
  background-color: var(--tint);
}
button:disabled {
  opacity: 0.55;
  cursor: wait;
}
button.primary,
button[type="submit"] {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}
button.primary:hover,
button[type="submit"]:hover {
  background: #483f39;
}
:where(a, button, input, select, textarea, summary):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
h1,
h2,
h3,
p,
a,
button,
summary {
  overflow-wrap: anywhere;
}
h1,
h2,
h3 {
  line-height: 1.12;
  text-wrap: balance;
}
h1 {
  margin: 0 0 1.3rem;
  font: 520 clamp(2.45rem, 7vw, 3.8rem) / 1 var(--serif);
  letter-spacing: -0.05em;
}
h2 {
  margin: 1.4rem 0 0.55rem;
  font-size: 1.3rem;
  letter-spacing: -0.025em;
}
h3 {
  font-size: 1.08rem;
}
p {
  margin: 0.65em 0;
}
:lang(zh) h1 {
  letter-spacing: -0.05em;
  font-weight: 650;
}
.ui-icon {
  width: 22px;
  height: 22px;
  display: inline-block;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
#mast {
  max-width: 960px;
  margin: auto;
  padding: 14px 22px;
  min-height: 63px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--line);
}
#mast > a {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--ink);
  font-size: 1.31rem;
  font-weight: 720;
  text-decoration: none;
  letter-spacing: 0.035em;
}
#mast > a img {
  display: block;
  width: 32px;
  height: 32px;
}
#mast-actions {
  display: flex;
  gap: 4px;
  align-items: center;
}
#mast-actions :is(a, button) {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 42px;
  padding: 7px 12px;
  text-decoration: none;
  color: var(--ink);
  font-size: 0.89rem;
  font-weight: 600;
  border: 1px solid var(--line);
  border-radius: 28px;
}
#mast-actions .ui-icon {
  width: 17px;
  height: 17px;
}
main {
  max-width: 740px;
  margin: auto;
  padding: 28px 22px calc(84px + env(safe-area-inset-bottom));
}
main:has(.discover-view) {
  max-width: 960px;
}
#tabs {
  position: fixed;
  inset: auto 0 0;
  display: flex;
  justify-content: center;
  z-index: 4;
  background: var(--paper);
  border-top: 1px solid var(--line);
  padding: 3px 8px calc(4px + env(safe-area-inset-bottom));
}
#tabs a {
  position: relative;
  min-width: 0;
  flex: 1 1 0;
  max-width: 155px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: 54px;
  color: var(--muted);
  font-weight: 525;
  font-size: 0.7rem;
  text-decoration: none;
}
#tabs a[aria-current="page"] {
  color: var(--accent);
  font-weight: 700;
}
#tabs a[aria-current="page"]::before {
  content: "";
  width: 26px;
  height: 2px;
  background: var(--accent);
  position: absolute;
  top: -4px;
}
#tabs a .ui-icon {
  width: 21px;
  height: 21px;
}
#notice {
  position: fixed;
  bottom: calc(76px + env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  max-width: min(90vw, 480px);
  padding: 0.7rem 1rem;
  background: var(--ink);
  color: #fff;
  border-radius: 8px;
  z-index: 5;
}
.auth {
  max-width: 400px;
  margin: clamp(12px, 6vh, 64px) auto;
}
.auth h1 {
  margin-bottom: 1.4rem;
}
.auth form > button[type="submit"] {
  width: 100%;
  margin-top: 12px;
}
.auth .actions > button {
  border: 0;
  color: var(--accent);
  padding-inline: 0;
  margin-right: 14px;
}
label {
  display: grid;
  gap: 5px;
  margin: 13px 0;
  font-size: 0.88rem;
  font-weight: 570;
}
input,
select,
textarea {
  padding: 11px 12px;
  min-width: 0;
  width: 100%;
  border: 1px solid #beb7ad;
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font-size: 1rem;
  font-weight: 400;
}
textarea {
  min-height: 8em;
  resize: vertical;
}
input[type="checkbox"] {
  width: 20px;
  height: 20px;
  accent-color: var(--accent);
}
label.switch {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
}
form {
  max-width: 38rem;
}
form [role="alert"]:empty,
[role="status"]:empty {
  display: none;
}
[role="alert"]:not(:empty) {
  color: var(--accent);
}
.row,
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.actions {
  margin: 10px 0;
}
.panel,
section.card {
  padding: 17px 0;
  border-bottom: 1px solid var(--line);
}
.panel > h2 {
  margin-top: 0;
}
.muted,
small,
time {
  color: var(--muted);
  font-size: 0.85rem;
}
details {
  margin: 10px 0;
}
summary {
  padding: 9px 0;
  font-weight: 600;
}
code {
  display: inline-block;
  max-width: 100%;
  padding: 0.4rem 0.7rem;
  background: var(--tint);
  overflow-wrap: anywhere;
  user-select: all;
}
progress {
  width: 100%;
  accent-color: var(--accent);
}
figure {
  margin: 0;
}
img,
video {
  max-width: 100%;
  height: auto;
}

.discover-hero {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: end;
  align-items: start;
  min-height: clamp(255px, 69vw, 386px);
  padding: clamp(20px, 4vw, 42px);
  isolation: isolate;
  overflow: hidden;
  color: #fffaf0;
  background: #201b19 url("/web/atelier.webp") center 46% / cover no-repeat;
}
.discover-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(0deg, rgb(17 12 9 / 72%), transparent 55%);
}
.discover-hero h1 {
  font-size: clamp(3.2rem, 10vw, 5.7rem);
  margin: 0;
  max-width: 12ch;
  line-height: 0.98;
  text-shadow: 0 1px 4px #271815;
}
.discover-view {
  padding-bottom: 16px;
}
.creator-list {
  margin-top: 18px;
  padding: 0;
  list-style: none;
}
.creator-link {
  position: relative;
  display: grid;
  align-content: center;
  gap: 2px;
  min-height: 76px;
  padding: 16px 38px 16px 0;
  text-decoration: none;
  color: var(--ink);
  border-bottom: 1px solid var(--line);
}
.creator-link::after {
  position: absolute;
  content: "↗";
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.3rem;
  color: var(--accent);
}
.creator-link:hover .creator-name {
  color: var(--accent);
}
.creator-name {
  font-size: 1.16rem;
  font-weight: 630;
  letter-spacing: -0.015em;
}
.creator-offer {
  font-size: 0.88rem;
  color: var(--muted);
}
.store-view .panel,
[data-page="store"] .panel {
  padding-block: 18px;
}
.feed-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}
.feed-heading h1 {
  margin: 0;
}
.feed-heading a,
.feed-empty a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--accent);
  min-height: 44px;
  font-size: 0.9rem;
  font-weight: 630;
  text-decoration: none;
}
.feed-heading a .ui-icon {
  width: 17px;
}
.feed-post {
  padding: 16px 0 14px;
  border-top: 1px solid var(--line);
}
.post-byline {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: space-between;
  margin-bottom: 12px;
}
.post-author {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  font-size: 0.96rem;
  font-weight: 650;
  color: var(--ink);
  text-decoration: none;
}
.author-initial {
  display: inline-grid;
  place-items: center;
  width: 33px;
  height: 33px;
  flex: none;
  border-radius: 50%;
  background: #e9ddce;
  color: #593525;
  font: 600 1.12rem var(--serif);
}
.post-byline time {
  white-space: nowrap;
  font-size: 0.76rem;
}
.media {
  display: block;
  width: 100%;
  max-height: 74dvh;
  object-fit: contain;
  background: #191715;
}
.media + .media {
  margin-top: 4px;
}
.post-text {
  margin: 13px 0 6px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.55;
}
.post-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 2px;
  margin-top: 5px;
}
.post-actions > :is(a, button) {
  min-height: 44px;
  min-width: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px;
  color: var(--muted);
  text-decoration: none;
  border: 0;
  font-size: 0.84rem;
  font-weight: 560;
}
.post-actions > :first-child {
  padding-left: 0;
  justify-content: start;
}
.post-actions > a:has(.visually-hidden):not(a:has(.visually-hidden) + a) {
  margin-left: auto;
}
.post-actions .ui-icon {
  width: 20px;
  height: 20px;
}
.post-actions [aria-pressed="true"] {
  color: var(--accent);
}
.post-actions [aria-pressed="true"] .ui-icon {
  fill: currentColor;
}
.feed-empty {
  border-top: 1px solid var(--line);
  padding-block: 34px;
}
.feed-empty > .ui-icon {
  color: var(--muted);
  width: 28px;
  height: 28px;
}
.feed-empty p {
  max-width: 32ch;
  color: var(--muted);
}
[data-page="settings"] h1 + h2 {
  margin-bottom: 12px;
}
[data-page="settings"] .actions:first-of-type {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 24px;
}
[data-page="settings"] .actions:first-of-type button {
  text-align: left;
}

@media (max-width: 580px) {
  .discover-hero {
    margin: -28px -22px 0;
  }
}
@media (min-width: 820px) {
  #mast {
    min-height: 76px;
    padding-inline: 30px;
  }
  main {
    padding: 42px 30px 105px;
  }
  .discover-view {
    display: grid;
    grid-template-columns: minmax(0, 1.12fr) minmax(0, 0.88fr);
    column-gap: 34px;
    align-content: start;
  }
  .discover-hero {
    grid-column: 1;
    grid-row: 1 / span 12;
    align-self: start;
    min-height: 385px;
    background-position: 65% center;
  }
  .discover-view > :not(.discover-hero) {
    grid-column: 2;
  }
  .creator-list {
    margin-top: 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
  }
}
.post-more {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  text-decoration: none;
  font-size: 0.86rem;
  font-weight: 620;
}
.wallet-total {
  display: block;
  font: 580 clamp(2.3rem, 8vw, 3.6rem) / 1.12 var(--serif);
  letter-spacing: -0.055em;
  font-variant-numeric: tabular-nums;
}
.wallet-total + p {
  color: var(--muted);
  margin: 4px 0 24px;
  font-size: 0.9rem;
}
[data-page="wallet"] .panel > button {
  display: block;
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  padding: 12px 0;
  text-align: start;
}
#mast-actions button + button {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}
.store-offer {
  border-top: 1px solid var(--line);
  padding-block: 14px;
}
.store-offer h2,
.store-offer h3 {
  margin-top: 0;
}
.store-offer p {
  color: var(--muted);
}
.auth button:has(.ui-icon) {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
