:root {
  --ink: #252624;
  --muted: #666962;
  --muted-soft: #85877f;
  --line: #d8d5ce;
  --line-strong: #c8c4bb;
  --surface: #faf9f6;
  --surface-raised: #ffffff;
  --canvas: #f1f0ed;
  --graphite: #272b2e;
  --graphite-hover: #111416;
  --graphite-soft: #eceae5;
  --green: #356744;
  --green-bg: #e5efe6;
  --amber: #8a591c;
  --amber-bg: #f5ead8;
  --gray: #5d615b;
  --gray-bg: #e8e7e2;
  --danger: #a13e37;
  --danger-bg: #f7e7e4;
  --focus: #6f7d8d;
  --radius: 12px;
  --shadow: 0 22px 54px rgba(39, 39, 35, 0.16);
  color: var(--ink);
  background: var(--canvas);
  font-family: "Segoe UI", "Microsoft YaHei", system-ui, sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { min-width: 1000px; scroll-behavior: smooth; }
body { min-width: 1000px; margin: 0; background: var(--canvas); }
body.drawer-active { overflow: hidden; }
button, input, textarea, select { font: inherit; }
button, summary, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
a { color: inherit; }

.skip-link {
  position: fixed;
  z-index: 100;
  top: 10px;
  left: 12px;
  transform: translateY(-160%);
  border-radius: 7px;
  padding: 9px 12px;
  background: var(--graphite);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}
.skip-link:focus { transform: translateY(0); }

:focus { outline: none; }
:focus-visible {
  outline: 3px solid rgba(111, 125, 141, 0.42);
  outline-offset: 3px;
}

.eyebrow {
  margin: 0 0 9px;
  color: var(--muted-soft);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--ink);
  font-size: 15px;
  font-weight: 750;
  letter-spacing: -0.02em;
}

.brand-link { text-decoration: none; }
.brand-mark {
  display: grid;
  grid-template-columns: repeat(2, 7px);
  grid-template-rows: repeat(2, 7px);
  gap: 2px;
  width: 16px;
  height: 16px;
  transform: rotate(30deg);
}
.brand-mark span { border-radius: 2px 2px 0; background: var(--graphite); }
.brand-mark span:nth-child(2) { border-radius: 0 2px 0 0; background: #666a6d; }
.brand-mark span:nth-child(3) { border-radius: 0 0 0 2px; background: #9c9e9a; }

.login-shell {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 48px;
  background:
    linear-gradient(rgba(37, 38, 36, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(37, 38, 36, 0.035) 1px, transparent 1px),
    var(--canvas);
  background-size: 34px 34px;
}

.login-card {
  width: 420px;
  padding: 36px 38px 38px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(250, 249, 246, 0.96);
  box-shadow: 0 24px 60px rgba(39, 39, 35, 0.12);
}

.login-heading { margin: 48px 0 28px; }
.login-heading h1 {
  margin: 0;
  font-size: 27px;
  font-weight: 720;
  letter-spacing: -0.04em;
}
.login-heading > p:last-child {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}
.login-card form { display: grid; gap: 8px; }
.login-card label {
  margin-top: 10px;
  color: #40433f;
  font-size: 13px;
  font-weight: 650;
}
.login-card input {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface-raised);
  color: var(--ink);
}
.login-card input:focus {
  border-color: var(--focus);
  box-shadow: 0 0 0 3px rgba(111, 125, 141, 0.13);
}
.login-submit { margin-top: 15px; }

.app-shell { min-height: 100vh; }
.app-header {
  position: sticky;
  z-index: 10;
  top: 0;
  border-bottom: 1px solid var(--line);
  background: rgba(250, 249, 246, 0.94);
  backdrop-filter: blur(14px);
}
.app-header-inner {
  display: flex;
  width: min(1200px, calc(100% - 72px));
  height: 64px;
  align-items: center;
  justify-content: space-between;
  margin: 0 auto;
}
.utility-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}
.utility-link {
  border: 0;
  border-radius: 7px;
  padding: 7px 9px;
  background: transparent;
  color: #555951;
  font-size: 12px;
  font-weight: 620;
  text-decoration: none;
  transition: background 160ms ease, color 160ms ease;
}
.utility-link:hover { background: var(--graphite-soft); color: var(--ink); }
.utility-link.subtle { padding-inline: 7px; color: var(--muted); font-weight: 560; }
.utility-divider { width: 1px; height: 22px; margin: 0 7px; background: var(--line); }
.account-avatar {
  display: grid;
  width: 29px;
  height: 29px;
  place-items: center;
  border-radius: 50%;
  background: var(--graphite);
  color: #fff;
  font-size: 9px;
  font-weight: 750;
}
.account-copy { min-width: 62px; margin-right: 4px; line-height: 1.1; }
.account-copy strong, .account-copy small { display: block; }
.account-copy strong { font-size: 12px; font-weight: 700; }
.account-copy small { margin-top: 4px; color: var(--muted-soft); font-size: 10px; }

.workspace {
  width: min(1200px, calc(100% - 72px));
  margin: 0 auto;
  padding: 58px 0 70px;
}
.workspace-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 32px;
  margin-bottom: 29px;
}
.workspace-heading h1 {
  margin: 0;
  font-size: 34px;
  font-weight: 710;
  letter-spacing: -0.045em;
  text-wrap: balance;
}
.workspace-heading > div > p:last-child {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.button {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 9px 15px;
  font-size: 13px;
  font-weight: 690;
  line-height: 1.2;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease, box-shadow 160ms ease;
}
.button.primary { background: var(--graphite); color: #fff; }
.button.primary:hover { background: var(--graphite-hover); }
.button.primary:disabled { cursor: wait; background: #858985; color: #f4f4f1; }
.button.secondary { border-color: var(--line-strong); background: var(--surface-raised); color: #454843; }
.button.secondary:hover { border-color: #a9a69d; background: #f4f3ef; }

.notice {
  margin: 0 0 18px;
  padding: 12px 14px;
  border: 1px solid #c6d8c9;
  border-radius: 9px;
  background: var(--green-bg);
  color: var(--green);
  font-size: 13px;
}
.notice.error { border-color: #e4bfba; background: var(--danger-bg); color: var(--danger); }

.library {
  overflow: visible;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: 0 8px 26px rgba(45, 44, 39, 0.045);
}
.library-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}
.library-header h2 { margin: 0; font-size: 14px; font-weight: 720; }
.library-header > div > p { margin: 4px 0 0; color: var(--muted-soft); font-size: 11px; }
.library-hint { margin: 0; color: var(--muted-soft); font-size: 11px; }
.prototype-list { display: grid; }
.prototype-row {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: center;
  min-height: 88px;
  padding: 17px 20px;
  border-bottom: 1px solid #e2dfd8;
  transition: background 150ms ease;
}
.prototype-row:last-child { border-bottom: 0; }
.prototype-row:hover { background: #f6f4ef; }
.prototype-title-line { display: flex; min-width: 0; align-items: center; gap: 10px; }
.prototype-title {
  overflow: hidden;
  color: var(--ink);
  font-size: 14px;
  font-weight: 720;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.prototype-description {
  overflow: hidden;
  max-width: 700px;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.prototype-meta {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 8px;
  color: var(--muted-soft);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}
.meta-separator { width: 3px; height: 3px; border-radius: 50%; background: #aaa9a3; }
.status {
  display: inline-flex;
  width: max-content;
  align-items: center;
  border-radius: 999px;
  padding: 3px 7px;
  font-size: 10px;
  font-weight: 720;
}
.status::before { width: 5px; height: 5px; margin-right: 5px; border-radius: 50%; background: currentColor; content: ""; }
.status.published { background: var(--green-bg); color: var(--green); }
.status.draft { background: var(--amber-bg); color: var(--amber); }
.status.offline { background: var(--gray-bg); color: var(--gray); }
.preview-link { color: #3d5f7f; font-weight: 640; text-decoration: none; }
.preview-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.share-unavailable { color: var(--muted-soft); }

.row-actions { display: flex; align-items: center; gap: 7px; }
.text-button {
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 6px 9px;
  background: var(--surface-raised);
  color: #454843;
  font-size: 11px;
  font-weight: 660;
  white-space: nowrap;
  transition: background 150ms ease, border-color 150ms ease, color 150ms ease;
}
.text-button:hover { border-color: #bdb9af; background: #efede8; }
.text-button.strong { border-color: var(--graphite); background: var(--graphite); color: #fff; }
.text-button.strong:hover { border-color: var(--graphite-hover); background: var(--graphite-hover); }
.text-button.danger { color: var(--danger); }

.row-menu { position: relative; }
.row-menu summary {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-raised);
  color: #5f625c;
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
  list-style: none;
}
.row-menu summary::-webkit-details-marker { display: none; }
.row-menu summary:hover { border-color: #bdb9af; background: #efede8; }
.row-menu-popover {
  position: absolute;
  z-index: 8;
  top: 38px;
  right: 0;
  display: grid;
  width: 138px;
  gap: 2px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface-raised);
  box-shadow: 0 15px 34px rgba(39, 39, 35, 0.14);
}
.row-menu-popover .text-button { width: 100%; justify-content: flex-start; border-color: transparent; background: transparent; text-align: left; }
.row-menu-popover .text-button:hover { background: var(--graphite-soft); }
.row-menu-popover .text-button.danger:hover { background: var(--danger-bg); }

.empty-state { padding: 74px 24px; text-align: center; }
.empty-state .empty-mark { margin: 0 auto 22px; transform: scale(1.55) rotate(30deg); }
.empty-state h2 { margin: 0 0 8px; font-size: 18px; }
.empty-state p { margin: 0 auto 22px; color: var(--muted); font-size: 13px; }

.guide {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 52px;
  margin-top: 56px;
  padding-top: 33px;
  border-top: 1px solid var(--line);
}
.library, .guide { scroll-margin-top: 88px; }
.guide h2 { margin: 0; font-size: 21px; letter-spacing: -0.025em; }
.guide ol { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; margin: 0; padding: 0; list-style: none; }
.guide li { display: grid; grid-template-columns: auto 1fr; column-gap: 10px; }
.guide li > span { grid-row: 1 / span 2; color: #9a9a93; font-size: 10px; font-weight: 750; }
.guide strong { font-size: 12px; }
.guide small { margin-top: 5px; color: var(--muted); font-size: 11px; line-height: 1.6; }

.drawer {
  position: fixed;
  z-index: 30;
  top: 0;
  right: 0;
  width: min(520px, 50vw);
  height: 100vh;
  overflow-y: auto;
  overscroll-behavior: contain;
  transform: translateX(102%);
  border-left: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow);
  transition: transform 190ms ease;
}
.drawer.open { transform: translateX(0); }
.drawer-head {
  position: sticky;
  z-index: 2;
  top: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 25px 28px 21px;
  border-bottom: 1px solid var(--line);
  background: rgba(250, 249, 246, 0.96);
  backdrop-filter: blur(10px);
}
.drawer-head h2 { margin: 0; font-size: 20px; letter-spacing: -0.025em; }
.drawer-head .eyebrow { margin-bottom: 6px; }
.icon-button {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: #5c6059;
  font-size: 24px;
  line-height: 1;
}
.icon-button:hover { border-color: var(--line); background: var(--graphite-soft); }
.backdrop { position: fixed; z-index: 20; inset: 0; background: rgba(35, 36, 34, 0.32); backdrop-filter: blur(1px); }

@media (max-width: 1180px) {
  .app-header-inner, .workspace { width: calc(100% - 48px); }
  .workspace { padding-top: 46px; }
  .prototype-description { max-width: 520px; }
  .guide { grid-template-columns: 190px 1fr; gap: 32px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: 0.01ms !important; }
}
