/* =============================================
   TOOLS.ZHCZLX.COM — Design System
   Notion Warm Style
   ============================================= */

@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+SC:wght@400;500;600;700&family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;600&display=swap');

/* ===== CSS CUSTOM PROPERTIES (Notion Warm Style) ===== */
:root {
  /* Backgrounds */
  --bg-primary: #FFFFF5;
  --bg-secondary: #FFFFFF;
  --bg-tertiary: #F7F6F3;
  --bg-card: #FFFFFF;
  --bg-input: #FFFFFF;
  --bg-hover: rgba(55, 53, 47, 0.04);
  --bg-toolbar: #FFFFFF;

  /* Text */
  --text-primary: #37352F;
  --text-secondary: #787774;
  --text-tertiary: #9B9A97;
  --text-placeholder: #B4B4B0;
  --text-inverse: #FFFFFF;

  /* Borders */
  --border-color: rgba(55, 53, 47, 0.08);
  --border-color-strong: rgba(55, 53, 47, 0.16);

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(55, 53, 47, 0.06);
  --shadow-md: 0 4px 12px rgba(55, 53, 47, 0.06);
  --shadow-lg: 0 8px 24px rgba(55, 53, 47, 0.08);
  --shadow-xl: 0 8px 24px rgba(55, 53, 47, 0.08);
  --shadow-inset: inset 0 1px 2px rgba(55, 53, 47, 0.06);

  /* Accent — Notion Blue */
  --accent: #2EAADC;
  --accent-hover: #2496C4;
  --accent-light: rgba(46, 170, 220, 0.08);
  --accent-ring: rgba(46, 170, 220, 0.35);

  /* Secondary — Notion warm brown for subtle highlights */
  --secondary: #9B9A97;
  --secondary-hover: #787774;
  
  /* Link color */
  --link: #2EAADC;

  /* Status colors */
  --success: #0F7B6C;
  --warning: #D9730D;
  --error: #E03E3E;
  --info: #2EAADC;

  /* Radius */
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;
  --radius-xl: 12px;
  --radius-full: 9999px;

  /* Typography */
  --font-sans: 'Noto Sans SC', 'Inter', -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Helvetica Neue', Arial, sans-serif;
  --font-display: 'Noto Sans SC', 'Inter', -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Helvetica Neue', Arial, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, 'SF Mono', Menlo, monospace;

  /* Transitions */
  --transition-fast: 120ms cubic-bezier(0.25, 0.1, 0.25, 1);
  --transition-normal: 200ms cubic-bezier(0.25, 0.1, 0.25, 1);
  --transition-slow: 300ms cubic-bezier(0.25, 0.1, 0.25, 1);

  /* Layout */
  --header-height: 52px;
  --max-width: 960px;

  /* Border width */
  --border-thick: 1px;
}

/* ===== DARK MODE ===== */
@media (prefers-color-scheme: dark) {
  :root {
    --bg-primary: #191919;
    --bg-secondary: #202020;
    --bg-tertiary: #252525;
    --bg-card: #252525;
    --bg-input: #252525;
    --bg-hover: rgba(255, 255, 255, 0.04);
    --bg-toolbar: #202020;

    --text-primary: rgba(255, 255, 255, 0.84);
    --text-secondary: rgba(255, 255, 255, 0.56);
    --text-tertiary: rgba(255, 255, 255, 0.36);
    --text-placeholder: rgba(255, 255, 255, 0.24);
    --text-inverse: #191919;

    --border-color: rgba(255, 255, 255, 0.06);
    --border-color-strong: rgba(255, 255, 255, 0.12);

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.24);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.28);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.32);
    --shadow-xl: 0 8px 24px rgba(0, 0, 0, 0.32);
    --shadow-inset: inset 0 1px 2px rgba(0, 0, 0, 0.24);

    --accent: #529CCA;
    --accent-hover: #6BAFDB;
    --accent-light: rgba(82, 156, 202, 0.12);
    --accent-ring: rgba(82, 156, 202, 0.3);
  }
}

/* ===== MANUAL THEME OVERRIDES (via data-theme attribute) ===== */

/* Dark — manual override for system light mode */
html[data-theme="dark"] {
  --bg-primary: #191919 !important;
  --bg-secondary: #202020 !important;
  --bg-tertiary: #252525 !important;
  --bg-card: #252525 !important;
  --bg-input: #252525 !important;
  --bg-hover: rgba(255, 255, 255, 0.04) !important;
  --bg-toolbar: #202020 !important;

  --text-primary: rgba(255, 255, 255, 0.84) !important;
  --text-secondary: rgba(255, 255, 255, 0.56) !important;
  --text-tertiary: rgba(255, 255, 255, 0.36) !important;
  --text-placeholder: rgba(255, 255, 255, 0.24) !important;
  --text-inverse: #191919 !important;

  --border-color: rgba(255, 255, 255, 0.06) !important;
  --border-color-strong: rgba(255, 255, 255, 0.12) !important;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.24) !important;
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.28) !important;
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.32) !important;
  --shadow-xl: 0 8px 24px rgba(0, 0, 0, 0.32) !important;
  --shadow-inset: inset 0 1px 2px rgba(0, 0, 0, 0.24) !important;

  --accent: #529CCA !important;
  --accent-hover: #6BAFDB !important;
  --accent-light: rgba(82, 156, 202, 0.12) !important;
  --accent-ring: rgba(82, 156, 202, 0.3) !important;
}

/* Light — manual override for system dark mode */
html[data-theme="light"] {
  --bg-primary: #FFFFF5 !important;
  --bg-secondary: #FFFFFF !important;
  --bg-tertiary: #F7F6F3 !important;
  --bg-card: #FFFFFF !important;
  --bg-input: #FFFFFF !important;
  --bg-hover: rgba(55, 53, 47, 0.04) !important;
  --bg-toolbar: #FFFFFF !important;

  --text-primary: #37352F !important;
  --text-secondary: #787774 !important;
  --text-tertiary: #9B9A97 !important;
  --text-placeholder: #B4B4B0 !important;
  --text-inverse: #FFFFFF !important;

  --border-color: rgba(55, 53, 47, 0.08) !important;
  --border-color-strong: rgba(55, 53, 47, 0.16) !important;

  --shadow-sm: 0 1px 3px rgba(55, 53, 47, 0.06) !important;
  --shadow-md: 0 4px 12px rgba(55, 53, 47, 0.06) !important;
  --shadow-lg: 0 8px 24px rgba(55, 53, 47, 0.08) !important;
  --shadow-xl: 0 8px 24px rgba(55, 53, 47, 0.08) !important;
  --shadow-inset: inset 0 1px 2px rgba(55, 53, 47, 0.06) !important;

  --accent: #2EAADC !important;
  --accent-hover: #2496C4 !important;
  --accent-light: rgba(46, 170, 220, 0.08) !important;
  --accent-ring: rgba(46, 170, 220, 0.35) !important;
}

/* ===== RESET ===== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html {
  scroll-behavior: auto;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  transition: background var(--transition-normal), color var(--transition-normal);
  font-size: 15px;
  font-weight: 400;
  image-rendering: auto;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  letter-spacing: -0.01em;
  line-height: 1.4;
  font-weight: 600;
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track {
  background: var(--bg-secondary);
  border: 2px solid var(--border-color);
}
::-webkit-scrollbar-thumb {
  background: var(--text-tertiary);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-sm);
}
::-webkit-scrollbar-thumb:hover { background: var(--text-secondary); }

/* ===== HEADER ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-primary);
  border-bottom: var(--border-thick) solid var(--border-color);
  height: var(--header-height);
  display: flex;
  align-items: center;
  transition: background var(--transition-normal);
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text-primary);
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 14px;
  letter-spacing: -0.01em;
}

.header-logo .logo-icon {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 120ms ease;
}

.header-logo:hover .logo-icon {
  opacity: 0.7;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.header-nav a {
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 16px;
  font-weight: 400;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  transition: all 120ms ease;
  line-height: 1;
}

.header-nav a:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

.header-nav a.active {
  color: var(--text-primary);
  background: var(--accent-light);
  border-radius: var(--radius-sm);
}

.theme-toggle {
  background: var(--bg-secondary);
  border: var(--border-thick) solid var(--border-color);
  cursor: pointer;
  padding: 8px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 18px;
  transition: all var(--transition-fast);
  margin-left: 8px;
  box-shadow: var(--shadow-sm);
}

.theme-toggle:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

/* ===== CONTAINER ===== */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  width: 100%;
}

/* ===== PAGE HERO ===== */
.page-hero {
  padding: 72px 0 48px;
  text-align: center;
}

.page-hero h1 {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.3;
  margin-bottom: 16px;
}

.page-hero h1 .gradient {
  background: none;
  -webkit-background-clip: unset;
  -webkit-text-fill-color: var(--text-primary);
  background-clip: unset;
  color: var(--text-primary);
  animation: none;
}

.page-hero p {
  color: var(--text-secondary);
  font-size: 16px;
  font-weight: 400;
  max-width: 640px;
  margin: 0 auto;
  line-height: 1.6;
}

/* ===== TOOL GRID (Homepage) ===== */
.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
  padding-bottom: 80px;
}

.tool-card {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: var(--text-primary);
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: var(--border-thick) solid var(--border-color);
  padding: 32px 28px;
  box-shadow: var(--shadow-xl);
  transition: transform 150ms ease-out, box-shadow 150ms ease-out, background 150ms ease-out, border-color 150ms ease-out;
  position: relative;
  overflow: hidden;
}

.tool-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--accent);
  opacity: 0;
  transition: opacity 200ms ease;
}

.tool-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--border-color-strong);
  transform: translateY(-1px);
}

.tool-card:hover::before {
  opacity: 1;
}

.tool-card:active {
  transform: translateY(0);
  box-shadow: var(--shadow-sm);
}

.tool-card-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-md);
  border: var(--border-thick) solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  margin-bottom: 18px;
  background: var(--accent-light);
  box-shadow: var(--shadow-md);
}

.tool-card h3 {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-bottom: 8px;
  line-height: 1.4;
}

.tool-card p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
  flex: 1;
  font-weight: 400;
}

.tool-card .tag {
  margin-top: 12px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 500;
  color: var(--accent);
  background: var(--accent-light);
  padding: 4px 10px;
  border-radius: var(--radius-full);
  align-self: flex-start;
}

/* ===== TOOL PAGE LAYOUT ===== */
.tool-section {
  max-width: 800px;
  margin: 0 auto;
  padding: 40px 0 80px;
}

.tool-header {
  margin-bottom: 32px;
}

.tool-header .breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-tertiary);
  margin-bottom: 12px;
  font-weight: 400;
}

.tool-header .breadcrumb a {
  color: var(--text-tertiary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.tool-header .breadcrumb a:hover {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.tool-header h1 {
  font-family: var(--font-display);
  font-size: clamp(1.2rem, 3vw, 1.8rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
  line-height: 1.3;
}

.tool-header p {
  color: var(--text-secondary);
  font-size: 15px;
  font-weight: 400;
}

/* ===== TOOL CARD (individual tool container) ===== */
.tool-card-container {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  border: var(--border-thick) solid var(--border-color);
  box-shadow: var(--shadow-xl);
  overflow: hidden;
  transition: box-shadow var(--transition-normal), transform var(--transition-normal);
}

.tool-card-container:focus-within {
  box-shadow: var(--shadow-md);
  outline: var(--border-thick) solid var(--accent);
  outline-offset: 2px;
}

.tool-body {
  padding: 32px;
}

.tool-footer {
  padding: 16px 32px;
  background: var(--bg-secondary);
  border-top: var(--border-thick) solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.tool-footer .hint {
  font-size: 14px;
  color: var(--text-tertiary);
  font-weight: 500;
}

/* ===== FORM ELEMENTS ===== */
.input-group {
  margin-bottom: 20px;
}

.input-group label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.input-group .label-hint {
  font-weight: 600;
  color: var(--text-tertiary);
  font-size: 14px;
  text-transform: none;
}

input[type="text"],
input[type="number"],
input[type="password"],
textarea,
select {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border-color-strong);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 400;
  outline: none;
  transition: all var(--transition-fast);
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-ring);
  outline: none;
}

textarea {
  resize: vertical;
  min-height: 120px;
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.7;
}

select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23111111' stroke-width='3' stroke-linecap='square' stroke-linejoin='miter'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 120ms ease;
  text-decoration: none;
  line-height: 1.4;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
}

.btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

.btn-primary:active {
  opacity: 0.9;
}

.btn-secondary {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border: 1px solid var(--border-color-strong);
}

.btn-secondary:hover {
  background: var(--bg-hover);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  padding: 8px 12px;
  border: 2px solid transparent;
  box-shadow: none;
}

.btn-ghost:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 13px;
}

.btn-icon {
  width: 32px;
  height: 32px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: var(--bg-input);
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 15px;
  transition: all var(--transition-fast);
}

.btn-icon:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
  border-color: var(--border-color);
}

.btn-icon:active {
  background: var(--bg-tertiary);
}

.btn-icon.copied {
  background: var(--success);
  color: var(--text-inverse);
  border-color: var(--border-color);
}

/* ===== OUTPUT FIELD ===== */
.output-field {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color-strong);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.5;
  word-break: break-all;
  min-height: 48px;
  color: var(--text-primary);
  position: relative;
  font-weight: 400;
}

.output-field .output-text {
  flex: 1;
}

/* ===== STRENGTH METER ===== */
.strength-meter {
  display: flex;
  gap: 4px;
  margin: 8px 0 16px;
}

.strength-bar {
  height: 10px;
  flex: 1;
  border-radius: var(--radius-sm);
  background: var(--bg-tertiary);
  border: 2px solid var(--border-color);
  transition: all var(--transition-normal);
}

.strength-bar.active.weak { background: var(--error); }
.strength-bar.active.medium { background: var(--warning); }
.strength-bar.active.strong { background: var(--secondary); }
.strength-bar.active.very-strong { background: var(--success); }

.strength-label {
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 6px;
}

.strength-label.weak { color: var(--error); }
.strength-label.medium { color: var(--warning); }
.strength-label.strong { color: var(--info); }
.strength-label.very-strong { color: var(--success); }

/* ===== CHECKBOX / TOGGLE ===== */
.toggle-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0;
}

.toggle-label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border: 1px solid var(--border-color-strong);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 14px;
  font-weight: 400;
  transition: all 120ms ease;
  user-select: none;
}

.toggle-label:hover {
  border-color: var(--border-color-strong);
  background: var(--bg-hover);
}

.toggle-label.active {
  background: var(--accent-light);
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: var(--shadow-sm);
}

.toggle-label input[type="checkbox"] {
  display: none;
}

/* ===== SLIDER ===== */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 8px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-sm);
  outline: none;
  cursor: pointer;
  border: 2px solid var(--border-color);
  box-shadow: var(--shadow-inset);
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border-radius: var(--radius-sm);
  background: var(--accent);
  cursor: pointer;
  border: var(--border-thick) solid var(--border-color);
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.1);
}

input[type="range"]::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: var(--radius-sm);
  background: var(--accent);
  cursor: pointer;
  border: var(--border-thick) solid var(--border-color);
  box-shadow: var(--shadow-sm);
}

/* ===== CHECKBOX (native style) ===== */
.checkbox-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.checkbox-item {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 15px;
  user-select: none;
  font-weight: 500;
}

.checkbox-item input[type="checkbox"] {
  width: 20px;
  height: 20px;
  accent-color: var(--accent);
  cursor: pointer;
  border: 2px solid var(--border-color);
}

/* ===== RESULT STATS ===== */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px;
  margin: 20px 0;
}

.stat-item {
  text-align: center;
  padding: 16px 12px;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  border: var(--border-thick) solid var(--border-color);
  box-shadow: var(--shadow-sm);
}

.stat-item .stat-value {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  line-height: 1.4;
}

.stat-item .stat-label {
  font-size: 12px;
  color: var(--text-tertiary);
  font-weight: 400;
  margin-top: 6px;
}

/* ===== CONVERTER ROW ===== */
.converter-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.converter-row .input-wrap {
  flex: 1;
}

.converter-row .swap-btn {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  border: var(--border-thick) solid var(--border-color-strong);
  background: var(--bg-input);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
  margin-top: 20px;
  box-shadow: var(--shadow-sm);
}

.converter-row .swap-btn:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
  border-color: var(--border-color-strong);
}

/* ===== UNIT CATEGORY TABS ===== */
.unit-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 24px;
  padding: 4px;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  border: var(--border-thick) solid var(--border-color);
  box-shadow: var(--shadow-sm);
}

.unit-tab {
  padding: 6px 12px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 400;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.unit-tab:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
  border-color: var(--border-color);
}

.unit-tab.active {
  background: var(--bg-primary);
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
  border: 2px solid var(--border-color);
}

/* ===== TEXT TOOLS ===== */
.text-area-wrap {
  position: relative;
}

.text-area-wrap .char-count {
  position: absolute;
  bottom: 12px;
  right: 14px;
  font-size: 12px;
  color: var(--text-tertiary);
  font-family: var(--font-mono);
  font-weight: 600;
}

.action-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0;
}

/* ===== UUID LIST ===== */
.uuid-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 16px 0;
}

.uuid-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--bg-secondary);
  border: var(--border-thick) solid var(--border-color);
  border-radius: var(--radius-md);
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-primary);
  gap: 12px;
  box-shadow: var(--shadow-sm);
}

.uuid-item .uuid-text {
  flex: 1;
  word-break: break-all;
}

/* ===== COLOR PICKER ===== */
.color-preview-area {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 20px;
}

.color-swatch {
  width: 120px;
  height: 120px;
  border-radius: var(--radius-lg);
  border: var(--border-thick) solid var(--border-color);
  flex-shrink: 0;
  transition: background var(--transition-fast);
  box-shadow: var(--shadow-md);
}

.color-input-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.color-input-wrap input[type="color"] {
  width: 60px;
  height: 60px;
  padding: 0;
  border: var(--border-thick) solid var(--border-color-strong);
  border-radius: var(--radius-md);
  cursor: pointer;
  background: none;
  box-shadow: var(--shadow-sm);
}

.color-values {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.color-value-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  background: var(--bg-secondary);
  border: var(--border-thick) solid var(--border-color);
  border-radius: var(--radius-md);
  font-family: var(--font-mono);
  font-size: 13px;
  box-shadow: var(--shadow-sm);
}

.color-value-item .label {
  color: var(--text-tertiary);
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 500;
  min-width: 32px;
  text-transform: uppercase;
}

.color-value-item .value {
  flex: 1;
  word-break: break-all;
}

.color-history {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.color-history-swatch {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  border: 2px solid var(--border-color);
  cursor: pointer;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
  box-shadow: var(--shadow-sm);
}

.color-history-swatch:hover {
  transform: scale(1.15);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .tool-grid {
    grid-template-columns: 1fr;
  }
  
  .tool-body {
    padding: 20px;
  }
  
  .tool-footer {
    padding: 12px 20px;
    flex-direction: column;
    text-align: center;
  }
  
  .stats-row {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .converter-row {
    flex-direction: column;
  }
  
  .converter-row .swap-btn {
    margin-top: 0;
    transform: rotate(90deg);
  }
  
  .converter-row .swap-btn:hover {
    transform: rotate(180deg);
  }
  
  .color-preview-area {
    flex-direction: column;
  }
  
  .color-swatch {
    width: 100%;
    height: 80px;
  }
  
  .color-values {
    grid-template-columns: 1fr;
  }
  
  .unit-tabs {
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
  }
  
  .header-nav a span {
    display: none;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 16px;
  }
  
  .page-hero {
    padding: 40px 0 24px;
  }
  
  .tool-section {
    padding: 24px 0 60px;
  }
  
  .action-bar {
    flex-direction: column;
  }
  
  .action-bar .btn {
    width: 100%;
  }
}

/* ===== ANIMATIONS ===== */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.animate-in {
  animation: fadeIn 0.3s cubic-bezier(0.25, 0.1, 0.25, 1) both;
}

.animate-slide-up {
  animation: slideUp 0.4s cubic-bezier(0.25, 0.1, 0.25, 1) both;
}

/* ===== TOAST ===== */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: var(--text-primary);
  color: var(--bg-primary);
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transition: all var(--transition-slow);
  z-index: 999;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ===== LOADING SPINNER ===== */
.spinner {
  width: 20px;
  height: 20px;
  border: 3px solid var(--border-color);
  border-top-color: var(--accent);
  border-radius: var(--radius-sm);
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ===== EMPTY STATE ===== */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-tertiary);
  border: 2px dashed var(--border-color);
}

.empty-state .icon {
  font-size: 40px;
  margin-bottom: 12px;
  opacity: 0.5;
}

.empty-state p {
  font-size: 15px;
  font-weight: 500;
}

/* ===== FOOTER ===== */
.site-footer {
  border-top: var(--border-thick) solid var(--border-color);
  padding: 24px 0;
  margin-top: 40px;
  background: var(--bg-secondary);
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 13px;
  color: var(--text-tertiary);
  font-weight: 400;
}

.footer-inner a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color var(--transition-fast);
  font-weight: 400;
}

.footer-inner a:hover {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.footer-inner nav {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

/* ===== HEADER CONTROLS (lang + theme group) ===== */
.header-controls {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}

/* ===== LANGUAGE SWITCHER ===== */
.lang-switcher {
  position: relative;
  display: inline-block;
}

.lang-switcher select {
  appearance: none;
  -webkit-appearance: none;
  padding: 4px 24px 4px 10px;
  font-size: 13px;
  border: var(--border-thick) solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  cursor: pointer;
  outline: none;
  font-family: var(--font-sans);
  font-weight: 600;
  transition: border-color var(--transition-fast), color var(--transition-fast), box-shadow var(--transition-fast);
  box-shadow: var(--shadow-sm);
}

.lang-switcher select:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

.lang-switcher select:focus {
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
  outline: none;
}

.lang-switcher::after {
  content: '\u25BE';
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 10px;
  color: var(--text-tertiary);
  pointer-events: none;
}

/* ===== GENERATE BUTTON (shared by password & uuid) ===== */
.btn-generate {
  width: 100%;
  padding: 12px 24px;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: #ffffff;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 200ms ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  position: relative;
  overflow: visible;
}

.btn-generate:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.btn-generate:active {
  transform: translateY(0);
}

.btn-generate.generating {
  pointer-events: none;
  opacity: 0.85;
}

.btn-generate .generate-icon {
  display: inline-block;
  transition: transform 0.3s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.btn-generate.generating .generate-icon {
  animation: spin-gen 0.6s linear;
}

@keyframes spin-gen {
  0% { transform: rotate(0deg); }
  25% { transform: rotate(90deg); }
  50% { transform: rotate(180deg); }
  75% { transform: rotate(270deg); }
  100% { transform: rotate(360deg); }
}

/* Selection */
::selection {
  background: var(--accent-light);
  color: var(--text-primary);
}

/* ===== FEATURED JSON CARD ===== */
.featured-json { margin-bottom: 32px; }
.featured-json-card {
  display: block;
  background: var(--accent-light);
  border: var(--border-thick) solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 28px;
  text-decoration: none;
  color: var(--text-primary);
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.featured-json-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--accent);
  transform: translateY(-1px);
}
.featured-json-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 500;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  background: var(--accent-light);
  color: var(--accent);
  margin-bottom: 12px;
}
.featured-json-content {
  display: flex;
  align-items: flex-start;
  gap: 24px;
}
.featured-json-icon {
  font-size: 40px;
  font-weight: 600;
  font-family: var(--font-mono);
  color: var(--accent);
  flex-shrink: 0;
  line-height: 1;
  margin-top: 2px;
}
.featured-json-content h2 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
  letter-spacing: -0.01em;
}
.featured-json-content p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 12px;
  font-weight: 400;
}
.featured-json-content p strong {
  color: var(--text-primary);
  font-weight: 600;
}
.featured-json-features {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.featured-json-features span {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  white-space: nowrap;
}
.featured-json-cta {
  margin-top: 14px;
  font-size: 14px;
  font-weight: 500;
  color: var(--secondary);
  transition: gap var(--transition-fast);
  display: flex;
  align-items: center;
  gap: 4px;
}
.featured-json-card:hover .featured-json-cta { gap: 8px; }

@media (max-width: 600px) {
  .featured-json-content { flex-direction: column; gap: 12px; }
  .featured-json-icon { font-size: 32px; }
  .featured-json-card { padding: 20px; }
  .featured-json-features span { white-space: normal; }
}
