/* ============================================================
   Anson咖啡厅管理系统 · 视觉主题 v2 — Coffee House
   ------------------------------------------------------------
   纯展示层重设计：不改动任何功能逻辑、HTML 结构或脚本行为。
   所有组件 class 名称保持不变，仅重构样式与设计令牌。
   ============================================================ */

/* ---------------- 设计令牌 ---------------- */
:root {
  /* 咖啡色阶（Espresso → Latte） */
  --espresso-950: #211006;
  --espresso-900: #2e1a0c;
  --espresso-800: #3b2312;
  --espresso-700: #4a2e1a;
  --espresso-600: #5c3d26;
  --espresso-500: #6f4e37;
  --espresso-400: #8a6a4f;
  --espresso-300: #ab8f74;
  --espresso-200: #cdb9a3;
  --espresso-100: #e7dccd;
  --espresso-50:  #f4ede3;

  /* 焦糖点缀 */
  --caramel: #c98a3d;
  --caramel-strong: #b06e1f;
  --caramel-soft: #f8ecd9;

  /* 语义色 */
  --success: #3d8b5a;
  --success-dark: #2e6f47;
  --success-bg: #e9f4ed;
  --success-border: #c9e3d3;
  --warning: #c98a1f;
  --warning-dark: #9d6c15;
  --warning-bg: #fbf3e0;
  --warning-border: #efdfb4;
  --danger: #c0503c;
  --danger-dark: #9c3e2d;
  --danger-bg: #fbece9;
  --danger-border: #f0cdc6;

  /* 旧变量名兼容（部分页面内联样式仍引用） */
  --primary: var(--espresso-500);
  --primary-dark: var(--espresso-700);
  --primary-color: var(--espresso-500);
  --primary-light: var(--espresso-300);

  /* 背景与表面 */
  --bg: #f6f1e9;
  --bg-deep: #efe6d9;
  --card-bg: #ffffff;
  --surface: #fbf7f1;
  --surface-hover: #f4ede2;

  /* 文字 */
  --text: #33261c;
  --text-soft: #6b5846;
  --text-muted: #998575;

  /* 边框 / 阴影 / 圆角 */
  --border: #e7dccd;
  --border-strong: #d8c8b4;
  --radius: 14px;
  --radius-sm: 10px;
  --radius-lg: 22px;
  --radius-pill: 999px;
  --shadow-xs: 0 1px 2px rgba(62, 40, 24, 0.06);
  --shadow-sm: 0 2px 10px rgba(62, 40, 24, 0.07);
  --shadow: 0 8px 24px rgba(62, 40, 24, 0.10);
  --shadow-lg: 0 18px 44px rgba(62, 40, 24, 0.16);
  --ring: 0 0 0 3px rgba(201, 138, 61, 0.30);

  /* 字体 */
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI",
               "PingFang SC", "Hiragino Sans GB", "HarmonyOS Sans SC",
               "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", "Cascadia Code", Menlo, Consolas,
               "Liberation Mono", monospace;

  /* 动效 */
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --speed: 0.18s;
  --speed-slow: 0.28s;

  /* 渐变 */
  --header-grad: linear-gradient(118deg, #2e1a0c 0%, #4a2e1a 46%, #6f4e37 100%);
  --accent-grad: linear-gradient(135deg, #c98a3d 0%, #b06e1f 100%);
  --card-grad: linear-gradient(180deg, #ffffff 0%, #fdfaf6 100%);
}

/* ---------------- 基础重置 ---------------- */
* { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.65;
  color: var(--text);
  background-color: var(--bg);
  background-image:
    radial-gradient(1200px 520px at 85% -10%, rgba(201, 138, 61, 0.10), transparent 60%),
    radial-gradient(900px 480px at -10% 20%, rgba(111, 78, 55, 0.08), transparent 55%);
  background-attachment: fixed;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: rgba(201, 138, 61, 0.32); color: var(--espresso-900); }

/* 滚动条 */
* { scrollbar-width: thin; scrollbar-color: var(--espresso-200) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
  background: var(--espresso-200);
  border-radius: var(--radius-pill);
  border: 2px solid transparent;
  background-clip: content-box;
}
*::-webkit-scrollbar-thumb:hover { background-color: var(--espresso-300); }

/* 可见焦点 */
:focus-visible {
  outline: none;
  box-shadow: var(--ring);
  border-radius: 6px;
}

a { color: var(--espresso-500); }

.container { max-width: 1100px; margin: 0 auto; padding: 0 1.5rem; }

/* ---------------- 顶部导航 ---------------- */
.header {
  background: var(--header-grad);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow);
  border-bottom: 3px solid transparent;
  border-image: linear-gradient(90deg, var(--caramel), var(--espresso-300) 40%, transparent) 1;
}

/* 第一行：品牌 + 员工信息 */
.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  padding-top: 0.85rem;
  padding-bottom: 0.55rem;
}

.logo {
  flex: 0 0 auto;
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}

.logo::before {
  content: "☕";
  font-size: 1.15em;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.3));
}

/* 第二行：导航菜单（居中、与品牌行同宽，放不下自动居中换行，全部可见） */
.nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0.35rem 1.5rem 0.85rem;
}

.nav-link {
  color: rgba(255, 255, 255, 0.88);
  text-decoration: none;
  padding: 0.48rem 0.9rem;
  border-radius: var(--radius-pill);
  font-size: 0.92rem;
  font-weight: 500;
  border: 1px solid rgba(255, 255, 255, 0.18);
  transition: background var(--speed) var(--ease), color var(--speed) var(--ease),
              border-color var(--speed) var(--ease), transform var(--speed) var(--ease);
  white-space: nowrap;
  position: relative;
}

.nav-link:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.35);
  color: #fff;
  transform: translateY(-1px);
}

.nav-link.active {
  background: #fff;
  color: var(--espresso-700);
  border-color: #fff;
  font-weight: 700;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.25);
}

.nav-badge {
  display: inline-block;
  min-width: 19px;
  margin-left: 0.28rem;
  padding: 0 0.34rem;
  border-radius: var(--radius-pill);
  background: var(--accent-grad);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 19px;
  text-align: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  vertical-align: 1px;
}

.nav-link.active .nav-badge { background: var(--danger); }

/* 顶部时间条 */
.time-bar {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.84rem;
  padding: 0.42rem 0;
}

#headerTime { white-space: nowrap; font-variant-numeric: tabular-nums; }
#headerTime::before { content: "🕐 "; opacity: 0.75; }

/* 员工信息区 */
.staff-info {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex: 0 0 auto;
  white-space: nowrap;
}

.staff-name {
  color: rgba(255, 255, 255, 0.95);
  font-size: 0.92rem;
  text-decoration: none;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  transition: color var(--speed) var(--ease);
}

.staff-name::before {
  display: none;
}

.staff-name:hover { color: var(--caramel-soft); }

/* 已上传头像时隐藏默认图标，显示真实头像 */
.staff-name.with-avatar::before { display: none; }

.staff-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.4);
  flex: 0 0 auto;
  background: rgba(255, 255, 255, 0.16);
}

/* 顶栏内的员工操作按钮：半透明幽灵样式 */
.staff-info .btn-secondary {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.3);
  color: #fff;
  box-shadow: none;
}
.staff-info .btn-secondary:hover {
  background: rgba(255, 255, 255, 0.24);
  border-color: rgba(255, 255, 255, 0.5);
  color: #fff;
}

/* 顶栏通知铃铛 */
.header-bell {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  color: rgba(255, 255, 255, 0.9);
  transition: background var(--speed) var(--ease), color var(--speed) var(--ease);
}
.header-bell:hover { background: rgba(255, 255, 255, 0.16); color: #fff; }

.header-bell-badge {
  position: absolute;
  top: 0;
  right: 0;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: var(--radius-pill);
  background: var(--danger);
  color: #fff;
  font-size: 0.66rem;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* 顶栏反馈按钮（与铃铛同款） */
.header-feedback {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: rgba(255, 255, 255, 0.9);
  cursor: pointer;
  transition: background var(--speed) var(--ease), color var(--speed) var(--ease);
}
.header-feedback:hover { background: rgba(255, 255, 255, 0.16); color: #fff; }

/* 反馈列表 */
.feedback-list { display: grid; gap: 0.75rem; }

.feedback-item {
  padding: 1rem 1.1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
}

.feedback-item.is-pending { border-left: 4px solid var(--warning); }
.feedback-item.is-done { border-left: 4px solid var(--success); }

.feedback-head {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-bottom: 0.5rem;
}

.feedback-sender { font-weight: 700; color: var(--text); }
.feedback-time { color: var(--text-muted); font-size: 0.8rem; margin-left: auto; }

.feedback-content {
  color: var(--text);
  line-height: 1.6;
  white-space: pre-line;
  overflow-wrap: anywhere;
}

.feedback-reply {
  margin-top: 0.75rem;
  padding: 0.7rem 0.9rem;
  background: var(--success-bg);
  border: 1px solid var(--success-border);
  border-radius: var(--radius-sm);
  color: var(--text-soft);
  line-height: 1.55;
}

.feedback-reply-label { font-weight: 700; color: var(--success-dark); margin-bottom: 0.2rem; }

.feedback-reply-form {
  margin-top: 0.75rem;
  padding: 0.7rem 0.9rem;
  background: var(--surface);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-sm);
}

/* 通知列表 */
.notification-list { display: grid; gap: 0.65rem; }

.notification-item {
  display: block;
  padding: 0.9rem 1.05rem;
  border: 1px solid var(--border);
  border-left: 3px solid var(--caramel);
  border-radius: var(--radius-sm);
  background: #fff;
  text-decoration: none;
  color: var(--text);
  transition: border-color var(--speed) var(--ease), background var(--speed) var(--ease), box-shadow var(--speed-slow) var(--ease);
}
.notification-item:hover { border-color: var(--border-strong); background: var(--surface); box-shadow: var(--shadow-xs); }

.notification-title { font-weight: 600; color: var(--text); }
.notification-content { margin-top: 0.2rem; color: var(--text-soft); font-size: 0.9rem; }
.notification-meta { margin-top: 0.4rem; color: var(--text-muted); font-size: 0.78rem; }

/* 待办聚合 */
.todo-list { display: grid; gap: 0.55rem; }

.todo-item {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.75rem 0.95rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--text);
  transition: border-color var(--speed) var(--ease), background var(--speed) var(--ease), transform var(--speed-slow) var(--ease);
}
.todo-item:hover { border-color: var(--caramel); background: var(--caramel-soft); transform: translateY(-1px); }

.todo-emoji { font-size: 1.15rem; flex: 0 0 auto; }
.todo-text { flex: 1 1 auto; font-weight: 600; }

.todo-count {
  flex: 0 0 auto;
  padding: 0.12rem 0.6rem;
  border-radius: var(--radius-pill);
  background: var(--danger);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
}

.todo-done {
  flex: 0 0 auto;
  padding: 0.12rem 0.6rem;
  border-radius: var(--radius-pill);
  background: var(--success-bg);
  border: 1px solid var(--success-border);
  color: var(--success-dark);
  font-size: 0.78rem;
  font-weight: 600;
}

/* ---------------- 主体布局 ---------------- */
.main { padding: 2rem 1.5rem 2.5rem; }

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.page-title {
  font-size: 1.55rem;
  font-weight: 700;
  color: var(--espresso-700);
  letter-spacing: 0.01em;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
}

.page-title::before {
  content: "";
  width: 5px;
  height: 1.35em;
  border-radius: var(--radius-pill);
  background: var(--accent-grad);
}

.page-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* ---------------- 卡片 ---------------- */
.card {
  background: var(--card-grad);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.5rem;
  transition: box-shadow var(--speed-slow) var(--ease), transform var(--speed-slow) var(--ease), border-color var(--speed) var(--ease);
}

.card h3 { margin-bottom: 1rem; color: var(--espresso-700); font-size: 1.08rem; font-weight: 600; }
.card h4 { color: var(--text-soft); font-size: 1rem; }

.card:hover { border-color: var(--border-strong); }

/* ---------------- 统计卡片 ---------------- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  position: relative;
  background: var(--card-grad);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.4rem 1.25rem 1.2rem;
  text-align: center;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: transform var(--speed-slow) var(--ease), box-shadow var(--speed-slow) var(--ease), border-color var(--speed) var(--ease);
}

.stat-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: var(--accent-grad);
}

.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
  border-color: var(--border-strong);
}

.stat-card.small { padding: 1rem; }

.stat-value {
  font-size: 1.85rem;
  font-weight: 800;
  color: var(--espresso-600);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
  line-height: 1.2;
}

.stat-label { color: var(--text-muted); font-size: 0.88rem; margin-top: 0.3rem; font-weight: 500; }

.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
}

/* 公告已读/未读统计卡（覆盖顶条颜色） */
.announcement-read-summary .read-stat::before { background: linear-gradient(90deg, var(--success), #67b184); }
.announcement-read-summary .read-stat .stat-value { color: var(--success-dark); }
.announcement-read-summary .unread-stat::before { background: linear-gradient(90deg, var(--warning), #e0b052); }
.announcement-read-summary .unread-stat .stat-value { color: var(--warning-dark); }

/* ---------------- 表格 ---------------- */
.table { width: 100%; border-collapse: collapse; }

.table th, .table td {
  padding: 0.78rem 0.85rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.table th {
  background: var(--surface);
  font-weight: 600;
  color: var(--espresso-600);
  font-size: 0.84rem;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.table tbody tr { transition: background var(--speed) var(--ease); }
.table tbody tr:hover { background: var(--surface); }

.table tbody tr:last-child td { border-bottom: none; }

.table-sm th, .table-sm td { padding: 0.5rem 0.6rem; font-size: 0.9rem; }

.members-table th, .members-table td { white-space: nowrap; }

.table a:not(.btn) { color: var(--espresso-500); text-decoration: none; font-weight: 500; }
.table a:not(.btn):hover { color: var(--caramel-strong); text-decoration: underline; }

.member-note-cell {
  max-width: 220px;
  color: var(--text-muted);
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.log-meta-cell {
  max-width: 300px;
  color: var(--text-muted);
  font-size: 0.9rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.log-meta-cell:hover {
  max-width: 520px;
  color: var(--text);
  overflow: visible;
  white-space: normal;
}

.actions a { margin-right: 0.75rem; font-size: 0.9rem; }

.inline-reset-form {
  display: flex;
  gap: 0.4rem;
  align-items: center;
  flex-wrap: wrap;
}

.inline-reset-form input {
  width: 110px;
  padding: 0.35rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
}

/* 数据表（财务等） */
.data-table { width: 100%; border-collapse: collapse; }

.data-table th, .data-table td {
  padding: 0.78rem 0.85rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.data-table th {
  background: var(--surface);
  font-weight: 600;
  color: var(--espresso-600);
  font-size: 0.84rem;
  white-space: nowrap;
}

.data-table tbody tr:hover { background: var(--surface); }

/* 设备表 */
.devices-table th, .devices-table td {
  padding: 1rem 1.25rem;
  line-height: 1.55;
  vertical-align: middle;
}

.devices-table .badge { display: inline-block; margin: 0.15rem 0; }
.devices-table th, .devices-table td { white-space: nowrap; }

.devices-table .log-meta-cell {
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.devices-table .log-meta-cell:hover {
  max-width: 720px;
  overflow: visible;
  white-space: normal;
}

.devices-table-wrap { overflow-x: visible; }

.devices-table { width: 100%; table-layout: fixed; }
.devices-table th, .devices-table td { overflow: hidden; text-overflow: ellipsis; }

.devices-table-admin th:nth-child(1), .devices-table-admin td:nth-child(1) { width: 9%; }
.devices-table-admin th:nth-child(2), .devices-table-admin td:nth-child(2) { width: 10%; }
.devices-table-admin th:nth-child(3), .devices-table-admin td:nth-child(3) { width: 8%; }
.devices-table-admin th:nth-child(4), .devices-table-admin td:nth-child(4) { width: 12%; }
.devices-table-admin th:nth-child(5), .devices-table-admin td:nth-child(5) { width: 11%; }
.devices-table-admin th:nth-child(6), .devices-table-admin td:nth-child(6) { width: 15%; }
.devices-table-admin th:nth-child(7), .devices-table-admin td:nth-child(7) { width: 15%; }
.devices-table-admin th:nth-child(8), .devices-table-admin td:nth-child(8) { width: 20%; }

.devices-table-own th:nth-child(1), .devices-table-own td:nth-child(1) { width: 16%; }
.devices-table-own th:nth-child(2), .devices-table-own td:nth-child(2) { width: 14%; }
.devices-table-own th:nth-child(3), .devices-table-own td:nth-child(3) { width: 21%; }
.devices-table-own th:nth-child(4), .devices-table-own td:nth-child(4) { width: 21%; }
.devices-table-own th:nth-child(5), .devices-table-own td:nth-child(5) { width: 28%; }

.table-responsive { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table-scroll { overflow-x: auto; }
.table-scroll .table { min-width: 860px; }

.nowrap-cell { white-space: nowrap; }

/* ---------------- 表单 ---------------- */
.form-card { max-width: 600px; }

.form-group { margin-bottom: 1.25rem; }

.form-group label {
  display: block;
  margin-bottom: 0.45rem;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-soft);
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.62rem 0.85rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-size: 0.98rem;
  font-family: inherit;
  color: var(--text);
  background: #fff;
  transition: border-color var(--speed) var(--ease), box-shadow var(--speed) var(--ease), background var(--speed) var(--ease);
}

.form-group input::placeholder, .form-group textarea::placeholder { color: var(--text-muted); opacity: 0.8; }

.form-group input:hover, .form-group select:hover, .form-group textarea:hover {
  border-color: var(--espresso-400);
}

.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  outline: none;
  border-color: var(--caramel);
  box-shadow: var(--ring);
  background: #fffefc;
}

.form-group textarea { resize: vertical; min-height: 88px; }

.form-group input:disabled { background: var(--surface); color: var(--text-muted); cursor: not-allowed; }

.form-actions { display: flex; gap: 0.75rem; margin-top: 1.5rem; }

.required { color: var(--danger); font-weight: 600; }

/* 单选项组 */
.radio-group { display: flex; gap: 1rem; flex-wrap: wrap; }

.radio-item {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  padding: 0.55rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  transition: border-color var(--speed) var(--ease), background var(--speed) var(--ease), box-shadow var(--speed) var(--ease);
}

.radio-item:hover { border-color: var(--espresso-300); background: var(--surface); }

.radio-item:has(input:checked) {
  border-color: var(--caramel);
  background: var(--caramel-soft);
  box-shadow: 0 0 0 1px var(--caramel) inset;
}

.radio-item input[type="radio"], .radio-item input[type="checkbox"] {
  width: 16px; height: 16px;
  accent-color: var(--caramel);
}

.radio-item span { font-size: 0.92rem; font-weight: 500; }

/* 消费支付选项 */
.external-payment-option, .balance-payment-option { min-height: 42px; }

/* 勾选行 */
.checkbox-line {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0.85rem 0;
  padding: 0.65rem 0.9rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color var(--speed) var(--ease), background var(--speed) var(--ease);
}

.checkbox-line:hover { border-color: var(--espresso-300); }
.checkbox-line:has(input:checked) { border-color: var(--caramel); background: var(--caramel-soft); }
.checkbox-line input { width: 17px; height: 17px; accent-color: var(--caramel); }
.checkbox-line label { cursor: pointer; font-weight: 500; font-size: 0.94rem; }

.checkbox-label { display: inline-flex; align-items: center; gap: 0.45rem; cursor: pointer; font-weight: 500; font-size: 0.94rem; }
.checkbox-label input { width: 16px; height: 16px; accent-color: var(--caramel); }

/* ---------------- 搜索 ---------------- */
.search-bar {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.search-bar input {
  flex: 1; min-width: 200px;
  padding: 0.6rem 0.85rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  transition: border-color var(--speed) var(--ease), box-shadow var(--speed) var(--ease);
}
.search-bar input:focus { outline: none; border-color: var(--caramel); box-shadow: var(--ring); }

.search-bar select {
  padding: 0.6rem 0.7rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: #fff;
  font-size: 0.95rem;
  transition: border-color var(--speed) var(--ease), box-shadow var(--speed) var(--ease);
}
.search-bar select:focus { outline: none; border-color: var(--caramel); box-shadow: var(--ring); }

.member-search { position: relative; }

.search-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  z-index: 50;
  max-height: 240px;
  overflow-y: auto;
  animation: pop-in var(--speed) var(--ease);
}

.search-item {
  padding: 0.65rem 0.85rem;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background var(--speed) var(--ease);
}
.search-item:last-child { border-bottom: none; }
.search-item:hover { background: var(--surface); }

.selected-member {
  margin-top: 0.5rem;
  padding: 0.55rem 0.85rem;
  background: var(--caramel-soft);
  border: 1px solid var(--warning-border);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  color: var(--espresso-700);
}

/* ---------------- 按钮 ---------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.58rem 1.3rem;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
  font-weight: 600;
  font-family: inherit;
  line-height: 1.4;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  white-space: nowrap;
  transition: background var(--speed) var(--ease), color var(--speed) var(--ease),
              box-shadow var(--speed) var(--ease), transform var(--speed) var(--ease),
              border-color var(--speed) var(--ease), filter var(--speed) var(--ease);
  user-select: none;
}

.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary {
  background: var(--espresso-600);
  background-image: linear-gradient(180deg, #6a4a32, #523524);
  color: #fff;
  box-shadow: 0 3px 10px rgba(74, 46, 26, 0.28);
}
.btn-primary:hover { background-image: linear-gradient(180deg, #75533a, #5c3d26); box-shadow: 0 5px 14px rgba(74, 46, 26, 0.34); }

.btn-success {
  background: var(--success);
  color: #fff;
  box-shadow: 0 3px 10px rgba(61, 139, 90, 0.28);
}
.btn-success:hover { background: var(--success-dark); }

.btn-warning {
  background: var(--accent-grad);
  color: #fff;
  box-shadow: 0 3px 10px rgba(176, 110, 31, 0.28);
}
.btn-warning:hover { filter: brightness(1.06); }

.btn-danger {
  background: var(--danger);
  color: #fff;
  box-shadow: 0 3px 10px rgba(192, 80, 60, 0.26);
}
.btn-danger:hover { background: var(--danger-dark); }

.btn-secondary {
  background: var(--surface);
  border-color: var(--border-strong);
  color: var(--text-soft);
}
.btn-secondary:hover { background: var(--surface-hover); border-color: var(--espresso-300); }

.btn-link {
  background: transparent;
  color: var(--espresso-500);
  padding: 0.55rem 0.6rem;
  border-color: transparent;
}
.btn-link:hover { background: var(--surface); color: var(--caramel-strong); }

.btn-sm { padding: 0.34rem 0.8rem; font-size: 0.82rem; border-radius: 8px; }

.btn[disabled] { opacity: 0.55; cursor: not-allowed; transform: none; box-shadow: none; }

/* ---------------- 快捷操作 ---------------- */
.quick-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.quick-actions .btn { min-height: 42px; }

/* ---------------- 公告 ---------------- */
.unread-announcement-alert {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
  padding: 0.9rem 1.1rem;
  border: 1px solid var(--danger-border);
  border-radius: var(--radius);
  background: linear-gradient(135deg, #fff7f5 0%, var(--danger-bg) 100%);
  color: var(--danger-dark);
  font-weight: 600;
  text-decoration: none;
  box-shadow: var(--shadow-sm);
  transition: transform var(--speed-slow) var(--ease), box-shadow var(--speed-slow) var(--ease);
}

.unread-announcement-alert::before { content: "🔔"; flex: 0 0 auto; }

.unread-announcement-alert:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.unread-announcement-alert:focus-visible { outline: none; box-shadow: var(--ring); }

.unread-announcement-message { flex: 1 1 auto; }

.unread-announcement-message strong {
  display: inline-block;
  min-width: 1.65rem;
  margin: 0 0.2rem;
  padding: 0.08rem 0.5rem;
  border-radius: var(--radius-pill);
  background: var(--danger);
  color: #fff;
  line-height: 1.5;
  text-align: center;
  box-shadow: 0 1px 4px rgba(192, 80, 60, 0.4);
}

.unread-announcement-action {
  flex: 0 0 auto;
  font-size: 0.85rem;
  color: var(--danger);
  white-space: nowrap;
  font-weight: 700;
}

.announcement-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.announcement-list { display: grid; gap: 0.9rem; }

.announcement-item {
  padding: 1.1rem 1.2rem;
  border: 1px solid var(--border);
  border-left: 4px solid var(--espresso-400);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow-xs);
  transition: box-shadow var(--speed-slow) var(--ease), transform var(--speed-slow) var(--ease), border-color var(--speed) var(--ease);
}

.announcement-item:hover { box-shadow: var(--shadow-sm); }

.announcement-item.is-read { border-left-color: var(--border-strong); background: var(--surface); opacity: 0.88; }

.announcement-item.is-urgent,
.announcement-item.is-urgent.is-read {
  border-color: var(--danger-border);
  border-left-color: var(--danger);
  background: linear-gradient(135deg, #fff8f6, var(--danger-bg));
}

.announcement-item.is-urgent .announcement-heading h3,
.announcement-item.is-urgent .announcement-heading h4 { color: var(--danger-dark); }

.badge-urgent {
  margin-right: 0.45rem;
  background: var(--danger);
  color: #fff;
  vertical-align: 0.08rem;
  box-shadow: 0 1px 4px rgba(192, 80, 60, 0.35);
}

.announcement-heading h3,
.announcement-heading h4 { margin-bottom: 0; color: var(--espresso-700); font-size: 1rem; font-weight: 600; }

.announcement-actions { display: flex; align-items: center; gap: 0.35rem; flex-wrap: wrap; }
.announcement-content { margin-top: 0.6rem; white-space: normal; overflow-wrap: anywhere; color: var(--text-soft); }
.announcement-meta { margin-top: 0.65rem; color: var(--text-muted); font-size: 0.8rem; }

.inline-form { display: inline; margin: 0; }

/* Markdown 渲染 */
.markdown-body > :first-child { margin-top: 0; }
.markdown-body > :last-child { margin-bottom: 0; }
.markdown-body p { margin: 0.55rem 0; white-space: pre-line; }
.markdown-body h1, .markdown-body h2, .markdown-body h3,
.markdown-body h4, .markdown-body h5, .markdown-body h6 { margin: 0.9rem 0 0.45rem; color: var(--text); font-weight: 700; line-height: 1.35; }
.markdown-body h1 { font-size: 1.45rem; }
.markdown-body h2 { font-size: 1.25rem; }
.markdown-body h3 { font-size: 1.1rem; }
.markdown-body h4, .markdown-body h5, .markdown-body h6 { font-size: 1rem; }
.markdown-body ul, .markdown-body ol { margin: 0.55rem 0; padding-left: 1.5rem; }
.markdown-body li { margin: 0.2rem 0; }
.markdown-body blockquote {
  margin: 0.65rem 0;
  padding: 0.45rem 0.9rem;
  border-left: 3px solid var(--caramel);
  background: var(--surface);
  color: var(--text-muted);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.markdown-body code {
  padding: 0.14rem 0.36rem;
  border-radius: 6px;
  background: var(--espresso-50);
  border: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 0.88em;
  color: var(--espresso-700);
}
.markdown-body pre {
  overflow-x: auto;
  padding: 0.9rem 1rem;
  border-radius: var(--radius-sm);
  background: var(--espresso-900);
  color: #f8f4ef;
  box-shadow: var(--shadow-xs);
}
.markdown-body pre code { padding: 0; background: transparent; border: none; color: inherit; }
.markdown-body a { color: var(--espresso-500); text-decoration: underline; text-underline-offset: 2px; }
.markdown-body a:hover { color: var(--caramel-strong); }

/* 公告编辑器 */
.announcement-editor-card { max-width: 820px; }

.markdown-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.4rem;
}

.markdown-toolbar button {
  min-width: 2.3rem;
  padding: 0.4rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--text-soft);
  cursor: pointer;
  font-size: 0.9rem;
  transition: all var(--speed) var(--ease);
}
.markdown-toolbar button:hover { border-color: var(--caramel); color: var(--caramel-strong); background: var(--caramel-soft); }

.form-help { margin: 0.35rem 0 0; color: var(--text-muted); font-size: 0.82rem; }

.markdown-preview-wrap {
  margin-top: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: #fff;
}

.markdown-preview-title {
  padding: 0.5rem 0.8rem;
  background: var(--surface);
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 600;
  border-bottom: 1px solid var(--border);
  letter-spacing: 0.04em;
}

.markdown-preview { min-height: 7rem; padding: 0.9rem; background: #fff; }
.markdown-preview:empty::before { content: "预览将在这里显示"; color: var(--text-muted); }

.announcement-read-summary { grid-template-columns: repeat(3, minmax(150px, 1fr)); }

/* ---------------- 徽章 ---------------- */
.badge {
  display: inline-block;
  padding: 0.18rem 0.62rem;
  border-radius: var(--radius-pill);
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.5;
  vertical-align: middle;
  white-space: nowrap;
}

.badge-level { background: var(--espresso-100); color: var(--espresso-700); }
.badge-success { background: var(--success-bg); color: var(--success-dark); border: 1px solid var(--success-border); }
.badge-danger { background: var(--danger-bg); color: var(--danger-dark); border: 1px solid var(--danger-border); }
.badge-warning { background: var(--warning-bg); color: var(--warning-dark); border: 1px solid var(--warning-border); }
.badge-secondary { background: var(--surface); color: var(--text-soft); border: 1px solid var(--border); }
.badge-leader { background: #e6eef8; color: #1f5f8f; border: 1px solid #c4d9ee; }

/* ---------------- 提示条 ---------------- */
.alert {
  padding: 0.85rem 1.1rem;
  border-radius: var(--radius);
  margin-bottom: 1.5rem;
  font-weight: 500;
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  animation: slide-in var(--speed-slow) var(--ease);
}

.alert::before { flex: 0 0 auto; line-height: 1.4; }

.alert-success { background: var(--success-bg); color: var(--success-dark); border: 1px solid var(--success-border); }
.alert-success::before { content: "✅"; }

.alert-error { background: var(--danger-bg); color: var(--danger-dark); border: 1px solid var(--danger-border); }
.alert-error::before { content: "⚠️"; }

.alert-warning { background: var(--warning-bg); color: var(--warning-dark); border: 1px solid var(--warning-border); }
.alert-warning::before { content: "💡"; }

/* ---------------- 会员档案 ---------------- */
.member-profile { margin-bottom: 1.5rem; }

.profile-card .profile-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.avatar {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: var(--header-grad);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(74, 46, 26, 0.3);
  border: 2px solid rgba(255, 255, 255, 0.9);
}

/* 员工个人中心头像 */
.profile-avatar {
  width: 92px;
  height: 92px;
  border-radius: 50%;
  overflow: hidden;
  flex: 0 0 auto;
  box-shadow: 0 6px 18px rgba(74, 46, 26, 0.22);
  border: 3px solid #fff;
  background: var(--header-grad);
}

.profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.profile-avatar-placeholder {
  background-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='%23ffffff'%20stroke-width='1.6'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpath%20d='M20%2021v-2a4%204%200%200%200-4-4H8a4%204%200%200%200-4%204v2'/%3E%3Ccircle%20cx='12'%20cy='7'%20r='4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 46%;
  background-color: var(--header-grad);
}

.profile-info {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.75rem;
}

.info-item {
  padding: 0.65rem 0.85rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color var(--speed) var(--ease);
}
.info-item:hover { border-color: var(--border-strong); }

.info-item label { display: block; font-size: 0.78rem; color: var(--text-muted); margin-bottom: 0.15rem; font-weight: 500; }
.info-item span { font-weight: 600; color: var(--text); }

.note-card { max-width: none; }

/* ---------------- 积分兑换 ---------------- */
.redeem-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(155px, 1fr));
  gap: 0.75rem;
}

.redeem-item {
  display: flex;
  flex-direction: column;
  padding: 1rem;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  background: #fff;
  transition: border-color var(--speed) var(--ease), background var(--speed) var(--ease), transform var(--speed-slow) var(--ease), box-shadow var(--speed-slow) var(--ease);
}

.redeem-item:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm); border-color: var(--espresso-300); }
.redeem-item:has(input:checked) { border-color: var(--caramel); background: var(--caramel-soft); box-shadow: 0 0 0 1px var(--caramel) inset; }
.redeem-item-fixed { border-color: var(--caramel); background: var(--caramel-soft); cursor: default; }

.redeem-item input { display: none; }
.redeem-name { font-weight: 600; font-size: 0.95rem; color: var(--text); }
.redeem-points { color: var(--caramel-strong); font-size: 0.9rem; margin-top: 0.3rem; font-weight: 600; font-variant-numeric: tabular-nums; }

.amount-grid { margin-bottom: 0.75rem; }
.amount-grid .redeem-name { color: var(--espresso-600); }

.redeem-row { display: grid; grid-template-columns: 1.4fr 1fr 1fr auto; gap: 0.65rem; align-items: end; }
.redeem-row .form-group { margin: 0; }

/* ---------------- 危险区域 ---------------- */
.danger-zone {
  border: 1px solid var(--danger-border);
  max-width: 600px;
  background: linear-gradient(180deg, #fff 0%, var(--danger-bg) 100%);
}
.danger-zone h3 { color: var(--danger-dark); }
.danger-actions { display: flex; gap: 0.75rem; flex-wrap: wrap; }

/* ---------------- 优惠券 ---------------- */
.coupon-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1rem;
}

.coupon-card {
  background: var(--card-grad);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.3rem;
  box-shadow: var(--shadow-sm);
  border-left: 4px solid var(--espresso-400);
  position: relative;
  overflow: hidden;
  transition: transform var(--speed-slow) var(--ease), box-shadow var(--speed-slow) var(--ease);
}

.coupon-card::after {
  content: "";
  position: absolute;
  right: -38px; top: -38px;
  width: 110px; height: 110px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(201, 138, 61, 0.14), transparent 70%);
  pointer-events: none;
}

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

.coupon-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.75rem; gap: 0.75rem; }

.coupon-type {
  font-size: 0.82rem;
  padding: 0.2rem 0.6rem;
  background: var(--espresso-100);
  color: var(--espresso-700);
  border-radius: var(--radius-pill);
  font-weight: 600;
  white-space: nowrap;
}

.coupon-card h3 { margin-bottom: 0.5rem; color: var(--text); font-size: 1.1rem; }
.coupon-name { margin-bottom: 0.25rem !important; }

.coupon-value {
  font-size: 1.9rem;
  font-weight: 800;
  color: var(--espresso-600);
  margin-bottom: 0.5rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}

.coupon-condition { font-size: 0.85rem; color: var(--text-muted); }

.coupon-meta {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.55rem 0.5rem;
  margin: 1rem 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.coupon-meta div { padding: 0.4rem 0.6rem; border-radius: var(--radius-sm); }
.coupon-meta div:nth-child(odd) { font-weight: 600; color: var(--text-soft); background: var(--surface); }
.coupon-meta div:nth-child(even) { color: var(--text-muted); }

.coupon-actions { display: flex; gap: 0.5rem; margin-top: 1rem; }

.coupon-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
  margin: 1rem 0;
}

.coupon-stats .stat-item {
  text-align: center;
  padding: 0.55rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.coupon-stats .stat-value {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--espresso-600);
  display: block;
}

.coupon-stats .stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: block;
  margin-top: 0.15rem;
}

.empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.empty-state::before {
  content: "🍃";
  display: block;
  font-size: 2.6rem;
  margin-bottom: 0.75rem;
  opacity: 0.6;
}

.coupon-preview {
  padding: 1.1rem;
  background: linear-gradient(180deg, var(--surface), #fff);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  margin-top: 0.5rem;
}

.coupon-preview-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.75rem; }
.coupon-preview-value { display: flex; align-items: baseline; gap: 0.5rem; margin: 1rem 0; }

.coupon-preview-value .coupon-amount {
  font-size: 2.1rem;
  font-weight: 800;
  color: var(--espresso-600);
  font-variant-numeric: tabular-nums;
}

.coupon-preview-value .coupon-condition { font-size: 0.9rem; }
.coupon-preview-meta { display: flex; gap: 1rem; font-size: 0.85rem; color: var(--text-muted); }

/* ---------------- 菜单 / 消费 ---------------- */
.menu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.menu-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color var(--speed) var(--ease), background var(--speed) var(--ease), box-shadow var(--speed-slow) var(--ease), transform var(--speed-slow) var(--ease);
}

.menu-item:hover { border-color: var(--espresso-300); box-shadow: var(--shadow-xs); transform: translateY(-1px); }

.menu-item-info { display: flex; flex-direction: column; gap: 0.15rem; min-width: 0; }
.menu-item-name { font-weight: 600; }
.menu-item-price { font-size: 0.85rem; color: var(--espresso-500); font-weight: 700; font-variant-numeric: tabular-nums; }
.menu-item-quantity { display: flex; align-items: center; gap: 0.25rem; }

.quantity-input {
  width: 52px;
  text-align: center;
  padding: 0.32rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
  font-variant-numeric: tabular-nums;
}
.quantity-input:focus { outline: none; border-color: var(--caramel); box-shadow: var(--ring); }

.order-summary {
  padding: 1.05rem 1.1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-top: 0.5rem;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.4rem 0;
  color: var(--text-soft);
}

.summary-amount {
  font-weight: 700;
  color: var(--espresso-600);
  font-size: 1.15rem;
  font-variant-numeric: tabular-nums;
}

/* ---------------- 弹窗 ---------------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: rgba(46, 26, 12, 0.45);
  backdrop-filter: blur(4px);
  animation: fade-in var(--speed) var(--ease);
}

.modal-card {
  width: min(420px, 100%);
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 1.6rem;
  animation: pop-in var(--speed-slow) var(--ease);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.modal-header h3 { margin: 0; color: var(--espresso-700); }

.modal-close {
  border: 0;
  background: transparent;
  color: var(--text-muted);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  width: 32px; height: 32px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background var(--speed) var(--ease), color var(--speed) var(--ease);
}

.modal-close:hover { color: var(--danger); background: var(--danger-bg); }

/* ---------------- 财务模块 ---------------- */
.finance-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-bottom: 1.1rem;
  padding: 0.45rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: fit-content;
  max-width: 100%;
}

.finance-tabs .btn { border-radius: var(--radius-sm); }

.finance-stats .stat-card { min-width: 0; }
.finance-stats .stat-value { font-size: 1.55rem; }

.complaint-item-list { display: grid; gap: 0.65rem; }

.complaint-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 0.9rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color var(--speed) var(--ease);
}
.complaint-item-row:hover { border-color: var(--espresso-300); }
.complaint-item-row input { width: 90px; }

.cost-component-list { display: grid; gap: 0.75rem; margin-bottom: 0.75rem; }

.cost-component-row {
  display: grid;
  grid-template-columns: 1.6fr .8fr 1fr auto;
  gap: 0.65rem;
  align-items: end;
  padding: 0.85rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.cost-component-row .form-group { margin: 0; }

.ingredient-price { min-height: 42px; display: flex; align-items: center; color: var(--text-soft); font-weight: 600; font-variant-numeric: tabular-nums; }

.cost-total-box {
  margin: 1rem 0;
  padding: 1rem 1.1rem;
  background: var(--caramel-soft);
  border: 1px solid var(--warning-border);
  border-radius: var(--radius);
  font-size: 1.05rem;
  color: var(--espresso-700);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.finance-docs-section h3 { margin-bottom: 1rem; }
.finance-docs-intro { max-width: 860px; }

.finance-formula-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.finance-formula {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 1rem 1.1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color var(--speed) var(--ease), transform var(--speed-slow) var(--ease);
}
.finance-formula:hover { border-color: var(--espresso-300); transform: translateY(-1px); }
.finance-formula span { color: var(--text-muted); font-size: 0.88rem; }
.finance-formula strong { font-variant-numeric: tabular-nums; }

.finance-doc-list { display: grid; gap: 0.6rem; padding-left: 1.35rem; }

/* ---------------- 设置表单 ---------------- */
.settings-section {
  margin-top: 1.5rem;
  padding-top: 1.35rem;
  border-top: 1px solid var(--border);
}
.settings-section h3 { margin-bottom: 0.35rem; color: var(--espresso-700); }

.settings-row {
  display: grid;
  grid-template-columns: minmax(140px, 2fr) minmax(100px, 1fr) auto;
  gap: 0.65rem;
  align-items: end;
  margin: 0.65rem 0;
  padding: 0.75rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.settings-row.level-row { grid-template-columns: minmax(140px, 2fr) minmax(110px, 1fr) minmax(90px, 1fr) auto; }
.settings-row.redeem-row { grid-template-columns: minmax(160px, 2fr) minmax(100px, 1fr) auto; }
.settings-row.expense-cat-row { grid-template-columns: 1fr auto; }
.settings-row .form-group { margin: 0; }

.settings-help { color: var(--text-muted); font-size: 0.88rem; }

.settings-field-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 0.25rem 0.75rem;
}

/* ---------------- 签到记录 ---------------- */
.attendance-stats .stat-value { font-size: 1.45rem; }

.attendance-select-row {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  flex-wrap: wrap;
}

.attendance-select-row input[type="date"] {
  padding: 0.5rem 0.7rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-family: inherit;
  background: #fff;
}

.attendance-shift-pills {
  display: inline-flex;
  gap: 0.4rem;
}

.attendance-pill {
  position: relative;
  display: inline-flex;
  align-items: center;
  padding: 0.45rem 1.1rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-pill);
  cursor: pointer;
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--text-soft);
  background: #fff;
  transition: all var(--speed) var(--ease);
}

.attendance-pill input { position: absolute; opacity: 0; pointer-events: none; }

.attendance-pill:hover { border-color: var(--espresso-400); color: var(--espresso-700); }

.attendance-pill.active {
  background: var(--espresso-600);
  border-color: var(--espresso-600);
  color: #fff;
  box-shadow: 0 2px 8px rgba(74, 46, 26, 0.25);
}

.attendance-record-hint {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.85rem;
  flex-wrap: wrap;
  font-size: 0.9rem;
}

.attendance-roster {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 0.55rem;
  margin: 0.6rem 0 1rem;
}

.attendance-person {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.65rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color var(--speed) var(--ease), background var(--speed) var(--ease), transform var(--speed-slow) var(--ease);
}

.attendance-person:hover { border-color: var(--border-strong); }

.attendance-person.is-arrived {
  border-color: var(--success-border);
  background: var(--success-bg);
}

.attendance-person-check {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  cursor: pointer;
  flex: 1 1 auto;
  min-width: 0;
}

.attendance-person-check input { display: none; }

.attendance-check-circle {
  width: 19px;
  height: 19px;
  border: 2px solid var(--border-strong);
  border-radius: 50%;
  flex: 0 0 auto;
  position: relative;
  transition: all var(--speed) var(--ease);
  background: #fff;
}

.attendance-person:hover .attendance-check-circle { border-color: var(--espresso-400); }

.attendance-person.is-arrived .attendance-check-circle {
  border-color: var(--success);
  background: var(--success);
}

.attendance-person.is-arrived .attendance-check-circle::after {
  content: "";
  position: absolute;
  left: 4px;
  top: 1px;
  width: 5px;
  height: 9px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.attendance-person-name {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attendance-status {
  flex: 1 1 auto;
  min-width: 0;
  padding: 0.32rem 0.45rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  background: #fff;
  transition: border-color var(--speed) var(--ease);
}

.attendance-status:focus { outline: none; border-color: var(--caramel); }

/* 名单配置：员工行（勾选 + 职位输入） */
.attendance-staff-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.6rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.attendance-staff-row .checkbox-line { margin: 0; padding: 0; background: transparent; border: none; flex: 1 1 auto; min-width: 0; }
.attendance-staff-row .checkbox-line span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.attendance-position-input {
  width: 110px;
  padding: 0.32rem 0.5rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  background: #fff;
}
.attendance-position-input:focus { outline: none; border-color: var(--caramel); }

/* 自定义名单行：姓名 + 职位 + 删除 */
.settings-row.roster-row { grid-template-columns: 1fr 1fr auto; }

/* 签到登记页：人员职位 */
.attendance-person-info { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.attendance-person-position { color: var(--text-muted); font-size: 0.78rem; }

/* 职位多选（名单配置） */
.attendance-pos-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.attendance-pos-check {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.22rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: #fff;
  cursor: pointer;
  font-size: 0.8rem;
  transition: all var(--speed) var(--ease);
}

.attendance-pos-check:hover { border-color: var(--espresso-400); }

.attendance-pos-check input { width: 13px; height: 13px; accent-color: var(--caramel); margin: 0; }

.attendance-pos-check:has(input:checked) {
  border-color: var(--caramel);
  background: var(--caramel-soft);
  font-weight: 600;
}

/* ---------------- 名单配置页 ---------------- */
.roster-overview {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 0.55rem;
  margin-bottom: 1.1rem;
}
.roster-overview-item {
  text-align: center;
  padding: 0.65rem 0.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.roster-overview-item strong {
  display: block;
  font-size: 1.35rem;
  line-height: 1.3;
  color: var(--espresso-600);
}
.roster-overview-item span { font-size: 0.78rem; color: var(--text-muted); }

.roster-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0.95rem 0 0.55rem;
}
.roster-section-head h4 { margin: 0; color: var(--espresso-700); }

/* 现有员工卡片网格 */
.roster-staff-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 0.6rem;
}
.roster-staff-card {
  padding: 0.65rem 0.7rem 0.6rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color var(--speed) var(--ease), background var(--speed) var(--ease), box-shadow var(--speed) var(--ease);
}
.roster-staff-card:hover { border-color: var(--border-strong); }
.roster-staff-card.is-selected {
  border-color: var(--success);
  background: var(--success-soft, rgba(61, 139, 90, 0.06));
  box-shadow: 0 2px 10px rgba(61, 139, 90, 0.14);
}
.roster-staff-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  cursor: pointer;
}
.roster-staff-head input { display: none; }
.roster-check-circle {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  border: 2px solid var(--border-strong);
  border-radius: 50%;
  background: #fff;
  position: relative;
  transition: all var(--speed) var(--ease);
}
.roster-staff-card.is-selected .roster-check-circle {
  border-color: var(--success);
  background: var(--success);
}
.roster-staff-card.is-selected .roster-check-circle::after {
  content: "";
  position: absolute;
  left: 4px;
  top: 1px;
  width: 5px;
  height: 9px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.roster-staff-name { font-weight: 600; color: var(--text); }
.roster-staff-positions {
  margin-top: 0.55rem;
  padding-top: 0.5rem;
  border-top: 1px dashed var(--border);
}

/* 自定义姓名列表 */
.roster-config-list { display: flex; flex-direction: column; gap: 0.5rem; }
.roster-config-list .roster-row {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.7rem;
  align-items: end;
}
.roster-config-list .roster-row .form-group { margin: 0; }

.roster-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.9rem;
}
.roster-actions .btn-primary { margin-left: auto; }

@media (max-width: 600px) {
  .roster-staff-grid { grid-template-columns: 1fr; }
}

/* ---------------- 员工管理 ---------------- */
.staff-stats .stat-card { padding: 1.1rem 0.75rem; }
.staff-stats .stat-value { font-size: 1.5rem; }

/* 添加员工表单窄列 + 员工列表宽列，避免列表横向滚动 */
.staff-layout {
  display: grid;
  grid-template-columns: minmax(250px, 300px) 1fr;
  gap: 1.5rem;
  align-items: start;
}

.staff-add-form .form-group input {
  font-size: 0.95rem;
}

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

.staff-cell {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.staff-list-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1rem;
  color: #fff;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.6);
  box-shadow: 0 2px 6px rgba(62, 40, 24, 0.18);
}

.staff-list-avatar.role-admin { background: linear-gradient(135deg, #d4a017, #a87d0f); }
.staff-list-avatar.role-finance { background: linear-gradient(135deg, #3d8b5a, #2c6a45); }
.staff-list-avatar.role-staff { background: linear-gradient(135deg, #6f4e37, #4a2e1a); }

.staff-cell-info { min-width: 0; }
.staff-cell-name { font-weight: 600; line-height: 1.35; }
.staff-cell-name .badge { margin-left: 0.35rem; vertical-align: 1px; }
.staff-cell-info small { display: block; }

tr.is-frozen { opacity: 0.62; }

/* ---------------- 工具类 ---------------- */
.text-muted { color: var(--text-muted); }
.text-center { text-align: center; }
.text-success { color: var(--success-dark); font-weight: 500; }
.text-danger { color: var(--danger-dark); font-weight: 500; }
.is-muted { opacity: 0.62; }

.form { width: 100%; }

/* ---------------- 页脚 ---------------- */
.footer {
  text-align: center;
  padding: 1.5rem;
  color: var(--text-muted);
  font-size: 0.83rem;
  border-top: 1px solid var(--border);
  margin-top: 2rem;
}

/* ---------------- 动效 ---------------- */
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop-in {
  from { opacity: 0; transform: scale(0.96) translateY(8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
@keyframes slide-in {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.reset-form-hidden { display: none; }

/* ---------------- 响应式 ---------------- */
@media (max-width: 768px) {
  html { scroll-padding-top: 0; }
  body { overflow-x: hidden; }

  .container {
    width: 100%;
    padding-left: max(0.85rem, env(safe-area-inset-left));
    padding-right: max(0.85rem, env(safe-area-inset-right));
  }

  .header { position: static; padding: 0.65rem 0; }

  .header-top {
    flex-direction: column;
    align-items: center;
    gap: 0.45rem;
    padding-top: 0.7rem;
    padding-bottom: 0.4rem;
  }

  .logo { text-align: center; justify-content: center; font-size: 1.08rem; }

  .nav {
    width: 100%;
    max-width: none;
    overflow-x: auto;
    flex-wrap: nowrap;
    justify-content: flex-start;
    padding: 0.4rem 0.85rem 0.7rem;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .nav::-webkit-scrollbar { display: none; }

  .nav-link {
    flex: 0 0 auto;
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    font-size: 0.84rem;
    padding: 0.45rem 0.8rem;
  }

  .staff-info { width: 100%; justify-content: center; gap: 0.4rem; }
  .staff-name { max-width: 9rem; overflow: hidden; text-overflow: ellipsis; }

  .time-bar { text-align: center; padding: 0.35rem 0; }

  .main { padding-top: 1.15rem; padding-bottom: 1.5rem; }
  .page-title { font-size: 1.32rem; }

  .page-header { flex-direction: column; align-items: stretch; margin-bottom: 1rem; }
  .page-header > .btn { width: 100%; }

  .page-actions {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
  }
  .page-actions .btn { width: 100%; padding-left: 0.5rem; padding-right: 0.5rem; }

  .card {
    padding: 1rem;
    margin-bottom: 1rem;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.65rem; margin-bottom: 1rem; }
  .stat-card, .stat-card.small { padding: 0.9rem 0.5rem; }
  .stat-value { font-size: 1.45rem; }

  .grid-2, .coupon-grid, .menu-grid, .profile-info,
  .redeem-grid, .announcement-read-summary {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.75rem;
  }

  .table-responsive, .devices-table-wrap, .table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

  .table, .data-table { display: table; width: max-content; min-width: 100%; }
  .table th, .table td, .data-table th, .data-table td { padding: 0.65rem; white-space: nowrap; }

  .devices-table { min-width: 760px; table-layout: auto; }
  .devices-table-admin { min-width: 980px; }
  .devices-table th, .devices-table td { width: auto !important; overflow: visible; text-overflow: clip; }

  .search-bar { gap: 0.65rem; }
  .search-bar input, .search-bar select, .search-bar .btn {
    width: 100%;
    min-width: 0;
    min-height: 44px;
  }

  .form-card { max-width: none; }
  .form-group input, .form-group select, .form-group textarea {
    min-height: 44px;
    font-size: 16px;
  }

  .form-actions, .danger-actions, .coupon-actions { width: 100%; flex-direction: column; gap: 0.6rem; }
  .form-actions .btn, .danger-actions .btn, .coupon-actions .btn { width: 100%; min-height: 44px; }

  .quick-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.55rem; }
  .quick-actions .btn { width: 100%; padding-left: 0.5rem; padding-right: 0.5rem; }

  .announcement-heading { flex-direction: column; gap: 0.65rem; }
  .announcement-actions { width: 100%; }
  .announcement-actions .btn { min-height: 38px; }

  .profile-card .profile-header { align-items: flex-start; }
  .coupon-card { padding: 1rem; }
  .coupon-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .coupon-preview-meta { flex-direction: column; gap: 0.35rem; }
  .empty-state { padding: 1.75rem 0.75rem; }

  .radio-group { gap: 0.5rem; }
  .radio-item { width: 100%; min-height: 44px; }

  .finance-tabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; }
  .finance-tabs .btn { width: 100%; }

  .settings-row, .settings-row.level-row, .settings-row.redeem-row, .settings-row.expense-cat-row, .settings-row.roster-row { grid-template-columns: 1fr; }
  .settings-row .btn { justify-self: start; }

  .redeem-row { grid-template-columns: 1fr; }
  .cost-component-row { grid-template-columns: 1fr; }

  .modal-overlay { padding: 0.75rem; align-items: flex-end; }
  .modal-card {
    max-height: calc(100vh - 1.5rem);
    max-height: calc(100dvh - 1.5rem);
    overflow-y: auto;
    padding: 1rem;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  }

  .footer { margin-top: 1rem; padding: 1rem; }
}

@media (max-width: 640px) {
  .unread-announcement-alert { padding: 0.75rem; }
  .unread-announcement-action { font-size: 0; }
  .unread-announcement-action span { font-size: 1.1rem; }
  .announcement-heading { flex-direction: column; }
  .announcement-read-summary { grid-template-columns: 1fr; }
}

@media (max-width: 390px) {
  .stats-grid, .quick-actions, .page-actions { grid-template-columns: minmax(0, 1fr); }
  .staff-info { flex-wrap: wrap; }
}

/* ---------------- 打印 ---------------- */
@media print {
  .header, .time-bar, .footer, .finance-tabs, .page-header .btn, .unread-announcement-alert {
    display: none !important;
  }
  body { background: #fff; }
  .main { max-width: none; padding: 0; }
  .card { box-shadow: none; break-inside: avoid; border-color: #ddd; }
  .table th { background: #f4f4f4 !important; }
}
