:root {
  --bg: #050705;
  --bg-card: #0b120c;
  --bg-input: #081008;
  --fg: #3dff6e;
  --fg-bright: #9dffb8;
  --fg-dim: #1f7a3d;
  --accent: #00e5ff;
  --border: #1f7a3d;
  --danger: #ff4444;
  --ok: #3dff6e;
  --warn: #ffcc33;
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
}

body {
  margin: 0;
  font-family: "Courier New", Consolas, "SFMono-Regular", ui-monospace, monospace;
  background: var(--bg);
  color: var(--fg);
  padding-bottom: 64px;
  position: relative;
}

/* 扫描线纹理，弱化处理，不影响可读性 */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    rgba(61, 255, 110, 0.035) 0px,
    rgba(61, 255, 110, 0.035) 1px,
    transparent 1px,
    transparent 3px
  );
  z-index: 999;
}

header.topbar {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  padding: 12px 16px;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 6px 0;
  position: sticky;
  top: 0;
  z-index: 10;
  box-shadow: 0 1px 12px rgba(61, 255, 110, 0.15);
}

header.topbar .brand {
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.5px;
  color: var(--fg-bright);
  text-shadow: 0 0 8px rgba(61, 255, 110, 0.55);
  white-space: nowrap;
}
header.topbar .brand .tag {
  display: block;
  font-size: 10px;
  color: var(--fg-dim);
  letter-spacing: 1.5px;
  font-weight: 400;
  margin-top: 2px;
  white-space: nowrap;
}
header.topbar nav {
  flex-shrink: 0;
  margin-left: auto;
}
header.topbar nav a {
  margin-left: 10px;
  color: var(--fg-dim);
  text-decoration: none;
  font-size: 12px;
  border: 1px solid transparent;
  padding: 4px 4px;
  white-space: nowrap;
}
header.topbar nav a::before { content: "["; color: var(--fg-dim); }
header.topbar nav a::after { content: "]"; color: var(--fg-dim); }
header.topbar nav a.active, header.topbar nav a:hover {
  color: var(--fg-bright);
  text-shadow: 0 0 6px rgba(61, 255, 110, 0.6);
}

main { max-width: 640px; margin: 0 auto; padding: 16px; position: relative; z-index: 1; }

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 2px;
  padding: 16px;
  margin-bottom: 14px;
  box-shadow: 0 0 16px rgba(61, 255, 110, 0.06), inset 0 0 24px rgba(0,0,0,0.4);
}

h1 {
  font-size: 16px;
  margin: 0 0 12px;
  color: var(--fg-bright);
  text-shadow: 0 0 6px rgba(61, 255, 110, 0.5);
  letter-spacing: 0.5px;
}
h1::before { content: "$ "; color: var(--fg-dim); }

h2 {
  font-size: 13px;
  margin: 0 0 10px;
  color: var(--fg-dim);
  letter-spacing: 0.5px;
}
h2::before { content: "> "; }

.field { margin-bottom: 12px; }
.field label {
  display: block;
  font-size: 12px;
  color: var(--fg-dim);
  margin-bottom: 4px;
  letter-spacing: 0.5px;
}
.field label::before { content: "// "; }

input, select, textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 2px;
  font-size: 15px;
  background: var(--bg-input);
  color: var(--fg-bright);
  font-family: inherit;
}
input::placeholder, textarea::placeholder { color: var(--fg-dim); opacity: 0.8; }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--fg);
  box-shadow: 0 0 8px rgba(61, 255, 110, 0.5);
}
textarea { resize: vertical; min-height: 60px; }

.btn {
  display: inline-block;
  padding: 10px 16px;
  border-radius: 2px;
  border: 1px solid var(--fg);
  font-size: 14px;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  background: transparent;
  color: var(--fg-bright);
  font-family: inherit;
  letter-spacing: 0.5px;
  transition: background 0.12s, color 0.12s, box-shadow 0.12s;
}
.btn::before { content: "> "; }
.btn-primary {
  background: rgba(61, 255, 110, 0.08);
  border-color: var(--fg);
}
.btn-primary:hover {
  background: var(--fg);
  color: #04140a;
  box-shadow: 0 0 14px rgba(61, 255, 110, 0.8);
}
.btn-secondary {
  border-color: var(--border);
  color: var(--fg-dim);
}
.btn-secondary:hover { border-color: var(--fg); color: var(--fg-bright); }
.btn-danger {
  border-color: var(--danger);
  color: var(--danger);
  background: rgba(255, 68, 68, 0.06);
}
.btn-danger:hover { background: var(--danger); color: #1a0505; }
.btn-block { display: block; width: 100%; }

.row { display: flex; gap: 10px; }
.row > * { flex: 1; }

table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--border); }
th {
  color: var(--fg-dim);
  font-weight: 400;
  font-size: 11px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.tag {
  display: inline-block;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 2px;
  background: rgba(61, 255, 110, 0.08);
  border: 1px solid var(--border);
  color: var(--fg-dim);
}

.price { font-weight: 700; color: var(--ok); text-shadow: 0 0 6px rgba(61,255,110,0.5); }
.muted { color: var(--fg-dim); font-size: 12px; }

.flash {
  background: rgba(255, 204, 51, 0.08);
  border: 1px solid var(--warn);
  color: var(--warn);
  padding: 10px 12px;
  border-radius: 2px;
  margin-bottom: 12px;
  font-size: 13px;
}
.flash::before { content: "[!] "; }

.quote-box {
  margin-top: 12px;
  padding: 12px;
  border-radius: 2px;
  background: rgba(0, 229, 255, 0.06);
  border: 1px solid var(--accent);
  color: var(--fg-bright);
  font-size: 13px;
  display: none;
}
.quote-box.show { display: block; }
.quote-box.error {
  background: rgba(255, 68, 68, 0.08);
  border-color: var(--danger);
  color: var(--danger);
}

.actions { display: flex; gap: 8px; }

footer.actionbar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  padding: 10px 16px;
  display: flex;
  justify-content: center;
  z-index: 10;
}
footer.actionbar a { max-width: 640px; width: 100%; }

.spinner {
  display: inline-block;
  width: 12px; height: 12px;
  border: 2px solid var(--accent);
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  vertical-align: middle;
  margin-right: 6px;
}
@keyframes spin { to { transform: rotate(360deg); } }

::selection { background: var(--fg); color: #04140a; }

a { color: var(--accent); }
