:root {
  --ink: #18202b;
  --muted: #6b7480;
  --faint: #9aa3ad;
  --paper: #ffffff;
  --canvas: #f3f0ea;
  --canvas-2: #e9edf0;
  --line: #ddd8cf;
  --line-dark: rgba(255, 255, 255, 0.1);
  --primary: #1d2a35;
  --primary-2: #111a22;
  --accent: #2f6f73;
  --accent-2: #a97035;
  --promo: #b56f22;
  --hygiene: #237b66;
  --danger: #b84a3d;
  --note-bg: #fbf1d7;
  --note-ink: #6e521c;
  --shadow: 0 18px 48px rgba(32, 41, 48, 0.12);
  --shadow-tight: 0 8px 22px rgba(32, 41, 48, 0.08);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    Roboto, "Helvetica Neue", Arial, "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(120deg, rgba(255, 255, 255, 0.42), transparent 30%),
    linear-gradient(180deg, var(--canvas), var(--canvas-2));
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(rgba(29, 42, 53, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(29, 42, 53, 0.035) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.75), transparent 78%);
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.hidden {
  display: none !important;
}

.eyebrow {
  margin: 0 0 7px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.login-view {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px;
  background:
    linear-gradient(135deg, rgba(17, 26, 34, 0.96), rgba(36, 48, 54, 0.94)),
    radial-gradient(circle at 72% 18%, rgba(169, 112, 53, 0.26), transparent 24rem);
}

.login-shell {
  width: min(960px, 100%);
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 1px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.14);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.28);
}

.login-brand,
.login-box {
  min-height: 430px;
}

.login-brand {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 42px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02)),
    rgba(15, 22, 28, 0.7);
  color: white;
}

.login-brand::after {
  content: "Recipe · Hygiene · Promotion · Training";
  max-width: 360px;
  color: rgba(255, 255, 255, 0.55);
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.login-logo {
  width: 78px;
  height: 78px;
  object-fit: contain;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.94);
  padding: 9px;
  margin-bottom: 28px;
}

.login-brand h1,
.login-box h2 {
  margin: 0;
}

.login-brand h1 {
  max-width: 540px;
  font-size: clamp(40px, 6vw, 68px);
  line-height: 1.02;
  letter-spacing: 0;
}

.login-box {
  background: #f7f4ee;
  padding: 34px;
}

.login-box p {
  color: var(--muted);
  font-size: 14px;
}

.login-box label {
  display: block;
  margin-top: 18px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.login-input {
  width: 100%;
  height: 46px;
  margin-top: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: none;
  background: white;
  padding: 0 13px;
}

.login-input:focus,
.search-input:focus,
.home-search-input:focus {
  border-color: rgba(47, 111, 115, 0.55);
  box-shadow: 0 0 0 4px rgba(47, 111, 115, 0.12);
}

.login-btn,
.search-btn,
.back-btn,
.home-btn {
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  background: var(--primary);
  color: white;
  font-weight: 800;
  padding: 0 16px;
}

.login-btn {
  width: 100%;
  margin-top: 22px;
}

#login-error {
  display: none;
  margin-top: 14px;
  color: var(--danger);
  font-weight: 800;
  text-align: center;
}

.shake {
  animation: shake 0.32s ease;
}

@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-10px);
  }
  50% {
    transform: translateX(10px);
  }
  75% {
    transform: translateX(-8px);
  }
}

.app-view {
  display: grid;
  grid-template-columns: 248px 1fr;
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 18px;
  background:
    linear-gradient(180deg, rgba(29, 42, 53, 0.98), rgba(17, 26, 34, 0.98)),
    var(--primary);
  color: white;
}

.side-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  color: white;
  text-decoration: none;
  font-weight: 900;
}

.side-brand img {
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 10px;
  background: white;
  padding: 6px;
}

.side-nav {
  display: grid;
  gap: 6px;
  margin-top: 30px;
}

.side-nav button {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: rgba(255, 255, 255, 0.66);
  padding: 0 10px;
  text-align: left;
}

.side-nav button span {
  width: 22px;
  opacity: 0.78;
  filter: grayscale(0.7);
  text-align: center;
}

.side-nav button strong {
  font-size: 14px;
}

.side-nav button.active,
.side-nav button:hover {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.08);
  color: white;
}

.side-nav button.active::after {
  content: "";
  width: 5px;
  height: 5px;
  margin-left: auto;
  border-radius: 50%;
  background: var(--accent-2);
}

.side-note {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 18px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.055);
  padding: 14px;
}

.side-note strong,
.side-note span {
  display: block;
}

.side-note span {
  margin-top: 4px;
  color: rgba(255, 255, 255, 0.58);
  font-size: 12px;
}

.workspace {
  min-width: 0;
  padding: 22px 26px 34px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 72px;
  margin: -22px -26px 22px;
  border-bottom: 1px solid rgba(221, 216, 207, 0.88);
  background: rgba(243, 240, 234, 0.88);
  backdrop-filter: blur(18px);
  padding: 10px 26px;
}

.topbar h1 {
  margin: 0;
  font-size: 22px;
  letter-spacing: 0;
}

.icon-btn,
#backToTop {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--primary);
  box-shadow: var(--shadow-tight);
}

.icon-btn {
  display: none;
  width: 42px;
  height: 42px;
}

.home-btn,
.back-btn {
  background: rgba(255, 255, 255, 0.78);
  color: var(--primary);
  border: 1px solid var(--line);
}

.hero-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 216px;
  gap: 24px;
  border: 1px solid rgba(29, 42, 53, 0.12);
  border-radius: 14px;
  background:
    linear-gradient(135deg, rgba(29, 42, 53, 0.98), rgba(47, 111, 115, 0.88)),
    var(--primary);
  color: white;
  padding: clamp(26px, 4vw, 38px);
  box-shadow: var(--shadow);
}

.hero-panel h2 {
  margin: 0 0 12px;
  font-size: clamp(34px, 4.8vw, 54px);
  line-height: 1.05;
  letter-spacing: 0;
}

.hero-panel p {
  max-width: 720px;
  margin: 0;
  color: rgba(255, 255, 255, 0.72);
}

.hero-logo-card {
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  padding: 18px;
}

.hero-logo-card img {
  width: 104px;
  height: 104px;
  object-fit: contain;
  border-radius: 16px;
  background: white;
  padding: 10px;
}

.hero-logo-card span {
  margin-top: 14px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.home-search-box,
.content-tools {
  display: flex;
  gap: 10px;
  margin: 18px 0;
}

.home-search-input,
.search-input {
  flex: 1;
  min-width: 0;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: none;
  background: rgba(255, 255, 255, 0.88);
  padding: 0 14px;
}

.notice-board,
.recipe-card,
.metric-grid div,
.sub-nav,
.empty-state {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: var(--shadow-tight);
}

.notice-board {
  position: relative;
  padding: 18px 20px;
}

.notice-board::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  border-radius: 10px 0 0 10px;
  background: var(--danger);
}

.notice-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  color: var(--danger);
  font-weight: 900;
}

.notice-title small {
  color: var(--faint);
  font-size: 12px;
}

.notice-board ul {
  margin: 12px 0 0;
  padding-left: 20px;
  color: var(--muted);
  font-size: 14px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 14px;
}

.metric-grid div {
  padding: 17px 18px;
}

.metric-grid strong {
  display: block;
  color: var(--primary);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 30px;
  line-height: 1;
}

.metric-grid span {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-size: 13px;
}

.menu-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(142px, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.menu-card {
  min-height: 138px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(250, 248, 243, 0.94)),
    white;
  text-align: left;
  padding: 16px;
  box-shadow: var(--shadow-tight);
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    border-color 160ms ease;
}

.menu-card:hover {
  transform: translateY(-2px);
  border-color: rgba(47, 111, 115, 0.38);
  box-shadow: var(--shadow);
}

.menu-icon {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #f7f4ee;
  font-size: 20px;
  filter: grayscale(0.55);
}

.menu-title {
  margin-top: 16px;
  color: var(--primary);
  font-size: 16px;
  font-weight: 900;
}

.menu-desc {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
}

.content-container {
  display: grid;
  gap: 28px;
}

.category-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 12px;
  color: var(--primary);
  font-size: 24px;
  letter-spacing: 0;
}

.category-title::before {
  content: "";
  width: 4px;
  height: 24px;
  border-radius: 999px;
  background: var(--accent);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(318px, 1fr));
  gap: 12px;
}

.recipe-card {
  display: flex;
  flex-direction: column;
  min-height: 166px;
  overflow: hidden;
  padding: 17px;
  border-top: 0;
  border-left: 4px solid var(--accent);
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    border-color 160ms ease;
}

.recipe-card:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.recipe-name {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 11px;
  color: var(--primary);
  font-size: 17px;
  font-weight: 900;
  line-height: 1.32;
}

.note-box {
  margin-bottom: 11px;
  border-left: 3px solid #d6a743;
  border-radius: 7px;
  background: var(--note-bg);
  color: var(--note-ink);
  padding: 9px 10px;
  font-size: 12px;
}

.recipe-content {
  color: #3e4852;
  font-size: 14px;
  line-height: 1.72;
}

.recipe-content strong {
  display: block;
  margin: 11px 0 5px;
  color: var(--primary);
}

.recipe-content ul,
.recipe-content ol {
  margin: 7px 0;
  padding-left: 21px;
}

.recipe-content li + li {
  margin-top: 3px;
}

.symbol {
  color: var(--accent-2);
  font-weight: 900;
  margin: 0 4px;
}

.script-box {
  border-left: 3px solid var(--promo);
  border-radius: 8px;
  background: #fbefd8;
  color: #684613;
  padding: 11px;
}

.accordion-card {
  cursor: pointer;
}

.accordion-content {
  display: none;
}

.accordion-card.active .accordion-content {
  display: block;
  animation: fadeIn 180ms ease;
}

.accordion-arrow {
  color: var(--muted);
  transition: transform 180ms ease;
}

.accordion-card.active .accordion-arrow {
  transform: rotate(180deg);
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.sub-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 18px;
  padding: 10px;
}

.sub-nav a {
  border: 1px solid transparent;
  border-radius: 8px;
  background: #f7f4ee;
  color: var(--primary);
  padding: 7px 11px;
  text-decoration: none;
  font-size: 12px;
  font-weight: 800;
}

.sub-nav a.active,
.sub-nav a:hover {
  border-color: rgba(47, 111, 115, 0.22);
  background: rgba(47, 111, 115, 0.11);
  color: var(--accent);
}

.empty-state {
  padding: 26px;
  color: var(--muted);
  text-align: center;
}

#backToTop {
  display: none;
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 20;
  width: 46px;
  height: 46px;
  background: var(--primary);
  color: white;
  font-size: 18px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 30;
  transform: translate(-50%, 12px);
  opacity: 0;
  pointer-events: none;
  border-radius: 999px;
  background: var(--primary);
  color: white;
  padding: 10px 16px;
  transition:
    opacity 180ms ease,
    transform 180ms ease;
}

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

@media (max-width: 1100px) {
  .app-view {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 40;
    width: min(312px, 84vw);
    transform: translateX(-102%);
    transition: transform 180ms ease;
  }

  body.nav-open .sidebar {
    transform: translateX(0);
  }

  .icon-btn {
    display: inline-grid;
    place-items: center;
  }

  .menu-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hero-panel {
    grid-template-columns: 1fr;
  }

  .hero-logo-card {
    display: none;
  }
}

@media (max-width: 680px) {
  .login-shell {
    grid-template-columns: 1fr;
  }

  .login-brand,
  .login-box {
    min-height: auto;
  }

  .login-brand {
    padding: 28px;
  }

  .login-brand h1 {
    font-size: 36px;
  }

  .workspace {
    padding: 14px;
  }

  .topbar {
    margin: -14px -14px 14px;
    padding: 10px 14px;
  }

  .topbar h1 {
    font-size: 18px;
  }

  .home-search-box,
  .content-tools {
    flex-direction: column;
  }

  .metric-grid,
  .menu-grid {
    grid-template-columns: 1fr;
  }

  .grid {
    grid-template-columns: 1fr;
  }
}

@media print {
  .login-view,
  .sidebar,
  .topbar,
  .content-tools,
  .sub-nav,
  #backToTop,
  .toast {
    display: none !important;
  }

  .app-view {
    display: block;
  }

  body {
    background: white;
  }

  .recipe-card {
    break-inside: avoid;
    box-shadow: none;
  }

  .accordion-content {
    display: block !important;
  }
}
