:root {
  --bg-primary: #F8FAFC;
  --bg-surface: #FFFFFF;
  --bg-surface-elevated: #FFFFFF;
  --border-subtle: #E2E8F0;
  --border-strong: #CBD5E1;
  --text-main: #0F172A;
  --text-muted: #64748B;
  --text-light: #94A3B8;
  --accent: #2563EB;
  --accent-hover: #1D4ED8;
  --accent-light: #EFF6FF;
  --accent-glow: rgba(37, 99, 235, 0.12);
  --emerald: #059669;
  --emerald-light: #ECFDF5;
  --amber: #D97706;
  --amber-light: #FFFBEB;
  --purple: #7C3AED;
  --purple-light: #F5F3FF;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.05);
  --shadow-card: 0 4px 20px -2px rgba(15, 23, 42, 0.06), 0 2px 6px -1px rgba(15, 23, 42, 0.03);
  --shadow-hover: 0 16px 32px -4px rgba(15, 23, 42, 0.1), 0 4px 12px -2px rgba(15, 23, 42, 0.04);
  --shadow-glow: 0 0 40px -10px rgba(37, 99, 235, 0.25);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-main);
  line-height: 1.55;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Ambient gradient mesh */
.bg-mesh {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 780px;
  background: radial-gradient(circle at 50% -10%, #E0E7FF 0%, #F1F5F9 45%, rgba(248, 250, 252, 0) 80%);
  z-index: -1;
  pointer-events: none;
}

.container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Top Announcement */
.top-bar {
  background: #0F172A;
  color: #E2E8F0;
  font-size: 13px;
  padding: 9px 0;
  text-align: center;
  font-weight: 500;
}
.top-bar a {
  color: #93C5FD;
  text-decoration: none;
  margin-left: 8px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.top-bar a:hover {
  text-decoration: underline;
}

/* Header */
header {
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(226, 232, 240, 0.85);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text-main);
}
.logo-icon {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, #2563EB 0%, #1D4ED8 100%);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 800;
  font-size: 19px;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}
.logo-text {
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.5px;
}
.logo-text span {
  color: var(--accent);
}
.logo-badge {
  font-size: 11px;
  background: #EFF6FF;
  color: #2563EB;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 6px;
  border: 1px solid #DBEAFE;
  margin-left: 4px;
}

nav {
  display: flex;
  align-items: center;
  gap: 28px;
}
nav a {
  text-decoration: none;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 600;
  transition: color 0.15s ease;
}
nav a:hover, nav a.active {
  color: var(--accent);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}
.btn-secondary {
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: white;
  color: var(--text-main);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}
.btn-secondary:hover {
  background: #F8FAFC;
  border-color: var(--border-strong);
}
.btn-primary {
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: white;
  font-size: 13px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
  transition: all 0.2s ease;
}
.btn-primary:hover {
  background: var(--accent-hover);
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
  transform: translateY(-1px);
}

/* Tool Page Layout */
.tool-page-header {
  padding: 40px 0 24px;
}
.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 16px;
}
.breadcrumbs a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}
.breadcrumbs a:hover {
  text-decoration: underline;
}

.tool-header-title {
  font-size: 34px;
  font-weight: 800;
  letter-spacing: -0.8px;
  color: #0F172A;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.tool-header-desc {
  font-size: 16px;
  color: var(--text-muted);
  max-width: 800px;
}

/* Tool Main Workspace */
.tool-workspace {
  background: white;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-card);
  padding: 32px;
  margin-bottom: 48px;
}

.workspace-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
}

/* Form Styles */
.form-group {
  margin-bottom: 18px;
}
.form-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13.5px;
  font-weight: 600;
  color: #334155;
  margin-bottom: 6px;
}
.form-hint {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 400;
}
.form-control {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid #CBD5E1;
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: #0F172A;
  background: #FFFFFF;
  outline: none;
  font-family: inherit;
  transition: all 0.2s ease;
}
.form-control:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}
textarea.form-control {
  min-height: 100px;
  resize: vertical;
}

select.form-control {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2364748B'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
  appearance: none;
  padding-right: 36px;
}

/* Code Output Blocks */
.code-box-wrapper {
  background: #0F172A;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}
.code-box-header {
  background: #1E293B;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #94A3B8;
  font-size: 12px;
  font-weight: 600;
}
.code-box-header .code-lang {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #E2E8F0;
}
.btn-copy {
  background: rgba(255, 255, 255, 0.1);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}
.btn-copy:hover {
  background: rgba(255, 255, 255, 0.2);
}
pre.code-content {
  padding: 18px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  line-height: 1.6;
  color: #E2E8F0;
  overflow-x: auto;
  max-height: 520px;
  white-space: pre-wrap;
  word-break: break-all;
}

/* Badges & Pills */
.pill-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}
.pill-badge.green {
  background: #ECFDF5;
  color: #047857;
  border: 1px solid #A7F3D0;
}
.pill-badge.blue {
  background: #EFF6FF;
  color: #1D4ED8;
  border: 1px solid #BFDBFE;
}
.pill-badge.amber {
  background: #FFFBEB;
  color: #B45309;
  border: 1px solid #FDE68A;
}

/* Toast alert */
.toast-notice {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #0F172A;
  color: white;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 600;
  box-shadow: 0 10px 25px rgba(0,0,0,0.25);
  display: flex;
  align-items: center;
  gap: 10px;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.25s ease;
  pointer-events: none;
  z-index: 1000;
}
.toast-notice.show {
  opacity: 1;
  transform: translateY(0);
}

/* Footer standard */
footer {
  background: #FFFFFF;
  border-top: 1px solid var(--border-subtle);
  padding: 60px 0 32px;
  font-size: 14px;
  color: var(--text-muted);
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 48px;
}
.footer-brand p {
  margin-top: 12px;
  font-size: 13.5px;
  line-height: 1.6;
  max-width: 320px;
}
.footer-col h4 {
  font-size: 14px;
  font-weight: 700;
  color: #0F172A;
  margin-bottom: 16px;
}
.footer-col ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.footer-col a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.15s ease;
  font-size: 13px;
}
.footer-col a:hover {
  color: var(--accent);
}
.footer-bottom {
  border-top: 1px solid var(--border-subtle);
  padding-top: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
}

@media (max-width: 900px) {
  .workspace-grid-2 { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  nav { display: none; }
}
