:root {
  color-scheme: light;
  --bg: #e8e2d6;
  --bg-deep: #ddd6c8;
  --ink: #1b1916;
  --muted: #5f584e;
  --line: #d5cdbf;
  --panel: #fffdf8;
  --header: #1b1916;
  --cream: #f4efe6;
  --green: #0f6e56;
  --green-dark: #0b5341;
  --digit: #0e4d8b;
  --symbol: #9a3412;
  --sep: #8a8175;
  --shadow: 0 12px 32px rgba(70, 48, 18, 0.06);
  --sans: system-ui, -apple-system, "Segoe UI", "PingFang SC", "Hiragino Sans", "Noto Sans CJK SC", "Noto Sans CJK JP", "Noto Sans CJK KR", "Microsoft YaHei", "Yu Gothic", "Malgun Gothic", sans-serif;
  --mono: ui-monospace, "SFMono-Regular", "Cascadia Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html, body { margin: 0; padding: 0; }

body {
  min-height: 100vh;
  font-family: var(--sans);
  color: var(--ink);
  background:
    radial-gradient(900px 280px at 50% -40px, #f7f3ea 0%, transparent 70%),
    var(--bg);
  line-height: 1.4;
}

.topbar {
  height: 48px;
  min-height: 48px;
  max-height: 48px;
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 16px;
  background: var(--header);
  color: var(--cream);
  box-shadow: inset 0 -1px 0 rgba(244, 239, 230, 0.12);
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  color: inherit;
  text-decoration: none;
  font-weight: 680;
  letter-spacing: -0.02em;
  font-size: 15px;
  min-width: 0;
}

.brand img { display: block; width: 18px; height: 18px; }

.lang-menu { position: relative; }

.lang-menu summary {
  list-style: none;
  cursor: pointer;
  height: 28px;
  display: flex;
  align-items: center;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid rgba(244, 239, 230, 0.28);
  font-size: 13px;
  user-select: none;
}

.lang-menu summary::-webkit-details-marker { display: none; }

.lang-menu ul {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  margin: 0;
  padding: 6px;
  list-style: none;
  min-width: 148px;
  background: var(--panel);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow);
  z-index: 40;
}

.lang-menu a {
  display: block;
  padding: 6px 8px;
  border-radius: 7px;
  color: inherit;
  text-decoration: none;
  font-size: 14px;
}

.lang-menu a:hover,
.lang-menu a[aria-current="page"] { background: #f3eee4; }

.first-screen {
  display: grid;
  align-content: start;
  gap: 8px;
  width: min(1120px, calc(100% - 28px));
  margin: 0 auto;
  padding: 10px 0 2px;
}

.first-screen > * { min-width: 0; }

h1 {
  margin: 0;
  font-size: 26px;
  line-height: 1.15;
  letter-spacing: -0.034em;
  font-weight: 720;
}

.lede {
  margin: 0;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.35;
}

@media (min-width: 1100px) {
  h1, .lede { white-space: nowrap; }
}

.output-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(176px, 228px) auto auto;
  gap: 8px;
  align-items: stretch;
}

.secret {
  min-height: 64px;
  max-height: 88px;
  overflow: auto;
  margin: 0;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
  font-family: var(--mono);
  font-size: 22px;
  line-height: 1.35;
  letter-spacing: 0.01em;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.ch-letter { color: var(--ink); }
.ch-digit { color: var(--digit); }
.ch-symbol { color: var(--symbol); }
.ch-sep { color: var(--sep); }

.meter-box {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--panel);
}

.meter-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 6px;
  flex-wrap: wrap;
}

.strength {
  font-size: 13px;
  font-weight: 720;
  white-space: nowrap;
}

.strength[data-level="veryWeak"] { color: #9f2d22; }
.strength[data-level="weak"] { color: #b54708; }
.strength[data-level="fair"] { color: #8a6116; }
.strength[data-level="strong"] { color: #0f6e56; }
.strength[data-level="excellent"] { color: #087443; }

.entropy-badge {
  font-family: var(--mono);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  background: var(--header);
  color: var(--cream);
  border-radius: 999px;
  padding: 2px 8px;
}

.meter-track {
  height: 8px;
  border-radius: 99px;
  background: #e6dfd2;
  overflow: hidden;
}

.meter-fill {
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: var(--green);
}

.meter-fill[data-level="veryWeak"] { background: #9f2d22; }
.meter-fill[data-level="weak"] { background: #b54708; }
.meter-fill[data-level="fair"] { background: #c48a16; }
.meter-fill[data-level="strong"] { background: #0f6e56; }
.meter-fill[data-level="excellent"] { background: #0e8f5b; }

.btn {
  font: inherit;
  font-size: 14px;
  font-weight: 680;
  border-radius: 12px;
  padding: 0 14px;
  cursor: pointer;
  white-space: nowrap;
}

.output-bar > .btn { min-width: 9.5rem; }

.btn-primary {
  background: var(--green);
  color: white;
  border: 1px solid var(--green-dark);
}

.btn-primary:hover { background: #0c5c48; }

.btn-ghost {
  background: var(--panel);
  color: var(--ink);
  border: 1px solid #cfc6b6;
}

.btn-ghost:hover { background: #f7f3ea; }

.btn.is-copied {
  background: var(--header);
  color: var(--cream);
  border-color: var(--header);
}

.btn-small {
  height: 32px;
  border-radius: 8px;
  font-size: 13px;
  padding: 0 10px;
}

.modes {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  width: fit-content;
  max-width: 100%;
  padding: 3px;
  border-radius: 11px;
  background: #e0d9cb;
}

.modes button {
  border: 0;
  background: transparent;
  color: #3f392f;
  font: inherit;
  font-size: 13.5px;
  font-weight: 650;
  height: 32px;
  padding: 0 12px;
  border-radius: 8px;
  cursor: pointer;
}

.modes button[aria-selected="true"] {
  background: var(--panel);
  color: var(--ink);
  box-shadow: 0 1px 2px rgba(40, 28, 10, 0.08);
}

.controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  min-height: 36px;
}

.field, .check {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
}

.check {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 10px;
}

input[type="range"] { accent-color: var(--green); width: 132px; }

output {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  min-width: 2ch;
}

select, .prefix-input {
  font: inherit;
  font-size: 13px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid #cfc6b6;
  background: var(--panel);
  color: var(--ink);
  padding: 0 8px;
}

.prefix-input { width: 120px; }

.crack {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.crack article {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 7px 12px 8px;
}

.kicker {
  margin: 0;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.time {
  margin: 1px 0 0;
  font-size: 18px;
  line-height: 1.25;
  font-weight: 730;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.rate {
  margin: 2px 0 0;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
}

.batch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.note {
  margin: 0;
  color: var(--muted);
  font-size: 12.5px;
}

.batch-panel {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 253, 248, 0.72);
  padding: 8px 10px 10px;
}

.batch-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.batch-head h2, .docs h2, .miss h1 {
  font-size: 16px;
  margin: 0;
  letter-spacing: -0.02em;
}

.batch-list {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  display: grid;
  gap: 4px;
}

.batch-list li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.mini {
  display: block;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.4;
  overflow-wrap: anywhere;
  background: var(--panel);
  border: 1px solid #e6dfd2;
  border-radius: 8px;
  padding: 6px 8px;
}

.noscript {
  margin: 0;
  font-size: 13px;
  color: #7a3412;
}

.docs {
  width: min(1120px, calc(100% - 28px));
  margin: 22px auto 36px;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(260px, 0.75fr);
  gap: 22px;
  align-items: start;
}

.faq details {
  border-top: 1px solid var(--line);
  padding: 8px 0;
}

.faq details:last-child { border-bottom: 1px solid var(--line); }

.faq summary {
  cursor: pointer;
  font-weight: 680;
  font-size: 14.5px;
}

.faq p, .security p, .partner-list p {
  margin: 6px 0 0;
  color: #3f392f;
  font-size: 14px;
  line-height: 1.55;
}

.security { margin-top: 16px; }

.partners h2 { margin-bottom: 8px; }

.disclosure {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  color: #3d3426;
  background: #fff6e8;
  border: 1px solid #ead7b2;
  border-radius: 10px;
  padding: 8px 10px;
}

.partner-list {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.partner-list a {
  color: var(--green-dark);
  font-weight: 750;
}

.site-foot {
  border-top: 1px solid var(--line);
  min-height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.miss {
  width: min(720px, calc(100% - 28px));
  margin: 28px auto 48px;
  display: grid;
  gap: 10px;
}

.miss a { color: var(--green-dark); }

:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
}

@media (max-width: 860px) {
  .output-bar { grid-template-columns: 1fr 1fr; }
  .secret { grid-column: 1 / -1; }
  .docs { grid-template-columns: 1fr; margin-top: 18px; }
}

@media (max-width: 720px) {
  h1 { font-size: 22px; }
  .crack { grid-template-columns: 1fr; }
  .output-bar { grid-template-columns: 1fr; }
  .batch-row { align-items: stretch; flex-direction: column; }
  .site-foot { white-space: normal; }
}

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