/* =====================================================
 * 书月记 H5 样式（粉色主题）
 * ===================================================== */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: #FFF5F5;
  color: #333;
}

.hidden { display: none !important; }

/* ---------------- 视图容器 ---------------- */
.view {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  background: #FFF5F5;
}

/* ---------------- 顶部栏 ---------------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 48px;
  padding: 0 14px;
  background: #FFFFFF;
  border-bottom: 1px solid #FFE3E8;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(255, 107, 138, 0.06);
  z-index: 5;
}
.topbar-title { font-size: 17px; font-weight: 700; color: #FF6B8A; }
.topbar-role { font-size: 12px; color: #B0B0B0; }
.topbar-back {
  font-size: 26px; line-height: 1; color: #FF6B8A; width: 28px; cursor: pointer;
  padding-bottom: 4px;
}

/* ---------------- 登录页 ---------------- */
#view-login { justify-content: center; align-items: center; background: linear-gradient(160deg, #FFE3EC, #FFF5F5 60%, #FFE3EC); }
.login-wrap { width: 84%; max-width: 360px; text-align: center; }
.login-logo { font-size: 64px; margin-bottom: 8px; }
.login-title { font-size: 30px; font-weight: 800; color: #FF6B8A; letter-spacing: 6px; }
.login-sub { font-size: 13px; color: #C08A9A; margin: 6px 0 30px; }
.login-input {
  width: 100%; height: 50px; font-size: 22px; letter-spacing: 8px; text-align: center;
  border: 2px solid #FFD4DC; border-radius: 25px; outline: none; background: #FFF;
  color: #333;
}
.login-input:focus { border-color: #FF6B8A; }
.login-btn {
  width: 100%; height: 50px; margin-top: 18px; font-size: 17px; font-weight: 700;
  color: #fff; background: linear-gradient(135deg, #FF6B8A, #FF8FA8);
  border: none; border-radius: 25px; cursor: pointer; letter-spacing: 4px;
  box-shadow: 0 6px 16px rgba(255, 107, 138, 0.35);
}
.login-btn:active { opacity: 0.85; }
.login-hint { font-size: 12px; color: #C08A9A; margin-top: 16px; }
.login-error { font-size: 13px; color: #E5484D; margin-top: 10px; min-height: 18px; }

/* ---------------- 首页卡片 ---------------- */
.home-body { flex: 1; overflow-y: auto; padding: 20px 18px 60px; }
.home-card {
  background: #FFF; border-radius: 20px; padding: 26px 20px; margin-bottom: 16px;
  display: flex; flex-direction: column; align-items: center;
  box-shadow: 0 6px 20px rgba(255, 107, 138, 0.10);
  cursor: pointer; border: 1px solid #FFE3E8;
}
.home-card:active { transform: scale(0.98); }
.home-card-icon { font-size: 44px; }
.home-card-title { font-size: 20px; font-weight: 700; color: #FF6B8A; margin-top: 8px; }
.home-card-sub { font-size: 13px; color: #B0B0B0; margin-top: 4px; }
.logout-btn {
  width: 100%; height: 44px; margin-top: 20px; font-size: 14px; color: #C08A9A;
  background: transparent; border: 1px solid #FFD4DC; border-radius: 22px; cursor: pointer;
}

/* ---------------- 我要点新菜 ---------------- */
.request-bar { padding: 10px 12px; background: #FFF; border-bottom: 1px solid #FFE3E8; flex-shrink: 0; }
.request-input {
  width: 100%; height: 42px; padding: 0 14px; font-size: 14px; border: 1.5px solid #FFD4DC;
  border-radius: 21px; outline: none; background: #FFF5F5; color: #333;
}
.request-input:focus { border-color: #FF6B8A; background: #FFF; }
.request-btn {
  width: 100%; height: 42px; margin-top: 8px; font-size: 15px; font-weight: 700;
  color: #fff; background: linear-gradient(135deg, #FF6B8A, #FF8FA8);
  border: none; border-radius: 21px; cursor: pointer;
}
.request-btn:active { opacity: 0.85; }

/* ---------------- 点菜主区 ---------------- */
.order-main { flex: 1; display: flex; overflow: hidden; min-height: 0; }

.order-sidebar {
  width: 92px; background: #FFF; flex-shrink: 0; overflow-y: auto;
  border-right: 1px solid #FFE3E8;
}
.sidebar-item {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 16px 6px; cursor: pointer; border-right: 3px solid transparent;
}
.sidebar-item.active { background: #FFF0F3; border-right-color: #FF6B8A; }
.sidebar-icon { font-size: 22px; }
.sidebar-name { font-size: 12px; color: #888; margin-top: 4px; }
.sidebar-item.active .sidebar-name { color: #FF6B8A; font-weight: 700; }

.order-dishlist { flex: 1; overflow-y: auto; padding: 12px 10px 90px; }

/* 菜品卡片（左侧小图 + 右侧信息 + 点菜按钮） */
.dish-card {
  display: flex; align-items: center; gap: 12px;
  background: #FFF; border-radius: 14px; padding: 10px 12px; margin-bottom: 10px;
  box-shadow: 0 2px 8px rgba(255, 107, 138, 0.08); border: 1px solid #FFECEF;
}
.dish-info { flex: 1; min-width: 0; }
.dish-img-wrap { position: relative; width: 64px; height: 64px; border-radius: 10px; overflow: hidden; background: #FFF5F5; flex-shrink: 0; }
.dish-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.dish-emoji-ph { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 28px; }
.dish-name { font-size: 15px; font-weight: 600; color: #333; }
.dish-cat { font-size: 11px; color: #C0A0A8; }
.dish-btn-row { display: flex; justify-content: flex-end; }
.dish-add-btn {
  min-width: 96px; height: 34px; font-size: 13px; font-weight: 700; color: #fff;
  background: linear-gradient(135deg, #FF6B8A, #FF8FA8); border: none; border-radius: 17px;
  cursor: pointer; padding: 0 14px;
}
.dish-add-btn:active { opacity: 0.85; }
.dish-add-btn.disabled { background: #F0F0F0; color: #BBB; cursor: not-allowed; }

/* 空状态 */
.empty-state { text-align: center; padding: 50px 0; color: #C0A0A8; }
.empty-state .icon { font-size: 42px; display: block; margin-bottom: 10px; }
.empty-state .text { font-size: 14px; color: #888; }
.empty-state .sub { font-size: 12px; color: #C0A0A8; margin-top: 4px; }

/* ---------------- 购物车 ---------------- */
.cart-bar {
  position: absolute; left: 0; right: 0; bottom: 0; height: 56px;
  background: #FFF; border-top: 1px solid #FFE3E8; display: flex; align-items: center;
  padding: 0 12px 0 16px; cursor: pointer; z-index: 6;
  box-shadow: 0 -4px 12px rgba(255, 107, 138, 0.08);
}
.cart-icon { font-size: 24px; }
.cart-info { flex: 1; font-size: 13px; color: #888; margin-left: 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cart-badge {
  min-width: 22px; height: 22px; line-height: 22px; text-align: center; font-size: 12px;
  color: #fff; background: #FF6B8A; border-radius: 11px; padding: 0 6px; margin-right: 10px;
}
.cart-submit {
  height: 40px; line-height: 40px; padding: 0 22px; font-size: 14px; font-weight: 700;
  color: #fff; background: linear-gradient(135deg, #FF6B8A, #FF8FA8);
  border-radius: 20px; cursor: pointer;
}

.cart-panel {
  position: absolute; left: 0; right: 0; bottom: 56px; max-height: 55%;
  background: #FFF; border-radius: 18px 18px 0 0; overflow: hidden; z-index: 6;
  display: flex; flex-direction: column; box-shadow: 0 -8px 24px rgba(255, 107, 138, 0.15);
}
.cart-panel-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 16px; font-size: 15px; font-weight: 700; color: #333;
  border-bottom: 1px solid #FFF0F3;
}
.cart-clear { font-size: 13px; color: #C08A9A; cursor: pointer; }
.cart-items { overflow-y: auto; padding: 4px 16px; }
.cart-item { display: flex; align-items: center; padding: 12px 0; border-bottom: 1px solid #FFF5F5; }
.cart-item-emoji { font-size: 22px; margin-right: 10px; }
.cart-item-name { flex: 1; font-size: 14px; color: #333; }
.cart-item-cat { font-size: 11px; color: #C0A0A8; margin-right: 8px; }
.cart-item-del {
  width: 26px; height: 26px; line-height: 24px; text-align: center; border-radius: 50%;
  background: #FFF0F3; color: #FF6B8A; font-size: 14px; cursor: pointer;
}
.cart-panel-submit {
  margin: 12px 16px 16px; height: 46px; font-size: 15px; font-weight: 700; color: #fff;
  background: linear-gradient(135deg, #FF6B8A, #FF8FA8); border: none; border-radius: 23px;
  cursor: pointer; flex-shrink: 0;
}

/* ---------------- 经期 ---------------- */
.period-body { flex: 1; overflow-y: auto; padding: 16px; }
.period-status-card {
  background: linear-gradient(135deg, #FF6B8A, #FF9FB4); border-radius: 18px;
  padding: 22px 20px; color: #FFF; box-shadow: 0 8px 24px rgba(255, 107, 138, 0.25);
}
.period-status-main { font-size: 30px; font-weight: 800; margin: 6px 0; }
.period-status-sub { font-size: 14px; opacity: 0.95; }
.period-status-label { font-size: 13px; opacity: 0.85; }
.period-record-btn {
  width: 100%; height: 48px; margin-top: 16px; font-size: 15px; font-weight: 700;
  color: #FF6B8A; background: #FFF; border: 1.5px solid #FFD4DC; border-radius: 24px;
  cursor: pointer;
}
.period-record-btn:active { background: #FFF0F3; }
.period-input-row { display: flex; gap: 10px; margin-top: 16px; }
.period-date-input { flex: 1; height: 48px; padding: 0 12px; font-size: 14px; border: 1.5px solid #FFD4DC; border-radius: 24px; outline: none; background: #FFF; }
.period-date-input:focus { border-color: #FF6B8A; }
.period-history-title { font-size: 14px; font-weight: 700; color: #888; margin: 22px 0 10px; }
.period-history { padding-bottom: 30px; }
.period-history-item {
  display: flex; align-items: center; justify-content: space-between;
  background: #FFF; border-radius: 12px; padding: 12px 16px; margin-bottom: 8px;
  border: 1px solid #FFECEF;
}
.period-history-date { font-size: 14px; color: #333; }
.period-history-meta { font-size: 12px; color: #C0A0A8; }
.period-history-del { color: #E5484D; font-size: 13px; cursor: pointer; }

/* ---------------- 男友 · 菜单管理 ---------------- */
.manage-body { flex: 1; overflow-y: auto; padding: 12px; padding-bottom: 40px; }

.db-error {
  background: #FFF1F0; border: 1px solid #FFA39E; color: #CF1322; font-size: 12px;
  border-radius: 10px; padding: 10px 12px; margin-bottom: 12px;
}

.notice-bar {
  display: flex; align-items: center; padding: 12px 14px; border-radius: 12px;
  font-size: 13px; cursor: pointer; margin-bottom: 10px;
}
.notice-blue { background: linear-gradient(135deg, #F0F5FF, #F5F8FF); border: 1px solid #91CAFF; color: #1890FF; }
.notice-yellow { background: linear-gradient(135deg, #FFF7E6, #FFFBE6); border: 1px solid #FFD591; color: #D48806; }
.notice-bar b { margin: 0 3px; }

.notice-panel {
  background: #FFF; border-radius: 12px; margin-bottom: 12px; overflow: hidden;
  border: 1px solid #FFECEF;
}
.notice-panel-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 14px; font-size: 14px; font-weight: 700; color: #333;
  border-bottom: 1px solid #FFF0F3;
}
.notice-all-done { font-size: 12px; color: #FF6B8A; cursor: pointer; font-weight: 600; }
.notice-panel-body { padding: 0 14px; }
.notice-item {
  display: flex; align-items: center; padding: 12px 0; border-bottom: 1px solid #FFF5F5;
}
.notice-item:last-child { border-bottom: none; }
.notice-item-name { flex: 1; font-size: 14px; color: #333; }
.notice-item-btn {
  height: 30px; line-height: 30px; padding: 0 14px; font-size: 12px; font-weight: 700;
  color: #fff; background: linear-gradient(135deg, #52C41A, #73D13D);
  border: none; border-radius: 15px; cursor: pointer;
}
.notice-item-btn.blue { background: linear-gradient(135deg, #1890FF, #40A9FF); }

.add-form {
  display: flex; gap: 12px; background: #FFF; border-radius: 14px; padding: 14px;
  margin-bottom: 12px; border: 1px solid #FFECEF; box-shadow: 0 2px 8px rgba(255,107,138,0.06);
}
.add-image-box {
  width: 76px; height: 76px; border-radius: 12px; overflow: hidden; flex-shrink: 0;
  background: #FFF5F5; display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.add-image-preview { width: 100%; height: 100%; object-fit: cover; }
.add-image-placeholder { text-align: center; font-size: 24px; }
.add-image-text { display: block; font-size: 10px; color: #B0B0B0; margin-top: 2px; }
.add-form-right { flex: 1; display: flex; flex-direction: column; gap: 10px; }
.add-input {
  height: 42px; padding: 0 14px; font-size: 14px; border: 1.5px solid #FFD4DC;
  border-radius: 21px; outline: none; background: #FFF5F5; color: #333;
}
.add-input:focus { border-color: #FF6B8A; background: #FFF; }
.add-btn {
  height: 42px; font-size: 14px; font-weight: 700; color: #fff;
  background: linear-gradient(135deg, #FF6B8A, #FF8FA8); border: none; border-radius: 21px; cursor: pointer;
}
.add-btn:active { opacity: 0.85; }

.cat-chips { display: flex; gap: 8px; margin-bottom: 12px; overflow-x: auto; }
.cat-chip {
  flex-shrink: 0; padding: 8px 16px; font-size: 13px; color: #888;
  background: #FFF; border: 1px solid #FFE3E8; border-radius: 18px; cursor: pointer;
}
.cat-chip.active { background: #FFF0F3; border-color: #FF6B8A; color: #FF6B8A; font-weight: 700; }

.manage-dishlist { padding-bottom: 20px; }
.manage-dish-row {
  display: flex; align-items: center; background: #FFF; border-radius: 12px;
  padding: 10px 12px; margin-bottom: 8px; border: 1px solid #FFECEF;
}
.manage-dish-img { width: 52px; height: 52px; border-radius: 8px; object-fit: cover; flex-shrink: 0; background: #FFF5F5; }
.manage-dish-emoji {
  width: 52px; height: 52px; border-radius: 8px; background: #FFF5F5; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 26px;
}
.manage-dish-name { flex: 1; font-size: 14px; color: #333; margin-left: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.manage-dish-del {
  padding: 6px 12px; font-size: 12px; color: #B0B0B0; background: #F5F5F5;
  border: none; border-radius: 15px; cursor: pointer; flex-shrink: 0;
}
.manage-dish-del:active { background: #FF4D4F; color: #FFF; }

/* ---------------- Toast ---------------- */
.toast {
  position: fixed; left: 50%; bottom: 15%; transform: translateX(-50%);
  background: rgba(0,0,0,0.75); color: #FFF; font-size: 14px; padding: 12px 22px;
  border-radius: 22px; z-index: 99; white-space: nowrap; max-width: 80%;
}
