/* 今天午饭吃什么 - 响应式样式 */
* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #FFF8F0;
  --card: #FFFFFF;
  --text: #2B2B2B;
  --text-2: #8A8378;
  --border: #F0E7DA;
  --accent: #F08A24;
  --accent-dark: #D9740F;
  --accent-soft: #FDEDDB;
  --green: #2E9E5B;
  --green-soft: #E3F5EA;
  --red: #D64545;
  --red-soft: #FBEAEA;
  --blue: #4A6FA5;
  --blue-soft: #E9EFF8;
  --radius: 16px;
  --shadow: 0 2px 10px rgba(180, 140, 90, 0.08);
}

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Segoe UI", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

#app { max-width: 680px; margin: 0 auto; padding: 0 14px 60px; }

.hidden { display: none !important; }

/* ---------- 门禁 ---------- */
.screen { padding-top: 3.3vh; }

.login-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 32px 24px;
  text-align: center;
  margin-top: 8vh;
}

.login-icon {
  width: 64px; height: 64px;
  margin: 0 auto 14px;
  border-radius: 50%;
  background: linear-gradient(135deg, #F7B267, var(--accent));
  position: relative;
}
.login-icon::after {
  content: "";
  position: absolute; left: 50%; top: 50%;
  width: 22px; height: 22px;
  border: 3px solid #fff;
  border-top-color: transparent;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  animation: spin 3s linear infinite;
}
@keyframes spin { to { transform: translate(-50%, -50%) rotate(360deg); } }

.login-card h1 { font-size: 24px; font-weight: 700; }
.sub { color: var(--text-2); font-size: 14px; margin: 6px 0 18px; }

.login-card input {
  width: 100%;
  padding: 12px 14px;
  font-size: 16px;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  background: #FFFDF9;
  outline: none;
  text-align: center;
  letter-spacing: 2px;
}
.login-card input:focus { border-color: var(--accent); }

.primary-btn {
  width: 100%;
  margin-top: 14px;
  padding: 13px;
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  background: var(--accent);
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: background .15s, transform .1s;
}
.primary-btn:hover { background: var(--accent-dark); }
.primary-btn:active { transform: scale(0.98); }
.primary-btn:disabled { background: #D9C9B4; cursor: not-allowed; }
.primary-btn.big { font-size: 18px; padding: 16px; border-radius: 14px; }

.error-msg { color: var(--red); font-size: 13px; margin-top: 10px; min-height: 18px; }

/* ---------- 顶栏与标签 ---------- */
.clock {
  text-align: center;
  font-size: 22px;
  font-weight: 500;
  color: #ddb991;
  padding: 1px 0;
  letter-spacing: 1px;
}

.topbar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 9px 10px;
}
.brand { font-size: 18px; font-weight: 700; }
.user-info { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.note-label { color: var(--text-2); }

.badge {
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}
.badge.admin { background: var(--blue-soft); color: var(--blue); }
.badge.member { background: var(--accent-soft); color: var(--accent-dark); }

.link-btn {
  background: none; border: none; color: var(--text-2);
  font-size: 13px; cursor: pointer; padding: 4px;
}
.link-btn:hover { color: var(--red); }

.tabs {
  display: flex; gap: 6px;
  background: #F6EDE1;
  padding: 5px;
  border-radius: 14px;
  margin: 6px 0 16px;
}
.tab {
  flex: 1;
  padding: 9px 0;
  border: none;
  background: transparent;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-2);
  cursor: pointer;
  transition: all .15s;
}
.tab.active { background: #fff; color: var(--accent-dark); box-shadow: 0 1px 4px rgba(180,140,90,.15); }

/* ---------- 卡片 ---------- */
.panel-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  margin-bottom: 14px;
}
.panel-card h3 { font-size: 15px; margin-bottom: 12px; }

/* ---------- 抽签 ---------- */
.final-card {
  background: linear-gradient(135deg, var(--accent-soft), #FFE9D2);
  border: 1.5px solid var(--accent);
  border-radius: var(--radius);
  padding: 16px;
  text-align: center;
  margin-bottom: 14px;
}
.final-card .label { font-size: 20px; color: var(--accent-dark); font-weight: 600; }
.final-card .food { font-size: 40px; font-weight: 800; margin: 4px 0 2px; }
.final-card .meta { font-size: 12px; color: var(--text-2); }
.final-card .probability {
  display: inline-block;
  margin-top: 5px;
  padding: 1px 10px;
  font-size: 13px;
  font-weight: 500;
  color: var(--accent-dark);
  background: var(--accent-soft);
  border-radius: 999px;
}
.day-item .probability {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-dark);
  margin-left: 6px;
}

.draw-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px 16px;
  text-align: center;
  margin-bottom: 14px;
}
.draw-status { font-size: 15px; min-height: 1px; margin-top:9px;}

.draw-anim {
  min-height: 84px;
  display: flex; align-items: center; justify-content: center;
  margin: 10px 0 6px;
}
.anim-name {
  font-size: 30px;
  font-weight: 800;
  color: var(--accent-dark);
  padding: 10px 24px;
  border-radius: 14px;
  background: var(--accent-soft);
}
.anim-name.final { animation: pop .5s cubic-bezier(.2, 1.6, .4, 1); }
@keyframes pop {
  0% { transform: scale(0.3); }
  60% { transform: scale(1.15); }
  100% { transform: scale(1); }
}

.plain-list { list-style: none; }
.plain-list li {
  display: flex; justify-content: space-between; align-items: center;
  padding: 9px 2px;
  border-bottom: 1px dashed var(--border);
  font-size: 14px;
}
.plain-list li:last-child { border-bottom: none; }
.plain-list .who { color: var(--text-2); font-size: 13px; }

/* ---------- 选项 ---------- */
.option-list { list-style: none; margin-bottom: 8px; }
.option-list li {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 2px;
  border-bottom: 1px dashed var(--border);
}
.option-name { font-size: 15px; font-weight: 600; }
.tag-chip {
  display: inline-block;
  margin-left: 1px;
  padding: .1px 5px;
  font-size: 10px;
  font-weight: 500;
  color: var(--blue);
  background: var(--blue-soft);
  border-radius: 999px;
}
.nominate-list { display: flex; flex-direction: column; gap: 6px; }
.nominate-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.nominate-item:hover { border-color: var(--accent); }
.nominate-item.selected { border-color: var(--accent); background: var(--accent-soft); }
.nominate-item.disabled { opacity: 0.55; cursor: not-allowed; }
.nominate-item input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--accent); cursor: pointer; }
.nominate-item .n-name { font-size: 15px; font-weight: 600; flex: 1; }
.nominate-item .nom-count {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-left: 8px;
  float: right;
}
.nominate-item .yesterday-tag {
  font-size: 12px;
  font-weight: 500;
  color: var(--accent-dark);
  margin-left: 6px;
}
.nom-chart { display: flex; flex-direction: column; gap: 11px; }
.nom-chart-row { display: flex; align-items: center; gap: 10px; }
.nom-chart-label {
  width: 145px;
  font-size: 14px;
  font-weight: 500;
  flex-shrink: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.nom-chart-bar-wrap {
  flex: 1;
  height: 22px;
  background: var(--border);
  border-radius: 11px;
  overflow: hidden;
}
.nom-chart-bar {
  height: 100%;
  background: linear-gradient(90deg, #ffa448, #f44a00);
  border-radius: 11px;
  transition: width 0.4s ease;
}
.nom-chart-count {
  width: 38px;
  text-align: right;
  font-size: 13px;
  font-weight: 500;
  color: #d88c50;
  flex-shrink: 0;
}
.option-actions { display: flex; gap: 6px; }
.icon-btn {
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 8px;
  padding: 5px 10px;
  font-size: 13px;
  cursor: pointer;
  color: var(--text-2);
}
.icon-btn:hover { border-color: var(--accent); color: var(--accent-dark); }
.icon-btn.danger:hover { border-color: var(--red); color: var(--red); }

/* ---------- 表单 ---------- */
.inline-form {
  display: flex; gap: 8px; flex-wrap: wrap;
  margin-top: 12px;
}
.inline-form input {
  flex: 1 1 140px;
  min-width: 0;
  padding: 10px 12px;
  font-size: 14px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  background: #FFFDF9;
  outline: none;
}
.inline-form input:focus { border-color: var(--accent); }
.small-btn {
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  background: var(--accent);
  border: none;
  border-radius: 10px;
  cursor: pointer;
}
.small-btn:hover { background: var(--accent-dark); }
.small-btn.danger-btn { background: var(--red); }
.small-btn.danger-btn:hover { background: #B93A3A; }

.result-line { margin-top: 10px; font-size: 14px; min-height: 20px; color: var(--text-2); }
.result-line strong { color: var(--accent-dark); }

/* ---------- 成员码 ---------- */
.code-list { list-style: none; margin-bottom: 4px; }
.code-list li {
  display: flex; justify-content: space-between; align-items: center;
  padding: 9px 2px;
  border-bottom: 1px dashed var(--border);
  font-size: 14px;
}
.code-list .code { font-family: "Consolas", monospace; font-weight: 700; letter-spacing: 1px; }
.code-list .code-note { color: var(--text-2); font-size: 13px; margin-left: 8px; }
.code-list .badge.admin { margin-left: 8px; }

/* ---------- 历史 ---------- */
.day-block { margin-bottom: 14px; }
.day-title {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 13px; font-weight: 700;
  color: var(--text-2);
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
}
.day-title .final-chip {
  color: var(--accent-dark);
  background: var(--accent-soft);
  padding: 1px 10px;
  border-radius: 999px;
  font-weight: 700;
}
.day-title .final-chip.no { color: var(--text-2); background: #F3EFE9; }
.day-item {
  display: flex; justify-content: space-between;
  font-size: 13.5px;
  padding: 5px 2px;
}
.day-item .who { color: var(--text-2); }
.day-item.final { font-weight: 700; color: var(--accent-dark); }
.empty-hint { color: var(--text-2); font-size: 13px; padding: 8px 0; }

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  left: 50%; bottom: 34px;
  transform: translateX(-50%);
  background: rgba(43, 43, 43, 0.92);
  color: #fff;
  padding: 10px 20px;
  border-radius: 999px;
  font-size: 14px;
  max-width: 86vw;
  z-index: 99;
  box-shadow: 0 4px 16px rgba(0,0,0,.2);
}

/* ---------- 移动端 ---------- */
@media (max-width: 480px) {
  #app { padding: 0 12px 48px; }
  .brand { font-size: 16px; }
  .tab { font-size: 13px; }
  .final-card .food { font-size: 35px; }
  .anim-name { font-size: 24px; }
  .inline-form input { flex: 1 1 100%; }
  .small-btn { width: 100%; }
}
