:root {
  --bg-main: #0f172a;
  --card-bg: #0b1120;
  --accent: #38bdf8;
  --accent-soft: rgba(56, 189, 248, 0.15);
  --text-main: #e5e7eb;
  --text-muted: #9ca3af;
  --border-subtle: #1f2937;
  --danger: #ef4444;
  --warning: #f97316;
  --good: #22c55e;
  --strong: #10b981;
  --very-strong: #22c55e;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 16px 12px 20px;
  background: radial-gradient(circle at top, #1e293b 0, #020617 55%);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text",
    system-ui, -system-ui, "Segoe UI", Helvetica, Arial, sans-serif;
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  font-size: 15px;
}

h1,
h2,
h3 {
  margin: 0;
  font-weight: 600;
}

h1 {
  font-size: 24px;
  letter-spacing: 0.03em;
}

h2 {
  font-size: 16px;
  font-weight: 400;
  color: var(--text-muted);
  margin-top: 6px;
}

.container {
  max-width: 920px;
  margin: 0 auto 10px;
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1.1fr);
  gap: 20px;
}

@media (max-width: 1024px) {
  .container {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  body {
    font-size: 16px;
  }
}

/* Panel */

.panel {
  background: var(--card-bg);
  border-radius: 14px;
  border: 1px solid var(--border-subtle);
  padding: 18px 20px 14px;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.8);
  position: relative;
  overflow: hidden;
}

.panel::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  border: 1px solid rgba(56, 189, 248, 0.08);
  pointer-events: none;
}

.panel:hover::before {
  border-color: rgba(56, 189, 248, 0.16);
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  gap: 8px;
}

.panel-title {
  font-size: 15px;
  font-weight: 600;
}

.panel-subtitle {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.badge-pill {
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 11px;
  color: #93c5fd;
  background: rgba(37, 99, 235, 0.15);
  border: 1px solid rgba(59, 130, 246, 0.35);
  white-space: nowrap;
}

.section-title {
  font-size: 13px;
  font-weight: 600;
  margin: 12px 0 4px;
}

/* Radio group */

.radio-group {
  margin-bottom: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
  background: rgba(15, 23, 42, 0.85);
}

.radio-group label {
  display: block;
  font-size: 13px;
  line-height: 1.5;
  cursor: pointer;
  padding: 3px 2px;
  color: var(--text-main);
}

.radio-group input[type="radio"] {
  margin-right: 6px;
  accent-color: var(--accent);
}

.symbol-group label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-right: 10px;
  margin-bottom: 4px;
  font-size: 13px;
}

.symbol-group .symbol-custom {
  margin-top: 6px;
}

.symbol-group #symbol_custom {
  width: 32px;
  padding: 2px 4px;
  border-radius: 6px;
  border: 1px solid var(--border-subtle);
  background: rgba(15, 23, 42, 0.9);
  color: var(--text-main);
  text-align: center;
}

.hint {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 6px;
  line-height: 1.4;
}

/* Generate button */

button.generate-btn {
  width: 100%;
  padding: 10px 14px;
  margin-top: 14px;
  font-size: 14px;
  border-radius: 999px;
  border: 1px solid #38bdf8;
  cursor: pointer;
  background: linear-gradient(135deg, #38bdf8, #0ea5e9);
  color: #0b1120;
  font-weight: 600;
  letter-spacing: 0.02em;
  box-shadow: 0 10px 30px rgba(8, 47, 73, 0.8);
  transition: transform 0.05s ease-out, box-shadow 0.08s ease-out,
    opacity 0.15s;
}

button.generate-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 40px rgba(8, 47, 73, 0.95);
}

button.generate-btn:active {
  transform: translateY(0);
  box-shadow: 0 8px 20px rgba(8, 47, 73, 0.7);
  opacity: 0.9;
}

button.generate-btn:focus-visible,
.copy-btn:focus-visible {
  outline: 2px solid #38bdf8;
  outline-offset: 2px;
}

/* Result panel base */

#password_result {
  margin-top: 6px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-main);
}

.password-box {
  margin-top: 4px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
  background: radial-gradient(circle at top left, rgba(15, 23, 42, 0.9), #020617);
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.password-text {
  flex: 1;
  font-family: "SF Mono", ui-monospace, Menlo, Monaco, Consolas,
    "Liberation Mono", monospace;
  font-size: 16px;
  word-wrap: break-word;
  word-break: break-all;
}

.copy-btn {
  flex-shrink: 0;
  margin-left: 4px;
  padding: 6px 10px;
  font-size: 11px;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  background: rgba(15, 23, 42, 0.95);
  color: var(--text-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: background 0.12s, border-color 0.12s, color 0.12s,
    opacity 0.12s;
}

.copy-btn span.icon {
  font-size: 12px;
}

.copy-btn:hover:not(:disabled) {
  background: rgba(15, 23, 42, 1);
  border-color: rgba(148, 163, 184, 0.8);
  color: #e5e7eb;
}

.copy-btn:disabled {
  opacity: 0.4;
  cursor: default;
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
  font-size: 11px;
  color: var(--text-muted);
}

.meta-row strong {
  color: var(--text-main);
  font-weight: 500;
}

/* Strength bar */

.strength-bar-wrapper {
  margin-top: 10px;
}

.strength-bar-label {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.strength-bar {
  position: relative;
  width: 100%;
  height: 7px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid var(--border-subtle);
  overflow: hidden;
}

.strength-bar-inner {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0%;
  border-radius: 999px;
  background: var(--danger);
  transition: width 0.18s ease-out, background 0.18s ease-out;
}

.label-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.5);
  background: rgba(15, 23, 42, 0.9);
  font-size: 11px;
  color: var(--text-main);
}

.label-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--danger);
}

/* Footer */

.footer {
  margin-top: 12px;
  text-align: center;
  font-size: 12px;
  color: #6b7280;
}

.footer span.dot {
  display: inline-block;
  width: 4px;
  height: 4px;
  border-radius: 999px;
  background: #4b5563;
  margin: 0 8px;
  vertical-align: middle;
}

/* Brand */

.brand-logo {
  height: 80px;
  width: 80px;
  padding: 4px;
  border-radius: 999px;
  background: #020617;
  box-shadow: 0 0 18px rgba(56, 189, 248, 0.35);
}

.page-header {
  max-width: 920px;
  margin: 0 auto 16px;
  padding: 10px 18px;
  border-radius: 18px;
  background: rgba(15, 23, 42, 0.92);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.65);
}

.brand-hero {
  display: flex;
  justify-content: center;
}

.brand-wrap {
  display: flex;
  align-items: center;
  gap: 18px;
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-name {
  font-size: 28px;
  letter-spacing: 0.18em;
  font-weight: 600;
}

.brand-sub {
  margin-top: 4px;
  font-size: 14px;
  color: var(--text-muted);
}

.page-header h2 {
  font-size: 14px;
  opacity: 0.75;
  margin-top: 4px;
}

.brand-tagline {
  margin-top: 4px;
  font-size: 13px;
  letter-spacing: 0.04em;
  color: #6ee7ff;
  opacity: 0.85;
}

/* Mobile tweaks */

@media (max-width: 640px) {
  body {
    padding: 12px 10px 16px;
    font-size: 14px;
  }

  .page-header {
    padding: 10px 14px;
    margin-bottom: 12px;
  }

  .brand-wrap {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .panel {
    padding: 16px 16px 12px;
  }
}

/* 動畫偏好 */

@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
    transition: none !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

/* Result panel 字體放大 */

.panel-result .panel-title {
  font-size: 18px;
}

.panel-result .password-text {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 0.6px;
}

.panel-result .meta-row {
  font-size: 12px;
}

.panel-result .strength-bar-label {
  font-size: 12px;
}

/* Notes block */

.notes-block {
  margin-top: 16px;
  border-top: 1px dashed var(--border-subtle);
  padding-top: 8px;
  font-size: 12px;
  color: var(--text-muted);
}

.notes-block > summary {
  cursor: pointer;
  list-style: none;
  font-size: 12px;
  color: #9ca3af;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.notes-block > summary::-webkit-details-marker {
  display: none;
}

.notes-block[open] > summary {
  color: #e5e7eb;
}

.note-content {
  margin-top: 8px;
}

.note-section + .note-section {
  margin-top: 8px;
}

.note-section h3 {
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 2px;
}

.note-text {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.5;
}