/* ============================================
   AI Compliance Checker - Stylesheet
   Fresh minimal design: mint green + sky blue
   ============================================ */

/* --- Design Tokens --- */
:root {
  --color-primary: #10B981;
  --color-primary-dark: #059669;
  --color-primary-light: #D1FAE5;
  --color-secondary: #0EA5E9;
  --color-secondary-light: #E0F2FE;
  --color-bg: #FAFBFC;
  --color-surface: #FFFFFF;
  --color-text: #1E293B;
  --color-text-secondary: #64748B;
  --color-text-muted: #94A3B8;
  --color-border: #E2E8F0;
  --color-border-light: #F1F5F9;

  --risk-high: #EF4444;
  --risk-high-bg: #FEE2E2;
  --risk-medium: #F59E0B;
  --risk-medium-bg: #FEF3C7;
  --risk-low: #EAB308;
  --risk-low-bg: #FEF9C3;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 20px rgba(0,0,0,0.06);
  --shadow-lg: 0 10px 40px rgba(0,0,0,0.08);

  --font-display: 'Plus Jakarta Sans', 'Noto Sans SC', system-ui, -apple-system, sans-serif;
  --font-body: 'Inter', 'Noto Sans SC', system-ui, -apple-system, sans-serif;

  --container-max: 1200px;
  --header-h: 64px;
}

/* --- Reset --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 20px); }
body {
  font-family: var(--font-body);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}
img { max-width: 100%; height: auto; display: block; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
a { color: inherit; text-decoration: none; }
textarea, input { font-family: inherit; }

/* RTL support */
[dir="rtl"] { text-align: right; }

/* --- Layout --- */
.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 24px;
}

/* --- Header --- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-border-light);
}
.header-inner {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  color: var(--color-text);
}
.logo-icon {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
}
.nav-link {
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text-secondary);
  transition: all 0.2s ease;
}
.nav-link:hover {
  color: var(--color-primary);
  background: var(--color-primary-light);
}
.lang-selector {
  position: relative;
}
.lang-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text);
  background: var(--color-border-light);
  transition: all 0.2s ease;
}
.lang-btn:hover { background: var(--color-primary-light); color: var(--color-primary); }
.lang-btn svg { width: 16px; height: 16px; }
.lang-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 180px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 6px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: all 0.2s ease;
  max-height: 400px;
  overflow-y: auto;
  z-index: 200;
}
.lang-dropdown.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
[dir="rtl"] .lang-dropdown { right: auto; left: 0; }
.lang-option {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--color-text);
  text-align: start;
  transition: background 0.15s ease;
}
.lang-option:hover { background: var(--color-border-light); }
.lang-option.active { background: var(--color-primary-light); color: var(--color-primary); font-weight: 600; }
.lang-flag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 20px;
  border-radius: 4px;
  background: var(--color-primary);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  flex-shrink: 0;
}

/* --- Hero --- */
.hero {
  position: relative;
  padding: 80px 0 60px;
  overflow: hidden;
  background:
    radial-gradient(ellipse at top left, rgba(16, 185, 129, 0.12), transparent 50%),
    radial-gradient(ellipse at top right, rgba(14, 165, 233, 0.12), transparent 50%),
    linear-gradient(180deg, #F0FDF4 0%, var(--color-bg) 100%);
}
.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -10%;
  width: 60%;
  height: 200%;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.08) 0%, transparent 60%);
  pointer-events: none;
}
.hero::after {
  content: '';
  position: absolute;
  bottom: -30%;
  right: -10%;
  width: 50%;
  height: 150%;
  background: radial-gradient(circle, rgba(14, 165, 233, 0.08) 0%, transparent 60%);
  pointer-events: none;
}
.hero-inner {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 760px;
  margin: 0 auto;
}
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  border-radius: 999px;
  background: var(--color-surface);
  border: 1px solid var(--color-primary-light);
  color: var(--color-primary-dark);
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
}
.hero-badge svg { width: 14px; height: 14px; }
.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(32px, 5vw, 52px);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--color-text);
  margin-bottom: 20px;
}
.hero h1 .accent {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero p {
  font-size: clamp(15px, 2vw, 18px);
  color: var(--color-text-secondary);
  margin-bottom: 32px;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}
.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 32px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.3);
  transition: all 0.25s ease;
}
.hero-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(16, 185, 129, 0.4);
}
.hero-cta svg { width: 18px; height: 18px; }

/* --- Section common --- */
.section {
  padding: 64px 0;
}
.section-header {
  text-align: center;
  margin-bottom: 48px;
}
.section-header h2 {
  font-family: var(--font-display);
  font-size: clamp(26px, 4vw, 36px);
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 12px;
}
.section-header p {
  font-size: 16px;
  color: var(--color-text-secondary);
  max-width: 560px;
  margin: 0 auto;
}

/* --- Tool Section --- */
.tool-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: start;
}
.tool-panel {
  background: var(--color-surface);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-md);
}
.panel-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.panel-label label {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text);
}
.panel-actions {
  display: flex;
  gap: 8px;
}
.btn-text {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-secondary);
  background: var(--color-border-light);
  transition: all 0.2s ease;
}
.btn-text:hover { background: var(--color-primary-light); color: var(--color-primary); }
.btn-text svg { width: 14px; height: 14px; }

.text-input {
  width: 100%;
  min-height: 240px;
  padding: 16px;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: 14px;
  line-height: 1.7;
  color: var(--color-text);
  background: var(--color-bg);
  resize: vertical;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  font-family: var(--font-body);
}
.text-input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}
.char-count {
  text-align: end;
  font-size: 12px;
  color: var(--color-text-muted);
  margin-top: 8px;
}

.categories {
  margin-top: 20px;
}
.categories-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 10px;
}
.category-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  border: 1.5px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}
.chip:hover { border-color: var(--color-primary); color: var(--color-primary); }
.chip.active {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
}
.chip svg { width: 14px; height: 14px; }

.btn-check {
  width: 100%;
  margin-top: 20px;
  padding: 14px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.25);
  transition: all 0.25s ease;
}
.btn-check:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.35);
}
.btn-check:disabled { opacity: 0.6; cursor: not-allowed; }
.btn-check svg { width: 18px; height: 18px; }

/* --- Results Panel --- */
.results-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 240px;
  text-align: center;
  color: var(--color-text-muted);
}
.results-empty svg { width: 56px; height: 56px; margin-bottom: 16px; opacity: 0.4; }
.results-empty p { font-size: 14px; }

.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}
.stat-card {
  background: var(--color-bg);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-md);
  padding: 14px;
  text-align: center;
}
.stat-value {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  line-height: 1;
  margin-bottom: 4px;
}
.stat-label {
  font-size: 11px;
  color: var(--color-text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.stat-card.score .stat-value { color: var(--color-primary); }
.stat-card.high .stat-value { color: var(--risk-high); }
.stat-card.medium .stat-value { color: var(--risk-medium); }
.stat-card.low .stat-value { color: var(--risk-low); }

.score-bar {
  height: 6px;
  background: var(--color-border-light);
  border-radius: 3px;
  margin-top: 8px;
  overflow: hidden;
}
.score-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--risk-high) 0%, var(--risk-medium) 50%, var(--color-primary) 100%);
  border-radius: 3px;
  transition: width 0.6s ease;
}

.highlight-box {
  background: var(--color-bg);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-md);
  padding: 16px;
  font-size: 14px;
  line-height: 1.8;
  max-height: 200px;
  overflow-y: auto;
  margin-bottom: 16px;
  white-space: pre-wrap;
  word-break: break-word;
}
.highlight-box mark {
  padding: 2px 4px;
  border-radius: 4px;
  font-weight: 600;
  cursor: help;
  transition: filter 0.15s ease;
}
.highlight-box mark:hover { filter: brightness(0.95); }
mark.risk-high { background: var(--risk-high-bg); color: var(--risk-high); border-bottom: 2px solid var(--risk-high); }
mark.risk-medium { background: var(--risk-medium-bg); color: var(--risk-medium); border-bottom: 2px solid var(--risk-medium); }
mark.risk-low { background: var(--risk-low-bg); color: var(--risk-low); border-bottom: 2px solid var(--risk-low); }

.risk-table-wrap {
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.risk-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.risk-table thead {
  background: var(--color-bg);
}
.risk-table th {
  padding: 10px 12px;
  text-align: start;
  font-weight: 600;
  color: var(--color-text-secondary);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--color-border);
}
.risk-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--color-border-light);
  vertical-align: middle;
}
.risk-table tr:last-child td { border-bottom: none; }
.risk-table tr:hover td { background: var(--color-bg); }
.risk-word {
  font-weight: 600;
  color: var(--color-text);
}
.level-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
}
.level-badge.high { background: var(--risk-high-bg); color: var(--risk-high); }
.level-badge.medium { background: var(--risk-medium-bg); color: var(--risk-medium); }
.level-badge.low { background: var(--risk-low-bg); color: var(--risk-low); }
.btn-action {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 500;
  background: var(--color-primary-light);
  color: var(--color-primary-dark);
  transition: all 0.2s ease;
}
.btn-action:hover { background: var(--color-primary); color: #fff; }
.btn-action svg { width: 12px; height: 12px; }

.btn-copy {
  width: 100%;
  margin-top: 16px;
  padding: 12px;
  border-radius: var(--radius-md);
  background: var(--color-surface);
  border: 1.5px solid var(--color-border);
  color: var(--color-text);
  font-size: 14px;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s ease;
}
.btn-copy:hover { border-color: var(--color-primary); color: var(--color-primary); }
.btn-copy svg { width: 16px; height: 16px; }
.btn-copy.copied {
  border-color: var(--color-primary);
  background: var(--color-primary-light);
  color: var(--color-primary-dark);
}
.btn-copy.error {
  border-color: var(--risk-high);
  background: var(--risk-high-bg);
  color: var(--risk-high);
}
.btn-copy svg { transition: transform 0.2s ease; }
.btn-copy.copied svg { transform: scale(1.15); }

/* --- Ad Section --- */
.ad-section {
  padding: 24px 0;
  margin: 0 auto;
  max-width: var(--container-max);
}
.ad-container {
  background: var(--color-surface);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-md);
  padding: 16px;
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* --- Examples --- */
.examples-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}
.example-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  transition: all 0.3s ease;
  cursor: pointer;
  display: flex;
  flex-direction: column;
}
.example-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--color-primary-light);
}
.example-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}
.example-icon svg { width: 24px; height: 24px; }
.example-icon.green { background: var(--color-primary-light); color: var(--color-primary); }
.example-icon.blue { background: var(--color-secondary-light); color: var(--color-secondary); }
.example-icon.orange { background: var(--risk-medium-bg); color: var(--risk-medium); }
.example-icon.red { background: var(--risk-high-bg); color: var(--risk-high); }
.example-card h3 {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 8px;
}
.example-card p {
  font-size: 14px;
  color: var(--color-text-secondary);
  flex-grow: 1;
  margin-bottom: 16px;
}
.example-load {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-primary);
}
.example-load svg { width: 14px; height: 14px; }

/* --- Docs --- */
.docs-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
}
.rule-list, .faq-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.rule-item {
  background: var(--color-surface);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-md);
  padding: 20px;
  display: flex;
  gap: 16px;
  transition: box-shadow 0.2s ease;
}
.rule-item:hover { box-shadow: var(--shadow-sm); }
.rule-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: var(--color-primary-light);
  color: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.rule-icon svg { width: 20px; height: 20px; }
.rule-content h4 {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 6px;
}
.rule-content p {
  font-size: 13px;
  color: var(--color-text-secondary);
  line-height: 1.6;
}

.faq-item {
  background: var(--color-surface);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.faq-question {
  width: 100%;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-align: start;
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text);
  transition: background 0.2s ease;
}
.faq-question:hover { background: var(--color-bg); }
.faq-question svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  transition: transform 0.3s ease;
  color: var(--color-text-muted);
}
.faq-item.open .faq-question svg { transform: rotate(180deg); }
.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}
.faq-item.open .faq-answer { max-height: 300px; }
.faq-answer p {
  padding: 0 20px 16px;
  font-size: 13px;
  color: var(--color-text-secondary);
  line-height: 1.7;
}

/* --- Footer --- */
.site-footer {
  background: var(--color-text);
  color: #CBD5E1;
  padding: 48px 0 24px;
  margin-top: 40px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 32px;
}
.footer-brand p {
  font-size: 13px;
  line-height: 1.7;
  color: #94A3B8;
  margin-top: 12px;
  max-width: 400px;
}
.footer-col h5 {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 14px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.footer-col a {
  display: block;
  font-size: 13px;
  color: #94A3B8;
  padding: 4px 0;
  transition: color 0.2s ease;
}
.footer-col a:hover { color: var(--color-primary); }
.footer-legal {
  font-size: 12px;
  color: #64748B;
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 20px;
  line-height: 1.6;
}
.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: #64748B;
  margin-top: 16px;
}

/* --- Toast --- */
.toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--color-text);
  color: #fff;
  padding: 12px 24px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  z-index: 1000;
  opacity: 0;
  transition: all 0.3s ease;
  pointer-events: none;
  display: flex;
  align-items: center;
  gap: 8px;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.toast.success { background: var(--color-primary-dark); }
.toast.error { background: var(--risk-high); }
.toast svg { width: 16px; height: 16px; flex-shrink: 0; }

/* --- Responsive --- */
@media (max-width: 1023px) {
  .tool-grid { grid-template-columns: 1fr; }
  .docs-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 24px; }
}
@media (max-width: 768px) {
  .container { padding: 0 16px; }
  .header-inner { padding: 0 16px; }
  .nav-links { display: none; }
  .hero { padding: 48px 0 40px; }
  .section { padding: 40px 0; }
  .stats-row { grid-template-columns: repeat(2, 1fr); }
  .tool-panel { padding: 16px; }
  .text-input { min-height: 180px; }
  .footer-bottom { flex-direction: column; gap: 8px; text-align: center; }
}

/* --- Animations --- */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
.fade-in {
  animation: fadeInUp 0.5s ease forwards;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}
.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

/* --- Scrollbar --- */
.highlight-box::-webkit-scrollbar,
.risk-table-wrap::-webkit-scrollbar { width: 6px; height: 6px; }
.highlight-box::-webkit-scrollbar-thumb,
.risk-table-wrap::-webkit-scrollbar-thumb { background: var(--color-border); border-radius: 3px; }
.lang-dropdown::-webkit-scrollbar { width: 6px; }
.lang-dropdown::-webkit-scrollbar-thumb { background: var(--color-border); border-radius: 3px; }

/* ============================================
   Desensitization Tool Styles
   ============================================ */

.section-alt {
  background: linear-gradient(180deg, var(--color-bg) 0%, #F0F9FF 100%);
}

.ds-workflow {
  display: flex;
  flex-direction: column;
  gap: 24px;
  max-width: 900px;
  margin: 0 auto;
}

.ds-step {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.3s ease, border-color 0.3s ease;
}

.ds-step:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--color-primary-light);
}

.ds-step-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.ds-step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--color-primary);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
  flex-shrink: 0;
}

.ds-step-label {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 17px;
  color: var(--color-text);
}

.ds-textarea {
  width: 100%;
  min-height: 120px;
  padding: 14px 16px;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.6;
  color: var(--color-text);
  background: var(--color-bg);
  resize: vertical;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.ds-textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.ds-output {
  min-height: 100px;
  padding: 16px;
  background: var(--color-bg);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.7;
  color: var(--color-text);
  white-space: pre-wrap;
  word-break: break-word;
  overflow-x: auto;
}

.ds-output:not(:empty) {
  background: #F0FDF4;
  border-color: var(--color-primary-light);
}

.ds-placeholder-text {
  color: var(--color-text-muted);
  font-style: italic;
  margin: 0;
}

.ds-step-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
  align-items: center;
}

.btn-ds {
  background: var(--color-primary) !important;
  color: #fff !important;
  padding: 10px 20px !important;
  border-radius: var(--radius-md) !important;
  font-weight: 600 !important;
  font-size: 14px !important;
  display: inline-flex !important;
  align-items: center;
  gap: 8px;
  transition: background 0.2s ease, transform 0.1s ease;
}

.btn-ds:hover {
  background: var(--color-primary-dark) !important;
  transform: translateY(-1px);
}

.btn-ds:active {
  transform: translateY(0);
}

.btn-ds svg {
  width: 18px;
  height: 18px;
}

/* Details Table */
.ds-details-wrap {
  margin-top: 16px;
}

.ds-details-label {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 14px;
  color: var(--color-text-secondary);
  margin-bottom: 10px;
}

.ds-details-table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
}

.ds-details-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.ds-details-table th {
  background: var(--color-bg);
  padding: 10px 14px;
  text-align: left;
  font-weight: 600;
  color: var(--color-text-secondary);
  border-bottom: 1px solid var(--color-border);
  white-space: nowrap;
}

.ds-details-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--color-border-light);
  color: var(--color-text);
}

.ds-details-table tr:last-child td {
  border-bottom: none;
}

.ds-details-table .ds-ph {
  font-family: 'Courier New', monospace;
  font-weight: 600;
  color: var(--color-secondary);
  background: var(--color-secondary-light);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
}

.ds-details-table .ds-masked {
  font-family: 'Courier New', monospace;
  color: var(--risk-medium);
  font-weight: 600;
}

.ds-details-table .ds-type-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
}

.ds-type-badge.pwd { background: #FEE2E2; color: #DC2626; }
.ds-type-badge.phone { background: #E0F2FE; color: #0284C7; }
.ds-type-badge.idcard { background: #FEF3C7; color: #D97706; }
.ds-type-badge.email { background: #EDE9FE; color: #7C3AED; }
.ds-type-badge.bankcard { background: #D1FAE5; color: #059669; }
.ds-type-badge.ip { background: #FCE7F3; color: #DB2777; }

/* Placeholder highlight in output */
.ds-output .ds-highlight-ph {
  font-family: 'Courier New', monospace;
  font-weight: 600;
  color: var(--color-secondary);
  background: var(--color-secondary-light);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 0.9em;
}

/* Warning banner */
.ds-warning {
  margin-top: 12px;
  padding: 10px 14px;
  background: var(--risk-medium-bg);
  border: 1px solid var(--risk-medium);
  border-radius: var(--radius-sm);
  color: #92400E;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.ds-warning svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

/* Responsive */
@media (max-width: 768px) {
  .ds-step {
    padding: 16px;
  }

  .ds-step-label {
    font-size: 15px;
  }

  .ds-step-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .ds-step-actions .btn-text,
  .ds-step-actions .btn-ds {
    justify-content: center;
  }

  .ds-details-table {
    font-size: 12px;
  }

  .ds-details-table th,
  .ds-details-table td {
    padding: 8px 10px;
  }
}
