/* ============================================================
 * 明制婚礼备婚工作台 · 样式层
 * 复刻 Ardot 设计稿：微信小程序风格 · 白底 · 中式红金
 * ============================================================ */

:root {
  --bg: #f7f3ec;
  --card: #ffffff;
  --red: #c23a2e;
  --red-deep: #a32525;
  --gold: #c7a252;
  --gold-light: #fcf6e0;
  --red-light: #f9ece6;
  --ink: #3b2a1e;
  --ink-sub: #8a7a6a;
  --ink-faint: #b08a5a;
  --line: #ede0c8;
  --gray-bg: #f4f2ed;
  --gray-ink: #8a877e;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 6px 16px -6px rgba(163, 37, 37, 0.18);
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  background: var(--bg);
  font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.5;
}

.serif { font-family: "Noto Serif SC", "Songti SC", "SimSun", serif; }

/* ============ 页面框架：三层结构 ============ */
.app {
  max-width: 420px;
  margin: 0 auto;
  min-height: 100vh;
  position: relative;
  background: var(--bg);
}

/* 状态栏 */
.status-bar {
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  font-size: 14px;
  font-weight: 600;
  position: sticky; top: 0; z-index: 60;
  background: var(--bg);
}
.status-bar .sb-icons { display: flex; gap: 5px; align-items: center; }

/* 导航栏 */
.nav-bar {
  display: flex;
  align-items: center;
  padding: 8px 16px 8px 12px;
  gap: 10px;
  position: sticky; top: 44px; z-index: 50;
  background: var(--bg);
}
.nav-bar .nav-title {
  flex: 1;
  text-align: center;
  font-family: "Noto Serif SC", serif;
  font-size: 17px;
  font-weight: 700;
}
.nav-bar .nav-add {
  display: flex; align-items: center; gap: 3px;
  background: var(--red-deep);
  color: #fff;
  font-size: 12px;
  padding: 5px 10px;
  border-radius: 8px;
  cursor: pointer;
  user-select: none;
}
.nav-bar .nav-back {
  width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 8px; cursor: pointer;
  font-size: 18px; color: var(--ink);
  background: transparent;
}
.nav-bar .nav-spacer { width: 66px; } /* 平衡标题 */

/* 主内容区 */
.content {
  padding: 8px 16px 24px;
  display: flex; flex-direction: column; gap: 14px;
  animation: fadeIn .25s ease;
}
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* 页面（二级页）与 首页视图 切换 */
.view { display: none; }
.view.active { display: block; }

/* ============ 首页 ============ */
.home-hero {
  background: linear-gradient(135deg, var(--red-deep), var(--red));
  border-radius: 16px;
  padding: 18px;
  color: #fff;
  box-shadow: var(--shadow);
  margin-top: 6px;
}
.home-hero .hh-label { font-size: 14px; color: #fbe9c9; }
.home-hero .hh-num {
  font-family: "Noto Serif SC", serif;
  font-size: 44px; font-weight: 700; color: #ffd98e;
  display: inline-block;
}
.home-hero .hh-unit { font-size: 14px; color: #fbe9c9; }
.home-hero .hh-date { font-size: 12px; color: #f2d9a8; margin-top: 4px; letter-spacing: 1px; }

.card {
  background: var(--card);
  border-radius: 14px;
  border: 1px solid var(--line);
  padding: 14px;
}
.card .card-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 8px;
}
.card .card-title { font-family: "Noto Serif SC", serif; font-size: 15px; font-weight: 700; }
.card .card-link { color: var(--ink-faint); font-size: 13px; cursor: pointer; }

.todo-item {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 0;
}
.todo-item .todo-txt { flex: 1; }
.todo-item .todo-tag {
  font-size: 10px; padding: 2px 6px; border-radius: 6px; font-weight: 500;
}
.todo-tag.hi { background: var(--red-light); color: var(--red); }
.todo-tag.mid { background: var(--gold-light); color: #c09a3e; }
.todo-tag.lo { background: var(--gray-bg); color: var(--gray-ink); }

/* 模块网格 */
.section-label {
  font-size: 13px; color: var(--ink-sub);
  margin: 18px 4px 0; letter-spacing: 1px; font-weight: 500;
}
.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 10px;
}
.mod-card {
  position: relative;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  display: flex; align-items: center; gap: 10px;
  cursor: pointer;
  transition: transform .1s;
}
.mod-card:active { transform: scale(.97); }
.mod-card .mc-icon {
  width: 36px; height: 36px; flex: 0 0 36px;
  border-radius: 10px;
  background: var(--red-light);
  display: flex; align-items: center; justify-content: center;
  font-size: 17px;
}
.mod-card .mc-body { flex: 1; min-width: 0; }
.mod-card .mc-name { font-family: "Noto Serif SC", serif; font-size: 14px; font-weight: 700; }
.mod-card .mc-summary { font-size: 11px; color: var(--ink-sub); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mod-card .mc-badge {
  position: absolute; top: 6px; right: 6px;
  background: var(--red);
  color: #fff; font-size: 10px; font-weight: 500;
  min-width: 18px; height: 18px; border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  padding: 0 4px;
}
.mod-card .mc-badge.zero { background: var(--gray-bg); color: var(--gray-ink); }

/* ============ 二级页：分组区块 ============ */
.group {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.group-head {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--gold-light);
  padding: 10px 12px;
}
.group-head .gh-title { font-size: 12px; color: var(--ink-sub); font-weight: 500; }
.group-head .gh-count { font-size: 11px; color: var(--ink-faint); }

.item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px;
  border-top: 1px solid #f2e8d4;
  cursor: pointer;
}
.item:first-of-type { border-top: none; }
.item .i-check {
  width: 18px; height: 18px; flex: 0 0 18px;
  border-radius: 50%;
  border: 1.5px solid var(--gold);
  display: flex; align-items: center; justify-content: center;
  transition: all .15s;
}
.item .i-check.on { background: var(--red); border-color: var(--red); }
.item .i-check.on::after { content: "✓"; color: #fff; font-size: 11px; font-weight: 700; }
.item .i-name { flex: 1; font-size: 13px; }
.item .i-name .i-sub { display: block; font-size: 11px; color: var(--ink-sub); margin-top: 1px; }
.item .i-status { font-size: 11px; color: var(--ink-faint); flex-shrink: 0; }
.item .i-status.done { color: var(--red); }
.item .i-status.opt { color: var(--red); }
.item .i-del {
  width: 24px; height: 24px; flex: 0 0 24px;
  display: none; align-items: center; justify-content: center;
  color: var(--ink-faint); font-size: 15px;
  border-radius: 6px;
}
.item:hover .i-del { display: flex; }
.item .i-del:hover { background: var(--gray-bg); color: var(--red); }

/* 区域汇总条（时间轴/接亲等） */
.stage-label { font-size: 12px; color: var(--ink-sub); font-weight: 500; letter-spacing: 1px; margin: 2px 4px; }

/* 司仪环节卡 */
.flow-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
}
.flow-card .fc-head { display: flex; align-items: center; gap: 8px; }
.flow-card .fc-time {
  background: var(--red-deep); color: #fff;
  font-size: 11px; padding: 3px 8px; border-radius: 6px;
  flex-shrink: 0; font-weight: 500;
}
.flow-card .fc-name { flex: 1; font-family: "Noto Serif SC", serif; font-size: 14px; font-weight: 700; }
.flow-card .fc-speech { font-size: 12px; margin-top: 6px; }
.flow-card .fc-detail { font-size: 11px; color: var(--ink-sub); margin-top: 3px; }

/* ============ 底部 Tab ============ */
.tab-bar {
  position: sticky; bottom: 0; z-index: 50;
  display: flex;
  background: #fff;
  border-top: 1px solid var(--line);
  padding: 8px 24px 14px;
  gap: 8px;
  max-width: 420px; margin: 20px auto 0;
}
.tab {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  font-size: 10px; color: var(--ink-sub);
  cursor: pointer; user-select: none;
  padding: 2px 0;
}
.tab .tab-ic { font-size: 18px; line-height: 1; }
.tab.active { color: var(--red); font-weight: 500; }

/* ============ 底部编辑层（action sheet） ============ */
.sheet-mask {
  position: fixed; inset: 0; z-index: 90;
  background: rgba(38, 30, 25, 0.45);
  display: none;
  align-items: flex-end; justify-content: center;
}
.sheet-mask.show { display: flex; }
.sheet {
  width: 100%; max-width: 420px;
  background: #fff;
  border-radius: 16px 16px 0 0;
  padding: 8px 16px calc(20px + env(safe-area-inset-bottom));
  animation: slideUp .25s ease;
}
@keyframes slideUp { from { transform: translateY(100%); } to { transform: none; } }
.sheet .s-handle {
  width: 64px; height: 4px; border-radius: 2px;
  background: #d9d3c2; margin: 4px auto 10px;
}
.sheet .s-title {
  font-family: "Noto Serif SC", serif; font-size: 15px; font-weight: 700;
  text-align: center; margin-bottom: 12px;
}
.field { margin-bottom: 12px; }
.field .f-label { font-size: 12px; color: var(--ink-sub); margin-bottom: 6px; font-weight: 500; }
.field .f-input {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14px;
  color: var(--ink);
  font-family: inherit;
  outline: none;
}
.field .f-input:focus { border-color: var(--gold); }
.field .f-num { display: flex; align-items: center; gap: 10px; }
.field .f-num .num-btn {
  width: 32px; height: 32px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; cursor: pointer; user-select: none;
}
.field .f-num .num-btn.minus { background: var(--line); color: var(--ink); }
.field .f-num .num-btn.plus { background: var(--red-deep); color: #fff; }
.field .f-num .num-val { width: 60px; text-align: center; font-size: 16px; font-weight: 600; }
.field .f-status { display: flex; gap: 8px; }
.field .f-status .st {
  flex: 1; text-align: center; padding: 8px 0;
  border-radius: 10px; font-size: 12px; font-weight: 500;
  background: var(--gray-bg); color: var(--gray-ink);
  cursor: pointer; user-select: none;
}
.field .f-status .st.active {
  background: var(--gold-light); color: #c09a3e;
  outline: 1px solid var(--gold);
}
.field .f-status .st.active.done-st { background: var(--red-light); color: var(--red); outline-color: var(--red); }
.sheet .s-btns { display: flex; gap: 10px; margin-top: 4px; }
.sheet .s-btns .btn {
  border-radius: 10px; padding: 11px 0; text-align: center;
  font-size: 14px; cursor: pointer; user-select: none;
}
.sheet .s-btns .btn.danger { background: var(--gray-bg); color: var(--red); width: 76px; }
.sheet .s-btns .btn.plain { background: var(--gray-bg); color: var(--ink-sub); width: 76px; }
.sheet .s-btns .btn.save {
  flex: 1; background: var(--red-deep); color: #fff;
  font-family: "Noto Serif SC", serif; font-weight: 700;
}

/* ============ 通用 ============ */
.empty-tip { text-align: center; color: var(--ink-faint); font-size: 13px; padding: 30px 0; }
.hidden { display: none !important; }
.countdown-badge { font-size: 12px; color: #f2d9a8; }
