:root {
  --compose-yellow: #fdd22b;
  --compose-black: #1c1c1c;
  --bg-dark: #121212;
  --bg-elevated: #1f1f1f;
  --text-main: #f5f5f5;
  --text-muted: #a0a0a0;
  --accent: #fdd22b;
  --border-subtle: #333333;
  --radius-lg: 16px;
  --radius-md: 10px;
  --shadow-soft: 0 18px 45px rgba(0, 0, 0, 0.65);
  --transition-fast: 0.18s ease-out;
  --font-main: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui,
    sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: radial-gradient(circle at top, #383838 0, #050505 60%);
  color: var(--text-main);
  font-family: var(--font-main);
}

body {
  display: flex;
  align-items: stretch;
  justify-content: center;
}

.app-shell {
  flex: 1;
  max-width: 1440px;
  margin: 24px;
  height: calc(100vh - 48px);
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, #181818 0, #090909 40%, #151515 100%);
  box-shadow: var(--shadow-soft);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.app-header {
  height: 64px;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  background: linear-gradient(90deg, #111 0, #171717 40%, #111 100%);
}

.header-left {
  font-weight: 800;
  letter-spacing: 0.12em;
  font-size: 15px;
  color: var(--accent);
  cursor: pointer;
  text-transform: uppercase;
}

.header-left::before {
  content: '';
  display: inline-block;
  width: 16px;
  height: 16px;
  border-radius: 5px;
  margin-right: 8px;
  background: radial-gradient(circle at 30% 30%, #fff 0, #fdd22b 40%, #e0a800 100%);
  box-shadow: 0 0 16px rgba(253, 210, 43, 0.7);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.login-form {
  display: flex;
  align-items: center;
  gap: 8px;
}

.login-form input {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  color: var(--text-main);
  min-width: 110px;
}

.login-form input::placeholder {
  color: var(--text-muted);
}

.login-form input:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(253, 210, 43, 0.5);
}

.login-form button,
#logout-button,
#logout-button-schedule {
  border-radius: 999px;
  border: none;
  padding: 7px 14px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  background: var(--accent);
  color: #111;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.4), 0 8px 20px rgba(253, 210, 43, 0.35);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast),
    background var(--transition-fast);
}

.login-form button:hover,
#logout-button:hover,
#logout-button-schedule:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 26px rgba(253, 210, 43, 0.5);
}

.login-form button:active,
#logout-button:active,
#logout-button-schedule:active {
  transform: translateY(0);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.7);
}

.user-info {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--text-muted);
}

.user-info span {
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.header-nav-link {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  text-decoration: none;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.4);
  transition: background var(--transition-fast), color var(--transition-fast),
    border-color var(--transition-fast), transform var(--transition-fast);
}

.header-nav-link:hover {
  color: #111;
  background: var(--accent);
  border-color: rgba(0, 0, 0, 0.6);
  transform: translateY(-1px);
}

.header-nav-link-active {
  background: var(--accent);
  color: #111;
  border-color: rgba(0, 0, 0, 0.6);
}

.app-body {
  flex: 1;
  display: grid;
  grid-template-columns: 350px minmax(0, 1fr);
  min-height: 0;
}

.sidebar {
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  padding: 16px 14px 16px 18px;
  background: radial-gradient(circle at top left, #232323 0, #111 55%);
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.sidebar-search {
  margin-bottom: 14px;
}

.sidebar-search input {
  width: 100%;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.5);
  color: var(--text-main);
  padding: 8px 12px;
  font-size: 13px;
  outline: none;
  transition: border-color var(--transition-fast),
    box-shadow var(--transition-fast),
    background var(--transition-fast);
}

.sidebar-search input::placeholder {
  color: var(--text-muted);
}

.sidebar-search input:focus-visible {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(253, 210, 43, 0.4);
  background: rgba(0, 0, 0, 0.8);
}

.sidebar-toc {
  flex: 1;
  overflow-y: auto;
  padding-right: 6px;
}

.sidebar-section.sidebar-employees {
  margin-top: 16px;
}

.employee-list {
  list-style: none;
  margin: 4px 0 8px;
  padding: 0;
}

.employee-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  padding: 3px 6px;
}

.employee-remove {
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 11px;
}

.section-group {
  margin-bottom: 12px;
}

.section-title {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 8px 6px 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
}

.section-title-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.section-toggle-icon {
  margin-left: 6px;
  font-size: 11px;
  opacity: 0.85;
  transition: transform var(--transition-fast);
}

.section-title.collapsed .section-toggle-icon {
  transform: rotate(-90deg);
}

.recipe-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.recipe-item {
  margin: 2px 0;
}

.recipe-button {
  width: 100%;
  text-align: left;
  border-radius: 10px;
  border: none;
  padding: 6px 8px;
  font-size: 11px;
  color: var(--text-main);
  background: transparent;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background var(--transition-fast),
    transform var(--transition-fast),
    box-shadow var(--transition-fast),
    color var(--transition-fast);
}

.recipe-button-label {
  flex: 1;
  white-space: nowrap;
  overflow: visible;
  text-overflow: clip;
}

.recipe-button-meta {
  margin-left: 6px;
  font-size: 10px;
  color: var(--text-muted);
}

.recipe-button:hover {
  background: rgba(253, 210, 43, 0.12);
  transform: translateY(-1px);
}

.recipe-button.active {
  background: linear-gradient(120deg, #fdd22b 0, #ffeb9a 60%, #fdd22b 100%);
  color: #111;
  box-shadow: 0 10px 30px rgba(253, 210, 43, 0.6);
}

.recipe-button.active .recipe-button-meta {
  color: #553a00;
}

.content {
  padding: 20px 26px 24px;
  background: radial-gradient(circle at top right, #262626 0, #0b0b0b 60%);
  overflow-y: auto;
}

.content-section {
  max-width: 720px;
  margin: 0 auto;
}

.shop-meta {
  margin-bottom: 18px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 12px;
  line-height: 1.45;
}

.shop-meta-row + .shop-meta-row {
  margin-top: 4px;
}

.shop-meta-row span {
  display: block;
  max-width: 100%;
  color: rgba(245, 245, 245, 0.9);
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.content-section h1 {
  font-size: 24px;
  margin: 0 0 10px;
}

.content-section h2 {
  font-size: 18px;
  margin-top: 18px;
}

.content-section p {
  margin: 4px 0;
  line-height: 1.5;
}

.content-section hr {
  border: none;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  margin: 16px 0;
}

.hint {
  color: var(--text-muted);
  font-size: 13px;
}

.recipe-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 10px;
}

.recipe-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.recipe-tag {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: var(--text-muted);
}

.recipe-block {
  margin-bottom: 16px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.recipe-block-title {
  font-weight: 600;
  margin-bottom: 6px;
  font-size: 14px;
}

.recipe-steps {
  margin: 0;
  padding-left: 18px;
}

.recipe-steps li {
  margin: 3px 0;
  line-height: 1.5;
}

.recipe-steps li.recipe-step-language-break {
  margin-top: 1.55em;
}

.recipe-image-wrap {
  margin-top: 8px;
  display: flex;
  justify-content: center;
}

.recipe-image {
  width: 100%;
  max-width: 320px;
  height: auto;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  object-fit: contain;
  background: rgba(0, 0, 0, 0.25);
}

.notice-block {
  border-left: 3px solid var(--accent);
  padding-left: 12px;
}

.hidden {
  display: none;
}

.small-pill-button {
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 4px 10px;
  font-size: 11px;
  background: rgba(0, 0, 0, 0.4);
  color: var(--text-main);
  cursor: pointer;
  transition: background var(--transition-fast), border-color var(--transition-fast),
    transform var(--transition-fast);
}

.small-pill-button.primary {
  background: var(--accent);
  color: #111;
  border-color: rgba(0, 0, 0, 0.6);
}

.small-pill-button:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.3);
}

.schedule-scale {
  display: flex;
  align-items: center;
  margin-top: 12px;
  margin-bottom: 4px;
  font-size: 11px;
  color: var(--text-muted);
}

.schedule-scale-spacer {
  width: 120px;
}

.schedule-scale-hour {
  flex: 1;
  text-align: center;
}

.schedule-month {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 4px;
}

.schedule-day-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.schedule-day-label {
  width: 120px;
  font-size: 12px;
  white-space: nowrap;
}

.schedule-day-label-weekend {
  color: var(--accent);
}

.schedule-timeline {
  position: relative;
  flex: 1;
  height: 26px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
  overflow: hidden;
}

.schedule-shift {
  position: absolute;
  top: 2px;
  bottom: 2px;
  border-radius: 999px;
  background: rgba(253, 210, 43, 0.9);
  color: #111;
  font-size: 11px;
  padding: 0 6px;
  display: flex;
  align-items: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.day-editor {
  margin-top: 18px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.day-editor-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.day-editor-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.day-editor-table th,
.day-editor-table td {
  padding: 4px 6px;
}

.day-editor-table input,
.day-editor-table select {
  width: 100%;
  padding: 3px 6px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(0, 0, 0, 0.5);
  color: var(--text-main);
  font-size: 12px;
}

.day-editor-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 8px;
}

.pattern-editor {
  margin-top: 18px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px dashed rgba(255, 255, 255, 0.16);
  background: rgba(0, 0, 0, 0.35);
}

.pattern-editor-header {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 8px;
}

.pattern-editor-header h2 {
  font-size: 14px;
  margin: 0;
}

.pattern-editor-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  font-size: 12px;
}

.pattern-editor-row label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.pattern-weekdays {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
}

.pattern-time input {
  width: 52px;
}

@media (max-width: 960px) {
  .app-shell {
    margin: 12px;
  }
}

@media (max-width: 640px) {
  /* 让整页而不是内部容器滚动 */
  html,
  body {
    height: auto;
  }

  body {
    display: block;
  }

  .app-shell {
    margin: 0;
    height: auto;
    max-width: none;
    border-radius: 0;
    box-shadow: none;
    overflow: visible;
  }

  .app-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    height: auto;
    padding: 10px 16px;
  }

  .header-right {
    width: 100%;
    justify-content: flex-end;
  }

  .login-form input {
    min-width: 0;
    width: 90px;
  }

  .app-body {
    display: block;
  }

  .sidebar,
  .content {
    width: 95%;
    margin: 0 auto;
  }

  /* 上方列表区：固定占 75% 视口高度，内部可滚动 */
  .sidebar {
    height: 75vh;
    overflow-y: auto;
    border-right: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  }

  /* 下方配方区：固定占 95% 视口高度，由整页滚动 */
  .content {
    min-height: 95vh;
    height: auto;
    overflow: visible;
    padding: 14px 12px 16px;
  }

  .shop-meta {
    margin-bottom: 20px;
  }
}
