:root {
  --paper: #f4f0e8;
  --paper-deep: #e9e2d6;
  --ink: #181817;
  --muted: #6f6b64;
  --line: #cfc7ba;
  --white: #fffdf8;
  --accent: #f15a2a;
  --accent-dark: #c94219;
  --success: #1e7a55;
  --shadow: 0 18px 60px rgba(43, 36, 26, 0.08);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  background:
    linear-gradient(rgba(24, 24, 23, 0.035) 1px, transparent 1px),
    var(--paper);
  background-size: 100% 32px;
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Microsoft YaHei", sans-serif;
}

button,
input,
textarea {
  font: inherit;
}

button,
label[for] {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
}

.site-header {
  display: flex;
  max-width: 1180px;
  height: 86px;
  margin: 0 auto;
  padding: 0 28px;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-size: 17px;
  font-weight: 750;
  letter-spacing: -0.02em;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 15px;
}

.status-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 4px rgba(30, 122, 85, 0.1);
}

main {
  width: min(100% - 40px, 1080px);
  margin: 0 auto;
}

.hero {
  position: relative;
  padding: 92px 0 72px;
}

.hero::after {
  position: absolute;
  top: 86px;
  right: 2%;
  width: 132px;
  height: 132px;
  border: 28px solid var(--accent);
  border-radius: 50%;
  content: "";
  opacity: 0.92;
}

.eyebrow,
.step {
  margin: 0 0 15px;
  color: var(--accent-dark);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hero h1 {
  max-width: 780px;
  margin: 0;
  font-family: Georgia, "Songti SC", "SimSun", serif;
  font-size: clamp(64px, 9.2vw, 116px);
  font-weight: 500;
  letter-spacing: -0.065em;
  line-height: 0.86;
}

.lede {
  max-width: 500px;
  margin: 42px 0 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.75;
}

.workspace,
.result-card,
.recent {
  border: 1px solid var(--line);
  background: rgba(255, 253, 248, 0.88);
  box-shadow: var(--shadow);
}

.workspace {
  padding: 34px;
}

.workspace-head,
.section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 30px;
}

h2 {
  margin: 0;
  font-family: Georgia, "Songti SC", "SimSun", serif;
  font-size: 34px;
  font-weight: 500;
  letter-spacing: -0.035em;
}

.token-field {
  width: min(100%, 330px);
}

.token-field span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.token-field input {
  width: 100%;
  height: 44px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 0;
  outline: none;
  background: var(--white);
  color: var(--ink);
}

.token-field input:focus,
.paste-wrap textarea:focus {
  border-color: var(--ink);
  box-shadow: 0 0 0 3px rgba(24, 24, 23, 0.08);
}

.mode-tabs {
  display: flex;
  gap: 6px;
  margin-top: 34px;
  border-bottom: 1px solid var(--line);
}

.mode-tab {
  position: relative;
  padding: 13px 16px;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 14px;
  font-weight: 650;
}

.mode-tab::after {
  position: absolute;
  right: 12px;
  bottom: -1px;
  left: 12px;
  height: 2px;
  background: transparent;
  content: "";
}

.mode-tab.active {
  color: var(--ink);
}

.mode-tab.active::after {
  background: var(--accent);
}

#file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.drop-zone {
  display: flex;
  min-height: 270px;
  margin-top: 24px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  border: 1px dashed #aaa195;
  background: var(--paper);
  cursor: pointer;
  transition:
    background 160ms ease,
    border-color 160ms ease,
    transform 160ms ease;
}

.drop-zone:hover,
.drop-zone.dragging {
  border-color: var(--accent);
  background: #f8eee5;
  transform: translateY(-2px);
}

.upload-icon {
  display: grid;
  width: 54px;
  height: 54px;
  margin-bottom: 22px;
  place-items: center;
  border: 1px solid var(--ink);
  border-radius: 50%;
  font-size: 24px;
}

.drop-zone strong {
  font-size: 18px;
  font-weight: 700;
}

.drop-zone > span:last-child {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
}

.paste-wrap {
  display: block;
  margin-top: 24px;
}

.paste-wrap textarea {
  display: block;
  width: 100%;
  min-height: 270px;
  padding: 22px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 0;
  outline: none;
  background: #191917;
  color: #f2eee6;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
  line-height: 1.65;
  tab-size: 2;
}

.paste-wrap textarea::placeholder {
  color: #88847d;
}

.publish-row {
  display: flex;
  margin-top: 24px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.publish-row p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.publish-row p.error {
  color: #ad2f1c;
}

.primary-button {
  display: inline-flex;
  min-width: 180px;
  height: 52px;
  padding: 0 20px;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--white);
  cursor: pointer;
  font-weight: 700;
  transition:
    transform 150ms ease,
    background 150ms ease;
}

.primary-button:hover {
  background: var(--accent-dark);
  transform: translateY(-2px);
}

.primary-button:disabled {
  cursor: wait;
  opacity: 0.6;
  transform: none;
}

.result-card {
  display: grid;
  margin-top: 22px;
  padding: 30px 34px;
  grid-template-columns: 0.7fr 1.3fr;
  gap: 34px;
  border-color: #8bb6a0;
  background: #edf5ef;
}

.result-card[hidden] {
  display: none;
}

.url-box {
  display: flex;
  align-items: center;
  align-self: end;
  border-bottom: 1px solid #94aa9d;
}

.url-box a {
  min-width: 0;
  padding: 13px 0;
  flex: 1;
  overflow: hidden;
  color: var(--success);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.url-box button,
.text-button {
  border: 0;
  background: transparent;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
}

.url-box button {
  padding: 13px 0 13px 16px;
}

.recent {
  margin: 72px 0 64px;
  padding: 34px;
  box-shadow: none;
}

.text-button {
  padding: 8px 0;
  border-bottom: 1px solid var(--ink);
}

.site-list {
  margin-top: 28px;
  border-top: 1px solid var(--line);
}

.site-row {
  display: grid;
  padding: 18px 0;
  align-items: center;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 22px;
  border-bottom: 1px solid var(--line);
}

.site-title {
  min-width: 0;
}

.site-title a {
  display: block;
  overflow: hidden;
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.site-title span,
.site-meta {
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
}

.site-title span {
  display: block;
  margin-top: 5px;
}

.site-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.delete-button {
  padding: 7px 0;
  border: 0;
  background: transparent;
  color: #a23826;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
}

.copy-url-button {
  padding: 7px 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
}

.copy-url-button:hover {
  color: var(--ink);
}

.empty-state {
  margin: 0;
  padding: 42px 0 18px;
  color: var(--muted);
  text-align: center;
}

footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: min(100% - 40px, 1080px);
  margin: 0 auto;
  padding: 24px 0 40px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  text-align: center;
}

footer p {
  margin: 0;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
  white-space: nowrap;
}

@media (max-width: 760px) {
  .site-header {
    height: 72px;
    padding: 0 20px;
  }

  main {
    width: min(100% - 24px, 1080px);
  }

  .hero {
    padding: 64px 4px 50px;
  }

  .hero::after {
    top: 57px;
    right: 4px;
    width: 62px;
    height: 62px;
    border-width: 13px;
  }

  .hero h1 {
    max-width: 96%;
    font-size: clamp(54px, 18vw, 84px);
  }

  .lede {
    max-width: 88%;
    margin-top: 30px;
    font-size: 15px;
  }

  .workspace,
  .recent {
    padding: 22px;
  }

  .workspace-head,
  .section-head {
    flex-direction: column;
  }

  .token-field {
    width: 100%;
  }

  .drop-zone,
  .paste-wrap textarea {
    min-height: 230px;
  }

  .publish-row {
    align-items: stretch;
    flex-direction: column;
  }

  .primary-button {
    width: 100%;
  }

  .result-card {
    padding: 22px;
    grid-template-columns: 1fr;
  }

  .recent {
    margin-top: 52px;
  }

  .section-head {
    align-items: flex-start;
    gap: 12px;
  }

  .site-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .site-meta {
    display: none;
  }

  footer {
    width: min(100% - 24px, 1080px);
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}

/* 飞书登录 / 用户信息 */
.feishu-login {
  align-self: end;
  padding: 10px 18px;
  border-radius: 12px;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--white);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.feishu-login:hover {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
}

.user-chip {
  align-self: end;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--white);
  font-size: 14px;
  color: var(--ink);
}

.user-chip .user-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--accent);
}

.user-chip #user-name {
  font-weight: 600;
}

.user-chip button {
  border: none;
  background: none;
  padding: 0;
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
}

.user-chip button:hover {
  color: var(--accent-dark);
}

.login-gate {
  display: flex;
  justify-content: center;
  padding: 24px 0 64px;
}

.gate-card {
  width: 100%;
  max-width: 460px;
  padding: 48px 40px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: var(--white);
  box-shadow: var(--shadow);
  text-align: center;
}

.gate-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: var(--ink);
  color: var(--paper);
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 20px;
}

.gate-card h2 {
  font-size: 22px;
  margin-bottom: 10px;
}

.gate-card p {
  color: var(--muted);
  margin-bottom: 28px;
}

.gate-card .primary-button {
  width: 100%;
  justify-content: center;
}

.gate-card .primary-button.gate-feishu {
  margin-bottom: 4px;
}

.gate-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0;
  color: var(--muted);
  font-size: 13px;
}

.gate-divider::before,
.gate-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.email-login {
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-align: left;
}

.email-login input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--white);
  color: var(--ink);
  font-size: 15px;
}

.email-login input:focus {
  outline: none;
  border-color: var(--ink);
}

.email-login input[readonly] {
  background: var(--paper-deep);
  color: var(--muted);
}

.email-login .primary-button {
  width: 100%;
  justify-content: center;
}

.email-note {
  min-height: 18px;
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}

.email-note.error {
  color: var(--accent-dark);
}

.invite-hint {
  color: var(--muted);
  font-size: 13px;
  margin: 0 0 14px;
}

.invite-form {
  display: flex;
  gap: 10px;
  align-items: center;
}

.invite-form input {
  flex: 1;
  padding: 11px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--white);
  color: var(--ink);
  font-size: 15px;
}

.invite-form input:focus {
  outline: none;
  border-color: var(--ink);
}

.invite-form .primary-button {
  white-space: nowrap;
}

.beian {
  margin-top: 6px;
  font-size: 12px;
  opacity: 0.55;
}

.beian a {
  color: inherit;
  text-decoration: none;
}

.beian a:hover {
  text-decoration: underline;
}

.gate-note {
  margin: 4px 0 0;
  font-size: 12px;
  line-height: 1.6;
  color: var(--muted);
  text-align: left;
}

.visibility-field {
  margin-top: 24px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  background: var(--paper);
}

.visibility-field legend {
  padding: 0 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.visibility-field label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-right: 20px;
  font-size: 14px;
  cursor: pointer;
}

.visibility-field .pw-input {
  display: block;
  width: min(100%, 320px);
  margin-top: 12px;
  padding: 10px 13px;
  border: 1px solid var(--line);
  background: var(--white);
  color: var(--ink);
  font-size: 14px;
}

.visibility-field .pw-input:focus {
  outline: none;
  border-color: var(--ink);
}

.gate-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 320px;
  margin: 22px auto 0;
}

.gate-form input {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--white);
  color: var(--ink);
  font-size: 15px;
}

.gate-form input:focus {
  outline: none;
  border-color: var(--ink);
}

.gate-form .primary-button {
  justify-content: center;
}

.gate-error {
  color: var(--accent-dark);
  font-size: 14px;
}

.notice {
  max-width: 520px;
  margin: 120px auto;
  padding: 0 24px;
  text-align: center;
}

.notice h1 {
  font-size: 22px;
  margin-bottom: 16px;
}

.notice a {
  color: var(--accent-dark);
}
