:root {
  --green: #07C160;
  --green-dark: #06ad56;
  --bg: #ededed;
  --card: #ffffff;
  --text: #191919;
  --sub: #8c8c8c;
  --line: #e9e9e9;
  --link: #576b95;
  --orange: #fa9d3b;
  --red: #fa5151;
  /* 排片各阶段高饱和色（实底 + 白字，区分度大） */
  --stage-public: #8e44ad;   /* 公示阶段 · 紫 */
  --stage-open: #07c160;     /* 正在报名 · 绿 */
  --stage-closed: #f59e0b;   /* 截止报名 · 橙 */
  --stage-pending: #3b82f6;  /* 待完成 · 蓝 */
  --stage-done: #64748b;     /* 已完成 · 蓝灰 */
  --stage-failed: #ef4444;   /* 未成立 · 红 */
}

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

html, body {
  margin: 0; padding: 0; height: 100%;
  background: #d9dade;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;
  color: var(--text);
  font-size: 15px;
}

#phone {
  width: 100%; max-width: 430px; height: 100dvh; margin: 0 auto;
  background: var(--bg); display: flex; flex-direction: column;
  box-shadow: 0 0 40px rgba(0,0,0,.12); overflow: hidden;
}

#header {
  flex: 0 0 auto; background: #ededed; border-bottom: 1px solid #dcdcdc;
  padding: 10px 12px; text-align: center; position: relative;
  min-height: 46px; display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 600; padding-top: env(safe-area-inset-top);
}
#header .back {
  position: absolute; left: 6px; top: 50%; transform: translateY(-50%);
  background: none; border: 0; font-size: 20px; color: var(--text);
  padding: 4px 10px; cursor: pointer;
}
#header .right {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  background: none; border: 0; font-size: 13px; color: var(--link); cursor: pointer;
}

#body { flex: 1 1 auto; overflow-y: auto; -webkit-overflow-scrolling: touch; padding-bottom: 12px; }

#tabbar {
  flex: 0 0 auto; display: flex; background: #f7f7f7; border-top: 1px solid #dcdcdc;
  padding-bottom: env(safe-area-inset-bottom);
}
#tabbar .tab {
  flex: 1; padding: 6px 0 5px; text-align: center; background: none; border: 0;
  color: #7d7d7d; font-size: 11px; cursor: pointer; font-family: inherit;
}
#tabbar .tab svg { display: block; margin: 0 auto 2px; }
#tabbar .tab.active { color: var(--green); }

/* ---------- 通用组件 ---------- */
.card { background: var(--card); border-radius: 10px; margin: 10px 12px; padding: 14px; }
.card.tight { padding: 12px 14px; }
.row { display: flex; align-items: center; }
.between { justify-content: space-between; }
.muted { color: var(--sub); font-size: 13px; }
.small { font-size: 13px; }
.title { font-size: 17px; font-weight: 600; margin: 0 0 4px; }
.divider { height: 1px; background: var(--line); margin: 12px 0; }
.section-title { padding: 14px 16px 6px; color: var(--sub); font-size: 13px; }

.btn {
  display: block; width: 100%; border: 0; border-radius: 8px; padding: 12px;
  background: var(--green); color: #fff; font-size: 16px; font-family: inherit;
  cursor: pointer; text-align: center;
}
.btn:disabled { background: #c8c9cc; cursor: not-allowed; }
.btn.ghost { background: #fff; color: var(--text); border: 1px solid #dcdcdc; }
.btn.danger { background: #fff; color: var(--red); border: 1px solid #f0c2c2; }
.btn.blue { background: var(--link); }
.btn.small { padding: 8px 14px; font-size: 14px; width: auto; display: inline-block; }

.tag {
  display: inline-block; font-size: 11px; padding: 2px 6px; border-radius: 4px;
  line-height: 1.5; white-space: nowrap;
}
.tag.public { background: var(--stage-public); color: #fff; }
.tag.open { background: var(--stage-open); color: #fff; }
.tag.closed { background: var(--stage-closed); color: #fff; }
.tag.pending { background: var(--stage-pending); color: #fff; }
.tag.done { background: var(--stage-done); color: #fff; }
.tag.failed { background: var(--stage-failed); color: #fff; }

.empty { text-align: center; color: var(--sub); padding: 60px 20px; font-size: 14px; }
.empty .ico { font-size: 34px; opacity: .35; display: block; margin-bottom: 10px; }

/* ---------- 登录 ---------- */
.login-wrap { padding: 40px 26px; }
.login-logo {
  width: 88px; height: 88px; border-radius: 22px;
  margin: 0 auto 20px; display: flex; align-items: center; justify-content: center;
  filter: drop-shadow(0 10px 24px rgba(35, 47, 82, .35));
}
.login-h { text-align: center; font-size: 20px; font-weight: 600; margin-bottom: 6px; }
.login-p { text-align: center; color: var(--sub); font-size: 13px; margin-bottom: 30px; line-height: 1.6; }
.field { background: #fff; border-radius: 10px; padding: 0 14px; margin-bottom: 12px; }
.field label { display: block; font-size: 13px; color: var(--sub); padding-top: 8px; }
.field input, .field textarea {
  width: 100%; border: 0; outline: 0; font-size: 16px; padding: 6px 0 10px;
  font-family: inherit; color: var(--text); background: transparent; resize: none;
}
.field textarea { min-height: 76px; line-height: 1.5; }
.field .inline { display: flex; align-items: center; }
.field .unit { color: var(--sub); font-size: 14px; padding-left: 6px; }

/* ---------- 发起电影页紧凑化（手机无滚动条） ---------- */
.create-form .card { margin: 6px 12px; padding: 10px 14px; }
.create-form .notice { padding: 8px 10px; font-size: 12px; line-height: 1.45; }
.create-form .field { margin-bottom: 4px; padding: 0 10px; }
.create-form .field label { font-size: 12px; padding-top: 4px; }
.create-form .field input, .create-form .field textarea { font-size: 15px; padding: 3px 0 7px; }
.create-form .field textarea { min-height: 42px; }
.create-form .slots { gap: 6px; padding: 2px 0; }
.create-form .slot { padding: 6px 0; font-size: 13px; }
.create-form .btn { padding: 11px; }

.slots { display: flex; gap: 8px; padding: 4px 0 2px; }
.slot {
  flex: 1; border: 1px solid #dcdcdc; background: #f7f7f7; border-radius: 6px;
  padding: 8px 0; font-size: 14px; color: #333; font-family: inherit; cursor: pointer;
}
.slot.on { background: #e7f7ee; border-color: var(--green); color: var(--green-dark); font-weight: 500; }

/* ---------- 日历 ---------- */
.cal-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px 6px; }
.cal-head .month { font-size: 17px; font-weight: 600; }
.cal-head button { background: none; border: 0; font-size: 14px; color: var(--link); cursor: pointer; font-family: inherit; }
.cal-week { display: grid; grid-template-columns: repeat(7, 1fr); text-align: center; font-size: 12px; color: var(--sub); padding: 6px 0; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); border-top: 1px solid var(--line); background: #fff; }
.cal-cell {
  min-height: 80px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line);
  padding: 3px 3px 5px; cursor: pointer; position: relative; overflow: hidden;
}
.cal-cell:nth-child(7n) { border-right: 0; }
.cal-cell.dim { background: #fafafa; color: #c4c4c4; }
.cal-cell .dnum { font-size: 13px; padding-left: 3px; line-height: 18px; }
.cal-cell.today .dnum {
  background: var(--green); color: #fff; border-radius: 50%; width: 20px; height: 20px;
  display: inline-block; text-align: center; line-height: 20px; padding: 0; margin-left: 3px;
}
.cal-cell.has .dnum { font-weight: 600; }
.chip {
  border-radius: 3px; padding: 3px 3px 2px; margin-top: 3px; overflow: hidden;
}
.chip .mname {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  font-size: 11px; line-height: 1.22; word-break: break-word;
}
.chip .mtime { display: block; font-size: 10px; line-height: 1.3; margin-top: 1px; opacity: .72; }
.chip.public { background: var(--stage-public); color: #fff; }
.chip.open { background: var(--stage-open); color: #fff; }
.chip.closed { background: var(--stage-closed); color: #fff; }
.chip.pending { background: var(--stage-pending); color: #fff; }
.chip.done { background: var(--stage-done); color: #fff; }
.chip.failed { background: var(--stage-failed); color: #fff; }
.more { font-size: 10px; color: var(--sub); text-align: center; margin-top: 2px; }

.legend { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 16px 14px 4px; font-size: 14px; color: var(--sub); }
.legend-row { display: flex; flex-wrap: wrap; gap: 10px 16px; justify-content: center; }
.legend span { display: inline-flex; align-items: center; }
.legend i { width: 14px; height: 14px; border-radius: 4px; margin-right: 6px; display: inline-block; }

/* ---------- 列表项 ---------- */
.mv {
  background: #fff; padding: 12px 14px; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; cursor: pointer;
}
.mv:active { background: #f5f5f5; }
.mv .info { flex: 1; min-width: 0; }
.mv .nm { font-size: 15px; font-weight: 500; margin-bottom: 3px; }
.mv .meta { font-size: 12px; color: var(--sub); }
.mv .meta b { color: var(--link); font-weight: 500; }
.mv .arrow { color: #c8c8c8; font-size: 16px; padding-left: 6px; }

/* ---------- 详情 ---------- */
.poster {
  background: linear-gradient(135deg, #2b2f36, #454b55); color: #fff;
  margin: 10px 12px; border-radius: 10px; padding: 16px;
}
.poster .t { font-size: 20px; font-weight: 600; }
.poster .s { font-size: 13px; opacity: .8; margin-top: 4px; }
.poster .intro { font-size: 12.5px; opacity: .72; margin-top: 7px; line-height: 1.6; }
.kv { display: flex; padding: 7px 0; font-size: 14px; }
.kv .k { width: 74px; flex: 0 0 74px; color: var(--sub); }
.kv .v { flex: 1; }

.plan { background: #f3fbf6; border: 1px solid #cdeedb; border-radius: 8px; padding: 12px; }
.plan.bad { background: #fdf1f1; border-color: #f3d2d2; }
.plan .pt { font-weight: 600; font-size: 15px; margin-bottom: 4px; }
.plan.good .pt { color: #06ad56; }
.plan.bad .pt { color: var(--red); }

ul.members { list-style: none; margin: 0; padding: 0; }
ul.members li {
  display: flex; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 14px;
}
ul.members li:last-child { border-bottom: 0; }
.avatar {
  width: 32px; height: 32px; border-radius: 4px; margin-right: 10px; flex: 0 0 32px;
  display: flex; align-items: center; justify-content: center; color: #fff; font-size: 13px;
}
.badge-host { font-size: 10px; background: #e7f7ee; color: var(--green); padding: 1px 5px; border-radius: 3px; margin-left: 6px; }
.member-id { color: var(--sub); font-size: 12px; }

.notice { background: #fff7e8; border: 1px solid #f5e2be; color: #a06a12; border-radius: 8px; padding: 10px 12px; font-size: 13px; line-height: 1.6; }

/* ---------- 我的 ---------- */
.me-head {
  background: #fff; margin: 10px 12px; border-radius: 10px;
  padding: 20px 16px; display: flex; align-items: center;
}
.me-head .avatar { width: 54px; height: 54px; flex-basis: 54px; border-radius: 6px; font-size: 20px; margin-right: 14px; }
.me-head .nick { font-size: 18px; font-weight: 600; }
.stat {
  display: flex; background: #fff; margin: 10px 12px; border-radius: 10px; overflow: hidden;
}
.stat div {
  flex: 1; min-height: 94px; padding: 0 8px; cursor: pointer;
  display: flex; flex-direction: row; align-items: center; justify-content: center; gap: 5px;
}
.stat div + div { border-left: 1px solid var(--line); }
.stat .n { font-size: 15px; font-weight: 600; line-height: 1; }
.stat .l { font-size: 13px; color: var(--sub); }
.stat .l.solo { font-size: 15px; color: var(--text); font-weight: 500; }

/* 「我们的观影回忆」入口 */
.mem-entry {
  display: flex; align-items: center; background: #fff; margin: 10px 12px;
  border-radius: 10px; padding: 14px; cursor: pointer; gap: 12px;
}
.mem-entry:active { background: #f5f5f5; }
.mem-entry-icon {
  width: 40px; height: 40px; flex: 0 0 40px; border-radius: 10px;
  background: linear-gradient(135deg, #f59e0b, #f97316); color: #fff;
  display: flex; align-items: center; justify-content: center;
}
.mem-entry-t { font-size: 15px; font-weight: 600; }
.mem-entry-s { font-size: 12px; color: var(--sub); margin-top: 2px; }
.mem-entry .arrow { color: #c8c8c8; font-size: 18px; }

/* 观影回忆：四列网格，行内从左到右、整体从上到下均按时间由近及远 */
.mem-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px;
  padding: 4px 12px 20px;
}
.mem-card {
  background: #fff; border-radius: 10px; padding: 9px 7px 8px;
  cursor: pointer; min-width: 0; display: flex; flex-direction: column;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .05);
}
.mem-card:active { background: #f5f5f5; }
.mc-year { font-size: 10px; color: var(--sub); line-height: 1.3; }
.mc-title {
  font-size: 12.5px; font-weight: 600; line-height: 1.3; margin: 0 0 4px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; word-break: break-word;
}
.mc-score { margin-top: auto; font-size: 13px; font-weight: 700; color: #b0791a; line-height: 1.3; }
.mc-score .star { font-size: 11px; margin-right: 1px; }
.mc-score .muted { font-weight: 400; font-size: 10px; }

/* 观影回忆：左侧时间轴 + 右侧四列网格 */
.mem-wrap { display: flex; align-items: flex-start; }
.mem-main { flex: 1; min-width: 0; }
.mem-end { padding: 2px 16px 18px; text-align: center; color: #a5a5ad; }

/* 时间轴（竖直，顶部=最近的月份、底部=最早的月份）
   左侧为 yyyy/M 年月刻度，右侧竖线为可拖动的场次加载刻度 */
.mem-rail {
  flex: 0 0 68px; width: 68px; position: sticky; top: 2px;
  padding: 14px 0 10px; -webkit-user-select: none; user-select: none;
}
.tl-track {
  position: relative; height: min(56vh, 380px); margin: 4px 0;
  touch-action: none; cursor: pointer;
}
.tl-line {
  position: absolute; left: 57px; top: 0; bottom: 0; width: 5px;
  border-radius: 3px;
  background: linear-gradient(#fbbf24 0%, #f59e0b 55%, #94a3b8 100%);
  opacity: .35;
}
.tl-label {
  position: absolute; left: 0; right: 24px; transform: translateY(-50%);
  text-align: right; font-size: 9px; color: #9a9aa6; line-height: 1;
  white-space: nowrap; pointer-events: none;
}
.tl-dot {
  position: absolute; left: 56px; width: 7px; height: 7px;
  transform: translateY(-50%); border-radius: 50%;
  background: #c9c9d1; box-shadow: 0 0 0 1.5px #fff;
}
.tl-thumb {
  position: absolute; left: 50px; top: 0; width: 19px; height: 19px;
  transform: translateY(-50%); border-radius: 50%;
  background: linear-gradient(135deg, #f97316, #f59e0b);
  border: 2.5px solid #fff;
  box-shadow: 0 2px 7px rgba(245, 158, 11, .55);
  transition: top .06s linear;
  pointer-events: none;
}
/* 拖动时新「加载」出的卡片淡入上浮 */
.mem-card.in { animation: memIn .42s ease both; }
@keyframes memIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

/* 星星（评分用，金橙） */
.star { font-style: normal; color: #f7a71c; }

.foot-btns { padding: 4px 12px 20px; }
.foot-btns .btn + .btn { margin-top: 10px; }

#toast {
  position: fixed; left: 50%; top: 45%; transform: translate(-50%, -50%);
  background: rgba(0,0,0,.78); color: #fff; padding: 10px 18px; border-radius: 6px;
  font-size: 14px; opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 99; max-width: 76%;
  text-align: center; line-height: 1.5;
}
#toast.show { opacity: 1; }

/* ---------- 评分系统 ---------- */
.rate-sum { display: flex; flex-direction: column; }
.rate-sum-h { font-size: 15px; display: flex; align-items: baseline; }
.rate-sum-h .star { font-size: 18px; margin-right: 2px; }
.rate-sum-h b { font-size: 24px; margin-right: 2px; }

ul.members li .member-rate,
ul.members li .member-norate { margin-left: auto; flex: 0 0 auto; }
.member-rate { font-size: 13px; font-weight: 600; color: #b0791a; white-space: nowrap; }
.member-rate .star { font-size: 12px; margin-right: 1px; }
.member-norate { font-size: 12px; color: #c4c4c4; }

.rated-badge {
  font-size: 12px; color: #b0791a; background: #fff8ec; border: 1px solid #f5e2be;
  border-radius: 10px; padding: 1px 9px; white-space: nowrap;
}
.rated-badge .star { font-size: 11px; margin-right: 1px; }
.rate-btn {
  border: 1px solid var(--green); color: var(--green-dark); background: #fff;
  border-radius: 10px; padding: 1px 12px; font-size: 12px; line-height: 1.7;
  font-family: inherit; cursor: pointer; white-space: nowrap;
}
.rate-btn:active { background: #e7f7ee; }

/* 评分弹层 */
.rate-mask {
  position: fixed; inset: 0; background: rgba(0, 0, 0, .45); z-index: 120;
  display: flex; align-items: center; justify-content: center;
}
.rate-sheet {
  width: min(340px, 92vw); background: #fff; border-radius: 16px;
  padding: 22px 18px 16px; text-align: center; margin: 0 auto;
}
.rs-h { font-size: 16px; font-weight: 600; margin-bottom: 12px; line-height: 1.4; }
.rs-stars { display: flex; justify-content: space-between; padding: 0 2px; }
.rs-stars i { font-style: normal; font-size: 22px; line-height: 1; color: #d9d9d9; cursor: pointer; padding: 2px 1px; transition: color .1s; }
.rs-stars i.on { color: #f7a71c; }
.rs-v { margin-top: 10px; min-height: 16px; }
.rs-tip { margin-top: 2px; }
.rs-actions { display: flex; gap: 10px; margin-top: 16px; }
.rs-actions button { flex: 1; border-radius: 9px; padding: 10px 0; font-size: 15px; cursor: pointer; font-family: inherit; }
.rs-cancel { background: #f2f2f2; color: #555; border: 0; }
.rs-ok { background: var(--green); color: #fff; border: 0; }
