:root {
  --bg: #07111f;
  --panel: rgba(12, 27, 46, 0.82);
  --panel-strong: rgba(8, 20, 36, 0.95);
  --line: rgba(144, 182, 222, 0.18);
  --text: #edf6ff;
  --muted: #90a8c6;
  --accent: #3dd9b4;
  --accent-2: #ffb347;
  --accent-3: #8ec5ff;
  --danger: #ff7c7c;
  --shadow: 0 22px 70px rgba(0, 0, 0, 0.28);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: "Segoe UI", "PingFang SC", "Hiragino Sans GB", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(61, 217, 180, 0.15), transparent 28%),
    radial-gradient(circle at top right, rgba(142, 197, 255, 0.14), transparent 34%),
    linear-gradient(135deg, #08111f 0%, #0b1a2d 44%, #081a25 100%);
  color: var(--text);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 36px 36px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.72), transparent);
}

button,
input,
textarea,
select {
  font: inherit;
}

a {
  color: inherit;
}

.page-shell {
  width: min(1360px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 28px 0 48px;
}

.hero {
  display: grid;
  grid-template-columns: 1.55fr 0.95fr;
  gap: 24px;
  align-items: stretch;
  margin-bottom: 22px;
}

.hero-copy,
.hero-panel,
.tab-bar,
.tool-card,
.panel-section,
.api-card,
.playground-card,
.board-column,
.note-card,
.todo-card,
.preview-card,
.storage-card,
.media-stage,
.status-box,
.markdown-preview {
  backdrop-filter: blur(16px);
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.hero-copy,
.hero-panel {
  border-radius: var(--radius-xl);
  padding: 28px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.28em;
  font-size: 12px;
}

.hero h1 {
  margin: 0;
  font-size: clamp(46px, 8vw, 82px);
  line-height: 0.95;
  letter-spacing: -0.04em;
}

.hero-text {
  max-width: 760px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.75;
}

.hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

.hero-badges span,
.chip,
.metric-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
  font-size: 13px;
  color: #d2e5fb;
}

.hero-panel {
  display: grid;
  gap: 16px;
}

.stat-card {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.06), rgba(61, 217, 180, 0.05));
  border-radius: 22px;
  padding: 18px 20px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.stat-card strong {
  display: block;
  font-size: 40px;
  margin-bottom: 6px;
}

.stat-card span {
  color: var(--muted);
}

.tab-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 12px;
  border-radius: 20px;
  margin-bottom: 20px;
}

.tab-button,
.subtab-button,
.action-button {
  border: 0;
  cursor: pointer;
  border-radius: 999px;
  color: var(--text);
  transition: 0.2s ease;
}

.tab-button,
.subtab-button {
  background: rgba(255, 255, 255, 0.06);
  padding: 12px 18px;
}

.tab-button.active,
.subtab-button.active,
.action-button.primary {
  background: linear-gradient(135deg, var(--accent), #1096bb);
  color: #04131a;
  font-weight: 700;
}

.subtab-button {
  font-size: 14px;
}

.tab-button:hover,
.subtab-button:hover,
.action-button:hover {
  transform: translateY(-1px);
}

.tab-panel {
  display: grid;
  gap: 18px;
}

.section-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.section-header h2,
.section-header h3,
.tool-card h3,
.tool-card h4,
.api-card h4 {
  margin: 0;
}

.section-header p,
.tool-card p,
.muted,
.meta,
.empty-state,
.storage-item,
.preview-caption,
.api-card li {
  color: var(--muted);
}

.tool-grid,
.api-grid,
.local-grid,
.metrics-grid {
  display: grid;
  gap: 18px;
}

.tool-grid {
  grid-template-columns: repeat(12, minmax(0, 1fr));
}

.tool-card {
  grid-column: span 6;
  border-radius: var(--radius-lg);
  padding: 20px;
}

.tool-card.wide,
.tool-card.full {
  grid-column: span 12;
}

.panel-section,
.playground-card,
.board-column,
.todo-card,
.note-card,
.preview-card,
.storage-card,
.media-stage,
.status-box,
.markdown-preview {
  border-radius: var(--radius-lg);
  padding: 18px;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.field-grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.field,
.field-stack {
  display: grid;
  gap: 8px;
}

label,
.field-label {
  font-size: 13px;
  color: #d6e4f6;
}

input,
textarea,
select {
  width: 100%;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(4, 12, 24, 0.72);
  color: var(--text);
  padding: 12px 14px;
  outline: none;
}

textarea {
  min-height: 150px;
  resize: vertical;
}

input[type="color"] {
  min-height: 48px;
  padding: 6px;
}

input:focus,
textarea:focus,
select:focus {
  border-color: rgba(61, 217, 180, 0.6);
  box-shadow: 0 0 0 4px rgba(61, 217, 180, 0.12);
}

.actions,
.subtab-row,
.card-footer,
.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.action-button {
  padding: 11px 16px;
  background: rgba(255, 255, 255, 0.08);
}

.action-button.secondary {
  background: rgba(255, 255, 255, 0.1);
}

.action-button.warn {
  background: rgba(255, 124, 124, 0.16);
  color: #ffd0d0;
}

.output,
.preview-box,
.status-box,
.markdown-preview,
.result-box,
pre {
  border-radius: 16px;
  background: rgba(3, 10, 20, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.06);
  padding: 14px;
  overflow: auto;
}

pre {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
}

.regex-preview mark {
  background: rgba(255, 179, 71, 0.34);
  color: #fff;
  padding: 0 2px;
  border-radius: 4px;
}

.color-swatch,
.gradient-preview,
.stamp-preview,
.meme-preview,
.image-preview {
  border-radius: 18px;
  min-height: 180px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(4, 12, 24, 0.72);
}

.color-swatch {
  min-height: 120px;
}

.gradient-preview {
  min-height: 160px;
}

.api-layout,
.storage-layout,
.media-layout {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 18px;
}

.api-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.api-card {
  border-radius: 20px;
  padding: 18px;
}

.api-card header,
.api-meta,
.todo-item,
.note-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.api-card .category {
  color: var(--accent);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
}

.api-card .status-line {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 12px 0;
}

.status-tag {
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  background: rgba(255, 255, 255, 0.07);
}

.status-tag.good {
  color: #9af2cf;
}

.status-tag.warn {
  color: #ffd9a0;
}

.status-tag.bad {
  color: #ffc0c0;
}

.metrics-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.metric-pill {
  justify-content: center;
}

.todo-list,
.notes-list {
  display: grid;
  gap: 10px;
}

.todo-item,
.note-card {
  padding: 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
}

.todo-item.done {
  opacity: 0.68;
}

.todo-item.done strong,
.todo-item.done p {
  text-decoration: line-through;
}

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

.board-column {
  min-height: 280px;
}

.board-column h4 {
  margin: 0 0 12px;
}

.board-list {
  display: grid;
  gap: 10px;
}

.board-card {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 16px;
  padding: 12px;
}

.timer-ring {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  margin: 6px auto 18px;
  background:
    radial-gradient(circle at center, rgba(7, 17, 31, 0.9) 60%, transparent 61%),
    conic-gradient(var(--accent) var(--timer-progress, 0%), rgba(255, 255, 255, 0.08) 0);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.timer-ring strong {
  font-size: 34px;
}

.markdown-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.markdown-preview {
  min-height: 420px;
  line-height: 1.7;
}

.markdown-preview h1,
.markdown-preview h2,
.markdown-preview h3 {
  margin-top: 0;
}

.media-stage canvas,
.media-stage img {
  width: 100%;
  border-radius: 16px;
  display: block;
}

.preview-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.image-preview {
  display: grid;
  place-items: center;
  overflow: hidden;
}

.image-preview img {
  max-width: 100%;
  max-height: 380px;
  display: block;
}

.empty-state {
  padding: 18px;
  border: 1px dashed rgba(255, 255, 255, 0.16);
  border-radius: 16px;
  text-align: center;
}

.footer-note {
  margin-top: 24px;
  color: var(--muted);
  text-align: center;
  font-size: 13px;
}

@media (max-width: 1100px) {
  .hero,
  .api-layout,
  .storage-layout,
  .media-layout,
  .markdown-layout {
    grid-template-columns: 1fr;
  }

  .tool-card,
  .tool-card.wide,
  .tool-card.full {
    grid-column: span 12;
  }

  .api-grid,
  .kanban,
  .metrics-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .page-shell {
    width: min(100vw - 20px, 100%);
    padding-top: 18px;
  }

  .hero-copy,
  .hero-panel {
    padding: 20px;
  }

  .tool-grid,
  .field-grid,
  .field-grid.three {
    grid-template-columns: 1fr;
  }

  .tool-card {
    padding: 18px;
  }

  .timer-ring {
    width: 164px;
    height: 164px;
  }
}
