/* ===================================================
   Arnold Laoshi Tools — Design System
   Bricolage Grotesque + DM Sans | Warm cream + vivid blue
   =================================================== */

@import url('https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,400;12..96,600;12..96,700;12..96,800&family=DM+Sans:ital,opsz,wght@0,9..40,400;0,9..40,500;0,9..40,600;1,9..40,400&display=swap');

/* ---- Tokens ---- */
:root {
  --bg:           #F7F6F2;
  --surface:      #FFFFFF;
  --surface-2:    #F0EFE9;
  --border:       #E2DFD8;
  --border-focus: #1D6BFF;

  --blue:         #1D6BFF;
  --blue-dark:    #1553CC;
  --blue-glow:    rgba(29,107,255,0.22);
  --blue-light:   rgba(29,107,255,0.08);

  --green:        #0D9B6B;
  --green-glow:   rgba(13,155,107,0.22);
  --green-light:  rgba(13,155,107,0.10);

  --amber:        #E68A00;
  --amber-light:  rgba(230,138,0,0.12);

  --text:         #18181B;
  --text-2:       #52525B;
  --text-3:       #A1A1AA;

  --shadow-sm:    0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md:    0 4px 16px rgba(0,0,0,0.08), 0 2px 4px rgba(0,0,0,0.04);
  --shadow-lg:    0 12px 40px rgba(0,0,0,0.10), 0 4px 8px rgba(0,0,0,0.04);
  --shadow-blue:  0 6px 20px var(--blue-glow);
  --shadow-green: 0 6px 20px var(--green-glow);

  --r-sm: 8px; --r-md: 12px; --r-lg: 16px; --r-xl: 20px; --r-full: 999px;

  --font-display: 'Bricolage Grotesque', system-ui, sans-serif;
  --font-body:    'DM Sans', system-ui, sans-serif;
}

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

/* ---- Base ---- */
.al-body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

/* ================================================
   HEADER
   ================================================ */
.al-header {
  position: sticky; top: 0; z-index: 50;
  height: 68px;
  background: rgba(247,246,242,0.90);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 28px;
}

.al-logo {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 800;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.03em;
  display: flex; align-items: center; gap: 10px;
}
.al-logo-icon {
  width: 34px; height: 34px;
  background: var(--blue);
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  font-size: 17px;
  box-shadow: 0 2px 8px var(--blue-glow);
}

.al-header-cta {
  display: inline-flex; align-items: center; gap: 7px;
  height: 38px; padding: 0 16px;
  background: #1877F2;
  color: #fff;
  border-radius: var(--r-full);
  font-family: var(--font-body);
  font-size: 13px; font-weight: 600;
  text-decoration: none;
  transition: transform 0.15s, box-shadow 0.15s;
  box-shadow: 0 2px 8px rgba(24,119,242,0.30);
}
.al-header-cta:hover { transform: translateY(-1px); box-shadow: 0 4px 14px rgba(24,119,242,0.40); }
.al-header-cta svg { flex-shrink: 0; }

/* ================================================
   FOOTER
   ================================================ */
.al-footer {
  border-top: 1px solid var(--border);
  padding: 36px 28px;
  text-align: center;
  font-size: 14px;
  color: var(--text-3);
}
.al-footer a { color: var(--blue); text-decoration: none; }
.al-footer a:hover { text-decoration: underline; }

/* ================================================
   HOMEPAGE
   ================================================ */

/* Hero */
.al-hero-avatar {
  margin-bottom: 20px;
}
.al-hero-avatar img {
  width: 120px; height: 120px;
  object-fit: cover;
  border-radius: 50%;
  box-shadow: 0 8px 32px rgba(0,0,0,0.12), 0 2px 8px rgba(0,0,0,0.08);
  display: block; margin: 0 auto;
}
.al-hero {
  max-width: 680px; margin: 0 auto;
  padding: 72px 28px 52px;
  text-align: center;
}
.al-hero-badge {
  display: inline-flex; align-items: center; gap: 6px;
  height: 30px; padding: 0 12px;
  background: var(--blue-light);
  color: var(--blue);
  border-radius: var(--r-full);
  font-size: 12px; font-weight: 600;
  letter-spacing: 0.04em; text-transform: uppercase;
  margin-bottom: 20px;
}
.al-hero h1 {
  font-family: var(--font-display);
  font-size: clamp(32px, 5vw, 52px);
  font-weight: 800;
  line-height: 1.10;
  letter-spacing: -0.04em;
  color: var(--text);
  margin-bottom: 16px;
}
.al-hero h1 span { color: var(--blue); }
.al-hero-sub {
  font-size: 18px;
  color: var(--text-2);
  max-width: 480px; margin: 0 auto 28px;
  line-height: 1.5;
}
.al-trust-badges {
  display: flex; align-items: center; justify-content: center; gap: 20px;
  flex-wrap: wrap;
}
.al-trust-badge {
  display: flex; align-items: center; gap: 6px;
  font-size: 13px; color: var(--text-2); font-weight: 500;
}
.al-trust-badge svg { color: var(--green); }

/* Native ad — editorial style */
.al-native-ad {
  max-width: 640px; margin: 0 auto 36px;
  padding: 0 28px;
}
.al-native-ad-inner {
  display: flex; align-items: center; gap: 16px;
  padding: 16px 20px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-left: 4px solid #1877F2;
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  text-decoration: none; color: inherit;
  transition: box-shadow 0.2s, transform 0.2s;
}
.al-native-ad-inner:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}
.al-native-ad-fb {
  width: 40px; height: 40px; border-radius: 10px;
  background: #1877F2; display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.al-native-ad-text { flex: 1; }
.al-native-ad-text strong { display: block; font-size: 14px; font-weight: 600; color: var(--text); }
.al-native-ad-text span { font-size: 13px; color: var(--text-2); }
.al-native-ad-arrow { font-size: 18px; color: var(--text-3); flex-shrink: 0; }

/* Tool grid */
.al-tools-section { max-width: 840px; margin: 0 auto; padding: 0 28px 80px; }
.al-tools-label {
  font-size: 11px; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--text-3);
  margin-bottom: 20px;
}
.al-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
@media (max-width: 840px) { .al-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 540px) { .al-grid { grid-template-columns: 1fr; } }

/* Tool card */
.al-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--r-xl);
  padding: 28px;
  text-decoration: none; color: inherit;
  display: flex; flex-direction: column; gap: 0;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
  box-shadow: var(--shadow-sm);
  position: relative; overflow: hidden;
}
.al-card:hover {
  border-color: var(--blue);
  box-shadow: var(--shadow-lg), 0 0 0 4px var(--blue-light);
  transform: translateY(-3px);
}
.al-card-icon {
  width: 60px; height: 60px;
  background: var(--blue-light);
  border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  font-size: 28px;
  margin-bottom: 20px;
}
.al-card h3 {
  font-family: var(--font-display);
  font-size: 19px; font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: 8px;
}
.al-card p {
  font-size: 14px; color: var(--text-2);
  line-height: 1.55;
  flex: 1;
  margin-bottom: 24px;
}
.al-card-cta {
  display: inline-flex; align-items: center; gap: 8px;
  height: 44px; padding: 0 20px;
  background: var(--blue);
  color: #fff;
  border-radius: var(--r-md);
  font-size: 14px; font-weight: 600;
  box-shadow: var(--shadow-blue);
  transition: background 0.15s, box-shadow 0.15s, transform 0.15s;
  align-self: flex-start;
}
.al-card:hover .al-card-cta {
  background: var(--blue-dark);
  box-shadow: 0 8px 24px var(--blue-glow);
  transform: translateX(2px);
}

/* ================================================
   BUTTONS
   ================================================ */
.al-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  height: 52px; padding: 0 28px;
  border-radius: var(--r-md);
  font-family: var(--font-body);
  font-size: 16px; font-weight: 600;
  cursor: pointer; border: none;
  transition: transform 0.15s, box-shadow 0.15s, background 0.15s;
  letter-spacing: 0.01em;
  text-decoration: none;
}
.al-btn:active { transform: scale(0.97) !important; }

.al-btn-primary {
  background: var(--blue);
  color: #fff;
  box-shadow: var(--shadow-blue);
}
.al-btn-primary:hover:not(:disabled) {
  background: var(--blue-dark);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px var(--blue-glow);
}
.al-btn-primary:disabled {
  background: #E8EFFE;
  color: #8AAAE8;
  box-shadow: none;
  cursor: not-allowed;
  opacity: 1;
}

.al-btn-success {
  background: var(--green);
  color: #fff;
  box-shadow: var(--shadow-green);
}
.al-btn-success:hover {
  background: #0B8A5F;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px var(--green-glow);
}

.al-btn-secondary {
  background: var(--surface);
  color: var(--text);
  border: 1.5px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.al-btn-secondary:hover {
  background: var(--surface-2);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.al-btn-sm {
  height: 40px; padding: 0 18px; font-size: 14px;
}

/* Full-width variant */
.al-btn-full { width: 100%; }

/* ================================================
   TOOL PAGE LAYOUT
   ================================================ */
.al-tool-header {
  padding: 28px 28px 0;
  max-width: 1160px; margin: 0 auto;
}
.al-tool-breadcrumb {
  display: flex; align-items: center; gap: 6px;
  font-size: 13px; color: var(--text-3);
  margin-bottom: 12px;
}
.al-tool-breadcrumb a { color: var(--text-3); text-decoration: none; }
.al-tool-breadcrumb a:hover { color: var(--blue); }
.al-tool-breadcrumb span { color: var(--text-3); }

.al-tool-title {
  display: flex; align-items: center; gap: 14px;
  margin-bottom: 6px;
}
.al-tool-title-icon {
  width: 48px; height: 48px;
  background: var(--blue-light);
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; flex-shrink: 0;
}
.al-tool-title h1 {
  font-family: var(--font-display);
  font-size: 26px; font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text);
}
.al-tool-desc {
  font-size: 15px; color: var(--text-2);
  margin-top: 6px; margin-left: 62px;
}

/* Steps indicator */
.al-steps {
  display: flex; align-items: center; gap: 0;
  margin: 24px 0 0; margin-left: 0;
  padding: 16px 20px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--r-lg);
  max-width: 1160px;
}
.al-step {
  display: flex; align-items: center; gap: 10px;
  flex: 1;
}
.al-step-num {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700;
  color: var(--text-3);
  flex-shrink: 0;
  transition: all 0.3s;
}
.al-step.active .al-step-num {
  background: var(--blue); border-color: var(--blue);
  color: #fff; box-shadow: 0 2px 8px var(--blue-glow);
}
.al-step.done .al-step-num {
  background: var(--green); border-color: var(--green); color: #fff;
}
.al-step-label { font-size: 13px; font-weight: 500; color: var(--text-3); }
.al-step.active .al-step-label { color: var(--text); font-weight: 600; }
.al-step.done .al-step-label { color: var(--green); }
.al-step-sep {
  flex: 1; height: 1.5px;
  background: var(--border);
  min-width: 16px;
}

/* Tool body */
.al-tool-body {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 24px;
  padding: 24px 28px 60px;
  max-width: 1160px; margin: 0 auto;
}
@media (max-width: 860px) {
  .al-tool-body { grid-template-columns: 1fr; }
}

/* Panel */
.al-panel {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--r-xl);
  overflow: hidden;
}
.al-panel-header {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  font-size: 11px; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--text-2);
  display: flex; align-items: center; gap: 8px;
}
.al-panel-body { padding: 20px; display: flex; flex-direction: column; gap: 16px; }

/* ================================================
   UPLOAD ZONE
   ================================================ */
.al-upload-zone {
  border: 2.5px dashed var(--border);
  border-radius: var(--r-xl);
  padding: 40px 20px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
  background: var(--bg);
  position: relative;
  min-height: 160px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.al-upload-zone:hover,
.al-upload-zone.active {
  border-color: var(--blue);
  background: var(--blue-light);
  box-shadow: 0 0 0 4px rgba(29,107,255,0.06);
}
.al-upload-zone-icon {
  width: 64px; height: 64px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 16px;
  margin: 0 auto 16px;
  display: flex; align-items: center; justify-content: center;
  font-size: 30px;
  box-shadow: var(--shadow-md);
  transition: transform 0.2s;
}
.al-upload-zone:hover .al-upload-zone-icon { transform: translateY(-2px); }
.al-upload-zone p { font-size: 15px; color: var(--text); font-weight: 600; margin-bottom: 4px; }
.al-upload-zone span { font-size: 12px; color: var(--text-3); }


/* ================================================
   UPLOAD ZONE (forge-upload — generated by core.js)
   ================================================ */
.forge-upload {
  border: 2.5px dashed var(--border);
  border-radius: var(--r-xl);
  padding: 36px 20px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
  background: var(--bg);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: 160px;
  outline: none;
}
.forge-upload:hover,
.forge-upload.active {
  border-color: var(--blue);
  background: var(--blue-light);
  box-shadow: 0 0 0 4px rgba(29,107,255,0.06);
}
.forge-upload svg {
  display: block;
  color: var(--text-3);
  width: 40px; height: 40px;
  padding: 8px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow-md);
  transition: transform 0.2s;
  margin-bottom: 4px;
}
.forge-upload:hover svg { transform: translateY(-2px); color: var(--blue); border-color: rgba(29,107,255,0.3); }
.forge-upload p:first-of-type { font-size: 15px !important; font-weight: 600 !important; color: var(--text) !important; margin: 12px 0 4px !important; opacity: 1 !important; }
.forge-upload p:last-of-type { font-size: 12px !important; color: var(--text-3) !important; }

/* ================================================
   FORM ELEMENTS
   ================================================ */
.al-field { display: flex; flex-direction: column; gap: 6px; }
.al-label {
  font-size: 13px; font-weight: 600;
  color: var(--text);
  display: flex; align-items: center; gap: 6px;
}
.al-label-hint { font-weight: 400; color: var(--text-3); }
.al-input, .al-select, .al-textarea {
  font-family: var(--font-body);
  font-size: 15px; color: var(--text);
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  padding: 0 14px;
  height: 48px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  width: 100%;
}
.al-textarea {
  height: auto; min-height: 90px;
  padding: 12px 14px; resize: vertical; line-height: 1.5;
}
.al-input:focus, .al-select:focus, .al-textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px var(--blue-light);
}
.al-field-hint { font-size: 12px; color: var(--text-3); }
.al-select { cursor: pointer; }

/* ================================================
   PREVIEW AREA
   ================================================ */
.al-preview-panel {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--r-xl);
  overflow: hidden;
  display: flex; flex-direction: column;
}
.al-preview-area {
  flex: 1;
  min-height: 360px;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg);
  padding: 24px;
  position: relative;
}
.al-preview-area img,
.al-preview-area canvas {
  max-width: 100%; max-height: 480px;
  object-fit: contain;
  border-radius: var(--r-md);
  box-shadow: var(--shadow-md);
}
.al-preview-empty {
  text-align: center;
}
.al-preview-empty-icon { font-size: 52px; margin-bottom: 14px; opacity: 0.55; }
.al-preview-empty p { font-size: 14px; color: var(--text-2); font-weight: 500; }

.al-preview-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  display: flex; gap: 10px; flex-wrap: wrap;
  background: var(--surface);
}

/* ================================================
   INFO / ALERT BOXES
   ================================================ */
.al-info {
  padding: 12px 14px; border-radius: var(--r-md);
  font-size: 13px; line-height: 1.5;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-2);
}
.al-info-amber {
  background: var(--amber-light);
  border: 1px solid rgba(230,138,0,0.25);
  color: #92400E;
}
.al-info-blue {
  background: var(--blue-light);
  border: 1px solid rgba(29,107,255,0.2);
  color: #1E40AF;
}
.al-info-green {
  background: var(--green-light);
  border: 1px solid rgba(13,155,107,0.2);
  color: #065F46;
}
.al-warning-strip {
  background: #FFFBEB;
  border: 2px solid #F59E0B;
  border-radius: var(--r-md);
  padding: 12px 16px;
  font-size: 13px;
  font-weight: 600;
  color: #78350F;
  line-height: 1.5;
}
.al-warning-strip a {
  color: #1D6BFF;
  font-weight: 700;
  text-decoration: underline;
}

/* ================================================
   QR RESULT
   ================================================ */
.al-qr-result {
  display: flex; flex-direction: column;
  align-items: center; gap: 16px;
  width: 100%;
}
.al-qr-result canvas { border-radius: var(--r-md); box-shadow: var(--shadow-md); }
.al-wa-link {
  font-size: 12px; color: var(--blue);
  background: var(--blue-light);
  border: 1px solid rgba(29,107,255,0.2);
  padding: 8px 14px; border-radius: var(--r-md);
  word-break: break-all; text-align: center; max-width: 100%;
  text-decoration: none;
}
.al-wa-link:hover { text-decoration: underline; }
.al-code-badge {
  display: flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 600;
  background: var(--green-light);
  border: 1px solid rgba(13,155,107,0.2);
  color: #065F46;
  padding: 6px 14px; border-radius: var(--r-full);
}

/* ================================================
   SIDEBAR AD (tool pages)
   ================================================ */
.al-sidebar-ad {
  margin-top: auto;
}
.al-sidebar-ad-inner {
  display: flex; flex-direction: column; gap: 8px;
  padding: 14px 16px;
  background: var(--bg);
  border: 1.5px dashed var(--border);
  border-radius: var(--r-lg);
  text-decoration: none; color: inherit;
  transition: border-color 0.15s;
}
.al-sidebar-ad-inner:hover { border-color: #1877F2; }
.al-sidebar-ad-inner strong { font-size: 13px; font-weight: 600; color: var(--text); }
.al-sidebar-ad-inner span { font-size: 12px; color: #1877F2; font-weight: 500; }

/* ================================================
   TOAST
   ================================================ */
.al-toast-container {
  position: fixed; bottom: 24px; right: 24px; z-index: 9999;
  display: flex; flex-direction: column; gap: 8px;
}
.al-toast {
  padding: 13px 20px; border-radius: var(--r-md);
  font-size: 14px; font-weight: 500;
  animation: al-toast-in 0.25s cubic-bezier(0.34,1.56,0.64,1);
  box-shadow: var(--shadow-lg);
  max-width: 320px;
}
.al-toast-info    { background: var(--text); color: #fff; }
.al-toast-success { background: var(--green); color: #fff; }
.al-toast-error   { background: #DC2626; color: #fff; }
.al-toast-warn    { background: #D97706; color: #fff; }
@keyframes al-toast-in {
  from { opacity:0; transform: translateY(12px) scale(0.95); }
  to   { opacity:1; transform: none; }
}

/* ================================================
   LOADING OVERLAY
   ================================================ */
.al-loading-overlay {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px;
  background: rgba(247,246,242,0.88);
  backdrop-filter: blur(6px);
}
.al-spinner {
  width: 44px; height: 44px; border-radius: 50%;
  border: 3px solid var(--border); border-top-color: var(--blue);
  animation: al-spin 0.7s linear infinite;
}
@keyframes al-spin { to { transform: rotate(360deg); } }
.al-loading-overlay p {
  font-size: 15px; font-weight: 500; color: var(--text-2);
  font-family: var(--font-body);
}

/* ================================================
   ANIMATIONS
   ================================================ */
.al-fade-up {
  opacity: 0;
  animation: al-fade-up 0.5s cubic-bezier(0.16,1,0.3,1) forwards;
}
.al-fade-up:nth-child(1) { animation-delay: 0.05s; }
.al-fade-up:nth-child(2) { animation-delay: 0.12s; }
.al-fade-up:nth-child(3) { animation-delay: 0.19s; }
.al-fade-up:nth-child(4) { animation-delay: 0.26s; }
@keyframes al-fade-up {
  from { opacity:0; transform: translateY(16px); }
  to   { opacity:1; transform: none; }
}
