:root {
  --bg: #0c1116;
  --panel: #131a21;
  --line: #222c36;
  --text: #dbe4ec;
  --muted: #8296a8;
  --accent: #4fd1a5;
  --accent-press: #3fbb92;
  --danger: #f08a8a;
  --radius: 10px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.55 var(--font);
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

code {
  font-family: var(--mono);
  font-size: 0.88em;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 4px;
  padding: 0.1em 0.35em;
}

/* Header */
.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 680px;
  width: 100%;
  margin: 0 auto;
  padding: 1rem 1.25rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--text);
  font-weight: 650;
  font-size: 1rem;
}
.brand:hover { text-decoration: none; }
.brand svg { width: 16px; height: 16px; fill: var(--accent); }

.top nav {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.85rem;
}
.top nav a { color: var(--muted); }
.top nav a:hover { color: var(--text); text-decoration: none; }

.link-btn {
  background: none;
  border: 0;
  padding: 0;
  color: var(--muted);
  font: inherit;
  font-size: 0.85rem;
  cursor: pointer;
}
.link-btn:hover { color: var(--text); }

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.dot.on { background: var(--accent); box-shadow: 0 0 6px var(--accent); }
.dot.off { background: #3a4653; }

/* Layout */
main {
  flex: 1;
  width: 100%;
  max-width: 680px;
  margin: 0 auto;
  padding: 0 1.25rem 2rem;
}

.intro { padding: 1.5rem 0 1.25rem; }
.intro h1 { margin: 0 0 0.3rem; font-size: 1.35rem; font-weight: 650; letter-spacing: -0.01em; }
.intro p { margin: 0; color: var(--muted); font-size: 0.92rem; }

/* Card */
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem;
}

.card h2 { margin: 0 0 0.75rem; font-size: 1rem; font-weight: 650; }

.row { display: flex; gap: 0.5rem; }

input[type="text"] {
  flex: 1;
  min-width: 0;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.6rem 0.75rem;
  color: var(--text);
  font: inherit;
  font-family: var(--mono);
  font-size: 0.9rem;
}
input[type="text"]::placeholder { color: #55677a; font-family: var(--mono); }
input[type="text"]:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(79, 209, 165, 0.15);
}

button[type="submit"] {
  background: var(--accent);
  color: #06251b;
  border: 0;
  border-radius: 8px;
  padding: 0.6rem 1.1rem;
  font: inherit;
  font-weight: 650;
  font-size: 0.9rem;
  cursor: pointer;
  white-space: nowrap;
}
button[type="submit"]:hover { background: var(--accent-press); }
button[type="submit"]:disabled { opacity: 0.55; cursor: wait; }

.hint {
  margin: 0.6rem 0 0;
  color: var(--muted);
  font-size: 0.8rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1rem;
  align-items: center;
}
.fresh {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  cursor: pointer;
  user-select: none;
}
.fresh input { accent-color: var(--accent); margin: 0; }

/* Setup steps */
.setup {
  margin: 0 0 1rem;
  padding-left: 1.2rem;
  color: var(--muted);
  font-size: 0.9rem;
  display: grid;
  gap: 0.35rem;
}

/* Feedback + results */
.feedback {
  margin-top: 0.75rem;
  font-size: 0.85rem;
  border-radius: 8px;
  padding: 0.55rem 0.75rem;
}
.feedback.error { background: rgba(240, 138, 138, 0.1); color: var(--danger); }
.feedback.info { background: rgba(79, 209, 165, 0.08); color: var(--accent); }

.result-head {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.25rem 0.6rem;
  margin: 1rem 0 0.5rem;
}
.result-head strong { font-size: 0.95rem; }
.result-head span { color: var(--muted); font-size: 0.8rem; }

.files { display: grid; gap: 0.4rem; }

.file {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.55rem 0.75rem;
  background: var(--bg);
}
.file .meta { min-width: 0; }
.file .name {
  display: block;
  font-family: var(--mono);
  font-size: 0.8rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.file .sub { color: var(--muted); font-size: 0.72rem; }
.file a {
  flex-shrink: 0;
  border: 1px solid var(--accent);
  border-radius: 6px;
  padding: 0.3rem 0.7rem;
  font-size: 0.8rem;
  font-weight: 600;
}
.file a:hover { background: rgba(79, 209, 165, 0.1); text-decoration: none; }

/* About / guide */
.about {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1.25rem;
  padding: 1.75rem 0 0;
}
.about h3 { margin: 0 0 0.25rem; font-size: 0.85rem; font-weight: 650; }
.about p { margin: 0; color: var(--muted); font-size: 0.82rem; }

.guide {
  margin: 0;
  padding-left: 1.2rem;
  display: grid;
  gap: 0.9rem;
  font-size: 0.9rem;
}
.guide strong { display: block; margin-bottom: 0.15rem; }
.guide p { margin: 0; color: var(--muted); font-size: 0.85rem; }

/* Footer */
.bottom {
  max-width: 680px;
  width: 100%;
  margin: 0 auto;
  padding: 1rem 1.25rem 1.5rem;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  color: var(--muted);
  font-size: 0.75rem;
}
.bottom a { color: var(--muted); }

@media (max-width: 480px) {
  .row { flex-direction: column; }
  .fresh { margin-left: 0; }
  .file { flex-direction: column; align-items: stretch; }
  .file a { text-align: center; }
}
