/* AL-UI-1.0 framework-agnostic shell, restyled to Ai小酒馆 warm theme.
   Namespace only: .al-shell / .al-* — keep classes sites' app.js depends on. */
.al-shell { color: var(--al-text); background: var(--al-bg); font: 16px/1.6 var(--al-font); min-height: 100vh; }
.al-shell *, .al-shell *::before, .al-shell *::after { box-sizing: border-box; }
.al-shell a { color: var(--al-brand); }
.al-shell .al-container { max-width: var(--al-content-width); margin-inline: auto; padding-inline: var(--al-space-4); }
.al-shell .al-editor { max-width: var(--al-editor-width); margin-inline: auto; padding-inline: var(--al-space-4); }

/* Header / navigation */
.al-shell .al-header {
  height: 64px; display: flex; align-items: center; justify-content: space-between; gap: var(--al-space-4);
  background: var(--al-nav-bg); border-bottom: 1px solid var(--al-border);
  padding-inline: var(--al-space-4); position: sticky; top: 0; z-index: 50; backdrop-filter: blur(8px);
}
.al-shell .al-header--canvas { height: 48px; }
.al-shell .al-brand { display: inline-flex; align-items: center; gap: var(--al-space-2); font-weight: 700; color: var(--al-text); text-decoration: none; letter-spacing: .01em; }
.al-shell .al-brand-mark { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: var(--al-brand-hover); color: #fff; font-size: 15px; }
.al-shell .al-nav { display: flex; align-items: center; gap: var(--al-space-3); }
.al-shell .al-nav a { min-height: 44px; display: inline-flex; align-items: center; text-decoration: none; padding-inline: var(--al-space-2); border-radius: var(--al-radius-control); font-weight: 500; }
.al-shell .al-nav a:hover { background: var(--al-brand-soft); }
.al-shell .al-nav a.al-nav-cta { color: #fff; background: var(--al-brand); padding-inline: var(--al-space-3); }
.al-shell .al-nav a.al-nav-cta:hover { background: var(--al-brand-hover); }
.al-shell .al-theme-toggle { min-height: 44px; min-width: 44px; border: 1px solid var(--al-border); background: var(--al-surface); color: var(--al-text); border-radius: 999px; cursor: pointer; font: inherit; }
.al-shell .al-menu-toggle { display: none; min-height: 44px; min-width: 44px; border: 1px solid var(--al-border); background: var(--al-surface); color: var(--al-text); border-radius: var(--al-radius-control); cursor: pointer; font-size: 20px; }

/* Breadcrumbs + hero */
.al-shell .al-crumbs { padding-block: var(--al-space-3); color: var(--al-muted); font-size: 14px; }
.al-shell .al-hero { padding-block: var(--al-space-8) var(--al-space-6); }
.al-shell .al-hero h1 { margin: 0 0 var(--al-space-2); font-size: 40px; line-height: 48px; letter-spacing: -.01em; }
.al-shell .al-hero p { margin: 0; color: var(--al-muted); font-size: 18px; }
.al-shell .al-kicker { display: inline-block; font-size: 13px; letter-spacing: .12em; text-transform: uppercase; color: var(--al-brand); font-weight: 700; margin-bottom: var(--al-space-2); }
.al-shell .al-tag { display: inline-block; font-size: 14px; border-radius: 999px; background: var(--al-brand-soft); color: var(--al-brand); padding: 2px 10px; margin-left: var(--al-space-2); }

/* Headings + section */
.al-shell h2 { font-size: 24px; line-height: 32px; }
.al-shell .al-section-head { display: flex; flex-direction: column; gap: var(--al-space-1); margin-block: var(--al-space-8) var(--al-space-4); }
.al-shell .al-section-head h2 { margin: 0; }

/* Cards */
.al-shell .al-card { background: var(--al-surface); border: 1px solid var(--al-border); border-radius: var(--al-radius-card); padding: var(--al-space-6); box-shadow: var(--al-shadow); }
.al-shell .al-card h2 { margin-top: 0; }
.al-shell .al-card-grid { display: grid; gap: var(--al-space-4); grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }

/* Workspace / panels / form */
.al-shell .al-workspace { display: grid; gap: var(--al-space-4); margin-block: var(--al-space-6); }
.al-shell .al-workspace--file { grid-template-columns: 280px minmax(0, 1fr); }
.al-shell .al-workspace--split { grid-template-columns: minmax(0,1fr) minmax(0,1fr); }
.al-shell .al-panel { display: flex; flex-direction: column; gap: var(--al-space-3); }
.al-shell .al-label { display: block; font-size: 14px; font-weight: 600; margin-bottom: var(--al-space-1); }
.al-shell .al-input, .al-shell .al-textarea, .al-shell select.al-input { width: 100%; min-height: 44px; padding: 8px 12px; border: 1px solid var(--al-border); border-radius: var(--al-radius-control); background: var(--al-surface); color: var(--al-text); font: inherit; }
.al-shell .al-textarea { min-height: 200px; resize: vertical; font-family: var(--al-font-mono); font-size: 14px; }
.al-shell .al-control:focus-visible, .al-shell .al-input:focus-visible, .al-shell .al-textarea:focus-visible { outline: 2px solid var(--al-focus); outline-offset: 2px; }

/* Buttons */
.al-shell .al-btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--al-space-2); min-height: 44px; padding-inline: var(--al-space-4); border-radius: var(--al-radius-control); border: 1px solid var(--al-brand); background: var(--al-brand); color: #fff; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; }
.al-shell .al-btn:hover:not(:disabled) { background: var(--al-brand-hover); }
.al-shell .al-btn:disabled { opacity: .55; cursor: not-allowed; }
.al-shell .al-btn--secondary { background: var(--al-surface); color: var(--al-text); border-color: var(--al-border); }
.al-shell .al-btn--secondary:hover:not(:disabled) { border-color: var(--al-brand); color: var(--al-brand); }
.al-shell .al-btn--danger { background: var(--al-surface); color: var(--al-danger); border-color: var(--al-danger); }

/* Status / error / result */
.al-shell .al-error { color: var(--al-danger); font-size: 14px; }
.al-shell .al-field-error { color: var(--al-danger); font-size: 14px; margin-top: var(--al-space-1); }
.al-shell .al-status { border-radius: var(--al-radius-control); padding: var(--al-space-3) var(--al-space-4); background: var(--al-brand-soft); font-size: 14px; }
.al-shell .al-status[data-state="error"] { background: #fdecea; color: var(--al-danger); }
.al-shell .al-result { display: flex; flex-wrap: wrap; gap: var(--al-space-2); align-items: center; }
.al-shell .al-result-meta { color: var(--al-muted); font-size: 14px; }
.al-shell .al-related { display: flex; flex-wrap: wrap; gap: var(--al-space-2); list-style: none; padding: 0; }
.al-shell .al-grid { display: grid; gap: var(--al-space-4); grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.al-shell .al-grid > .al-card { margin: 0; }

/* Code + guide + faq */
.al-shell pre.al-card, .al-shell .al-output { background: var(--al-code-bg); border: 1px solid var(--al-border); border-radius: var(--al-radius-card); padding: var(--al-space-4); overflow: auto; font-family: var(--al-font-mono); font-size: 14px; }
.al-shell .al-guide { max-width: 760px; }
.al-shell .al-faq { display: grid; gap: var(--al-space-3); }
.al-shell .al-faq details { border: 1px solid var(--al-border); border-radius: var(--al-radius-control); padding: var(--al-space-3) var(--al-space-4); background: var(--al-surface); }
.al-shell .al-faq summary { cursor: pointer; font-weight: 600; }
.al-shell .al-visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Footer */
.al-shell .al-footer { border-top: 1px solid var(--al-border); margin-top: var(--al-space-12); padding-block: var(--al-space-6); color: var(--al-muted); font-size: 14px; }
.al-shell .al-footer a { color: var(--al-muted); }
.al-shell .al-ad-slot { display: none; } /* ads default off */

/* Reveal on scroll */
.al-shell .al-reveal { opacity: 0; transform: translateY(12px); transition: opacity .5s ease, transform .5s ease; }
.al-shell .al-reveal.is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .al-shell .al-reveal { opacity: 1; transform: none; transition: none; } }

/* Mobile */
@media (max-width: 767px) {
  .al-shell .al-hero h1 { font-size: 28px; line-height: 36px; }
  .al-shell .al-workspace--file, .al-shell .al-workspace--split { grid-template-columns: minmax(0,1fr); }
  .al-shell .al-crumbs { display: none; }
  .al-shell .al-header { padding-inline: var(--al-space-2); }
  .al-shell .al-card { padding: var(--al-space-4); }
  .al-shell .al-menu-toggle { display: inline-flex; align-items: center; justify-content: center; }
  .al-shell .al-nav { position: absolute; top: 64px; left: 0; right: 0; flex-direction: column; align-items: stretch; gap: 0; background: var(--al-nav-bg); border-bottom: 1px solid var(--al-border); padding: var(--al-space-2); display: none; }
  .al-shell .al-header--canvas .al-nav { top: 48px; }
  .al-shell .al-nav.is-open { display: flex; }
  .al-shell .al-nav a { min-height: 48px; padding-inline: var(--al-space-3); }
}
@media (min-width: 768px) and (max-width: 1023px) {
  .al-shell .al-workspace--file { grid-template-columns: 240px minmax(0,1fr); }
}