:root {
  --panel: rgba(255, 255, 255, 0.76);
  --panel-soft: rgba(248, 255, 248, 0.72);
  --text: #1e3a2b;
  --muted: #4c6758;
  --shadow: 0 18px 42px rgba(33, 75, 45, 0.14);
  --radius: 24px;
  /* 红旗锁位：仅通过这两个变量微调桌面端背景旗位置 */
  --flag-pos-x: 50%;
  --flag-pos-y: 50%;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: "Segoe UI", "Hiragino Sans", "Yu Gothic", "Meiryo", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background: transparent;
  cursor: url('/static/images/cursor-hand-woman-48.png') 10 3, auto;
}

button,
a,
.primary-btn,
.ghost-btn,
.small-btn,
.danger-btn,
.icon-btn,
.copy-icon-btn,
.manage-actions button,
#leaveBtn {
  cursor: url('/static/images/cursor-hand-woman-48.png') 10 3, pointer;
}

input[type="text"],
textarea,
select {
  cursor: text;
}

button,
input,
textarea,
select {
  font: inherit;
}

textarea {
  resize: vertical;
}

.hidden {
  display: none !important;
}

.fake-hidden {
  position: absolute !important;
  left: -9999px !important;
  top: -9999px !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.shell {
  position: relative;
  max-width: 1180px;
  margin: 0 auto;
  padding: 30px 18px 46px;
  min-height: 100vh;
  overflow: hidden;
}

.shell::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  background:
    linear-gradient(180deg, rgba(255, 249, 214, 0.24), rgba(236, 255, 236, 0.28)),
    url('/static/images/sunny-golf-bg.jpg') var(--flag-pos-x) var(--flag-pos-y) / cover no-repeat,
    url('/static/images/golf-course-bg.svg') var(--flag-pos-x) var(--flag-pos-y) / cover no-repeat;
}

.shell::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(circle at top left, rgba(255, 233, 122, 0.18), transparent 30%),
    radial-gradient(circle at top right, rgba(126, 214, 123, 0.14), transparent 28%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.10));
  pointer-events: none;
}

.panel {
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.38);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.subpanel {
  background: var(--panel-soft);
}

.page-section,
.inner-panel {
  padding: 22px;
}

.start-panel {
  position: absolute;
  top: 88%;
  left: 50%;
  width: min(920px, calc(100% - 24px));
  transform: translate(-50%, -50%);
  background: transparent;
  border: 0;
  box-shadow: none;
}

.title-bar {
  display: grid;
  grid-template-columns: 52px 1fr 52px;
  align-items: center;
  gap: 16px;
  margin-bottom: 22px;
}

.title-spacer {
  width: 52px;
  height: 52px;
}

.top-actions {
  min-width: 52px;
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.section-title {
  margin: 0;
  font-size: 28px;
  color: #18482f;
}

.title-center {
  text-align: center;
  justify-self: center;
  font-size: 36px;
  font-weight: 800;
  letter-spacing: 0.03em;
}

.stack-lg > * + * {
  margin-top: 18px;
}

.stack-md > * + * {
  margin-top: 14px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field span {
  font-size: 14px;
  color: var(--muted);
}

.field input,
.field textarea,
.field select {
  width: 100%;
  background: rgba(255, 255, 255, 0.92);
  color: var(--text);
  border: 1px solid rgba(44, 93, 58, 0.13);
  border-radius: 16px;
  padding: 13px 15px;
  outline: none;
}

.field input::placeholder,
.field textarea::placeholder {
  color: #9aa39d;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  border-color: rgba(117, 201, 123, 0.95);
  box-shadow: 0 0 0 4px rgba(152, 222, 119, 0.18);
}

.primary-btn,
.ghost-btn,
.small-btn,
.danger-btn,
.icon-btn,
.copy-icon-btn {
  border: 0;
  transition: transform 0.16s ease, opacity 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}

.primary-btn:hover,
.ghost-btn:hover,
.small-btn:hover,
.danger-btn:hover,
.icon-btn:hover,
.copy-icon-btn:hover {
  transform: translateY(-1px);
}

.primary-btn {
  border-radius: 16px;
  padding: 12px 16px;
  background: linear-gradient(135deg, #ffe88b, #8ee28e);
  color: #174229;
  font-weight: 800;
  box-shadow: 0 10px 20px rgba(125, 191, 106, 0.18);
}

.ghost-btn,
.small-btn {
  border-radius: 14px;
  padding: 11px 15px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--text);
  border: 1px solid rgba(32, 48, 42, 0.08);
}

.ghost-btn[disabled],
.small-btn[disabled],
.danger-btn[disabled] {
  opacity: 0.45;
  pointer-events: none;
}

.danger-btn {
  border-radius: 14px;
  padding: 11px 15px;
  background: rgba(217, 93, 93, 0.10);
  color: #9b2f2f;
  border: 1px solid rgba(217, 93, 93, 0.20);
}

.icon-btn {
  width: 52px;
  height: 52px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(255, 240, 161, 0.96), rgba(161, 228, 166, 0.96));
  box-shadow: 0 10px 24px rgba(97, 169, 89, 0.18);
}

.icon-btn svg {
  width: 24px;
  height: 24px;
  stroke: #165135;
  stroke-width: 2.2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.message {
  border-radius: 16px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.66);
  color: var(--muted);
  line-height: 1.7;
}

.message:empty {
  display: none;
}

.message.error {
  color: #b44040;
  background: rgba(255, 100, 100, 0.12);
}

.message.success {
  color: #236842;
  background: rgba(88, 204, 131, 0.15);
}

#boxA > #noteA {
  margin-top: 0;
  margin-bottom: 10px;
  text-align: center;
  width: min(calc(22ch + var(--btn-w, 56px)), calc(100vw - 24px));
  max-width: 100%;
  margin-left: auto;
  margin-right: auto;
}

.zoneA {
  --bar-h: clamp(48px, 5.2vw, 60px);
  --btn-w: clamp(48px, 5.2vw, 60px);
  width: min(calc(22ch + var(--btn-w)), calc(100vw - 24px));
  margin-left: auto;
  margin-right: auto;
  display: grid;
  grid-template-columns: min(22ch, calc(100% - var(--btn-w))) var(--btn-w);
  min-height: var(--bar-h);
  background: transparent;
  border: 0;
  box-shadow: none;
  overflow: visible;
  position: relative;
}

.todo-event-title {
  font-size: 34px;
  font-weight: 800;
  line-height: 1.16;
  color: #1b4f37;
  letter-spacing: 0.02em;
  font-family: "Hiragino Sans", "Yu Gothic", "Meiryo", "PingFang SC", "Microsoft YaHei", sans-serif;
}

.todo-content-box {
  min-height: 68px;
  border-radius: 22px;
  border: 1px solid rgba(60, 125, 73, 0.10);
  background: rgba(255, 255, 255, 0.96);
  position: relative;
  display: block;
  padding: 8px 70px 8px 18px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.todo-content-text {
  display: block;
  width: 100%;
  font-size: 22px;
  line-height: 1.45;
  color: #173624;
  white-space: pre-wrap;
  word-break: break-word;
  text-align: left;
}

.todo-copy-btn {
  position: absolute;
  right: 8px;
  bottom: 8px;
}

.todo-admin-card {
  margin-top: 0;
}

#opsPage .todo-admin-card .section-head {
  margin-bottom: 6px;
}

#opsPage .todo-admin-card h3 {
  margin: 0;
  line-height: 1.2;
}

#opsPage .todo-admin-card .stack-md > * + * {
  margin-top: 8px;
}

#opsPage .todo-admin-card .field {
  gap: 4px;
}

#opsPage .todo-admin-card textarea {
  line-height: 1.35;
  padding-top: 8px;
  padding-bottom: 8px;
}

.zoneB {
  min-height: var(--bar-h);
  height: 100%;
  align-self: stretch;
  background: rgba(255, 255, 245, 0.95);
  border: 1px solid rgba(120, 132, 120, 0.72);
  border-radius: 12px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.72),
    0 2px 5px rgba(0, 0, 0, 0.08);
  display: flex;
  align-items: center;
  overflow: hidden;
}

.seed-cell {
  width: 100%;
  min-width: 0;
  height: 100%;
  min-height: var(--bar-h);
  padding: 0 8px;
  font-size: clamp(17px, 2.1vw, 22px);
  font-family: ui-monospace, "SF Mono", "Menlo", "Courier New", monospace;
  font-variant-numeric: tabular-nums;
  display: block;
  text-align: center;
  line-height: calc(var(--bar-h) - 2px);
  background: transparent;
  color: #1f1f1f;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  outline: none;
  caret-color: #1f1f1f;
  white-space: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  user-select: text;
  -webkit-user-select: text;
}

.seed-cell:focus {
  border: 0;
  box-shadow: none;
  background: transparent;
}

.btn-orb {
  width: var(--btn-w);
  min-width: var(--btn-w);
  min-height: var(--bar-h);
  justify-self: end;
  transform: translateX(22%);
  z-index: 2;
  border: 0;
  background: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-orb:hover,
.btn-orb:focus-visible,
.btn-orb:active {
  transform: translateX(22%);
  background: transparent;
  outline: none;
  box-shadow: none;
}

.golf-ball {
  position: relative;
  width: clamp(28px, 3vw, 36px);
  height: clamp(28px, 3vw, 36px);
  border-radius: 50%;
  background:
    radial-gradient(circle at 30% 26%, #fffefe 0%, #ffeef6 34%, #ffdbe9 58%, #f4b8d0 82%, #df8db2 100%);
  border: 1px solid rgba(178, 106, 140, 0.9);
  box-shadow:
    inset -4px -5px 9px rgba(188, 95, 139, 0.26),
    inset 4px 5px 10px rgba(255, 255, 255, 0.98),
    0 3px 7px rgba(0, 0, 0, 0.18),
    0 10px 12px rgba(46, 90, 38, 0.24),
    0 18px 20px rgba(32, 70, 26, 0.15);
}

.golf-ball::before {
  content: "";
  position: absolute;
  inset: 14%;
  border-radius: 50%;
  background-image:
    radial-gradient(circle, rgba(186, 116, 149, 0.36) 0 0.65px, transparent 0.85px),
    radial-gradient(circle, rgba(168, 98, 136, 0.30) 0 0.55px, transparent 0.75px),
    radial-gradient(circle, rgba(205, 144, 172, 0.24) 0 0.5px, transparent 0.7px);
  background-size: 6px 6px, 6px 6px, 6px 6px;
  background-position: 0 0, 3px 3px, 1.5px 4.5px;
  opacity: 0.55;
}

.golf-ball::after {
  content: "";
  position: absolute;
  top: 16%;
  left: 22%;
  width: 38%;
  height: 22%;
  border-radius: 50%;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.97) 0%, rgba(255, 233, 245, 0.42) 100%);
  filter: blur(0.35px);
  pointer-events: none;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
  gap: 18px;
}

.event-card {
  position: relative;
  overflow: hidden;
  border-radius: 28px;
  border: 1px solid rgba(255, 255, 255, 0.42);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.80), rgba(246, 255, 246, 0.70));
  box-shadow: 0 22px 40px rgba(38, 96, 55, 0.15);
}

.event-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255, 247, 179, 0.18), rgba(154, 227, 145, 0.08));
  pointer-events: none;
}

.event-top,
.event-middle,
.event-bottom {
  position: relative;
  z-index: 1;
  padding: 20px 20px 18px;
}

.event-middle,
.event-bottom {
  border-top: 1px solid rgba(51, 112, 66, 0.08);
}

.event-date {
  font-size: 34px;
  font-weight: 800;
  line-height: 1.16;
  color: #1b4f37;
  letter-spacing: 0.02em;
  word-break: break-word;
}

.event-gathering {
  font-size: 20px;
  line-height: 1.6;
  color: #24543a;
  white-space: pre-wrap;
  word-break: break-word;
}

.event-detail {
  font-size: 22px;
  line-height: 1.75;
  color: #1f432e;
  white-space: pre-wrap;
  word-break: break-word;
}

.address-pill-desktop,
.address-pill-mobile {
  min-height: 68px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(60, 125, 73, 0.10);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.address-pill-desktop,
.address-pill-mobile {
  display: flex;
  align-items: center;
  padding: 8px 8px 8px 18px;
  gap: 10px;
}

.address-text {
  flex: 1;
  min-width: 0;
  font-size: 22px;
  line-height: 1.45;
  color: #173624;
  word-break: break-word;
  user-select: text;
  -webkit-user-select: text;
}

.copy-icon-btn {
  flex: 0 0 auto;
  width: 52px;
  height: 52px;
  border-radius: 999px;
  background: rgba(249, 251, 250, 0.98);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 14px rgba(36, 81, 46, 0.10);
}

.copy-icon-btn svg {
  width: 24px;
  height: 24px;
  stroke: #21382a;
  stroke-width: 2;
  fill: none;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 18px;
}

.ops-left-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.manage-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.manage-item {
  padding: 15px;
  border-radius: 18px;
  border: 1px solid rgba(32, 48, 42, 0.08);
  background: rgba(255, 255, 255, 0.82);
}

.manage-item-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.manage-item-title {
  font-size: 17px;
  font-weight: 800;
  color: #1b4f37;
}

.order-chip {
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(142, 219, 136, 0.18);
  color: #24543a;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.manage-item-meta {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.8;
  white-space: pre-wrap;
}

.manage-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.trace-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  max-height: 348px;
  overflow-y: auto;
  padding-right: 6px;
}

.trace-item {
  display: flex;
  flex-direction: column;
  padding: 15px 16px;
  border-radius: 18px;
  border: 1px solid rgba(32, 48, 42, 0.08);
  background: rgba(255, 255, 255, 0.82);
}

.trace-row {
  line-height: 1.8;
  color: var(--muted);
  word-break: break-word;
}

.trace-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 12px;
  padding-top: 4px;
}

.log-delete-btn {
  min-width: 88px;
  padding: 8px 12px;
}

.grid-code {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 14px;
  align-items: end;
}

.align-end {
  justify-content: end;
}

#opsPage.stack-lg > * + * {
  margin-top: 12px;
}

#opsPage .page-section,
#opsPage .inner-panel {
  padding: 16px;
}

#opsPage .section-head {
  margin-bottom: 10px;
}

#opsPage .grid-2 {
  gap: 12px;
}

#opsPage .stack-md > * + * {
  margin-top: 10px;
}

#opsPage .field {
  gap: 5px;
}

#opsPage .field span {
  font-size: 13px;
}

#opsPage .field input,
#opsPage .field textarea,
#opsPage .field select {
  padding: 10px 12px;
}

#opsPage .manage-list {
  gap: 8px;
}

#opsPage .manage-item {
  padding: 12px;
}

#opsPage .manage-item-head {
  margin-bottom: 4px;
}

#opsPage .manage-item-meta {
  line-height: 1.38;
}

#opsPage .manage-actions {
  margin-top: 8px;
}

#opsPage .trace-list {
  gap: 10px;
}

#opsPage .trace-item {
  padding: 14px 15px;
}

#opsPage .trace-row {
  line-height: 1.6;
}

#opsPage .message {
  line-height: 1.42;
}

#opsPage .trace-actions {
  margin-top: 8px;
  padding-top: 2px;
}

#opsPage .grid-code {
  gap: 10px;
}

.empty-state {
  padding: 28px;
  border: 1px dashed rgba(43, 101, 58, 0.18);
  border-radius: 20px;
  color: var(--muted);
  text-align: center;
  background: rgba(255, 255, 255, 0.66);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%) translateY(20px);
  opacity: 0;
  pointer-events: none;
  z-index: 9999;
  padding: 12px 18px;
  border-radius: 999px;
  background: rgba(24, 63, 38, 0.92);
  color: #fff;
  font-size: 14px;
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.22);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.build-tag {
  position: fixed;
  right: 14px;
  bottom: 10px;
  z-index: 9998;
  padding: 4px 9px;
  border-radius: 999px;
  border: 1px solid rgba(28, 60, 42, 0.18);
  background: rgba(255, 255, 255, 0.72);
  color: rgba(28, 60, 42, 0.72);
  font-size: 12px;
  line-height: 1.2;
  letter-spacing: 0.02em;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  user-select: none;
  pointer-events: none;
}

@media (max-width: 900px) {
  .grid-2,
  .grid-code {
    grid-template-columns: 1fr;
  }

  .ops-left-stack {
    gap: 10px;
  }

  .trace-list {
    grid-template-columns: 1fr;
    max-height: 420px;
  }

  .todo-event-title {
    font-size: 28px;
  }
}

@media (min-width: 901px) {
  #eventsContainer .todo-event-card {
    order: -999;
  }

  #eventsContainer .todo-event-card .event-bottom {
    min-height: 300px;
    display: flex;
    align-items: stretch;
  }

  #eventsContainer .todo-event-card .todo-content-box {
    width: 100%;
    min-height: 100%;
    padding: 22px 84px 22px 24px;
    border-radius: 16px;
    position: relative;
    display: block;
  }

  #eventsContainer .todo-event-card .todo-content-text {
    font-size: 22px;
    line-height: 1.45;
    display: block;
    width: 100%;
    min-height: 100%;
    text-align: left;
    white-space: pre-wrap;
    word-break: break-word;
  }

  #eventsContainer .todo-event-card .todo-copy-btn {
    width: 52px;
    height: 52px;
    position: absolute;
    right: 16px;
    bottom: 16px;
  }

  #eventsContainer .todo-event-card .todo-copy-btn svg {
    width: 24px;
    height: 24px;
  }
}

@media (max-width: 720px) {
  :root {
    /* 红旗锁位（手机）：保持旗底端靠近右侧球体上方 */
    --flag-pos-x: 64%;
    --flag-pos-y: 32%;
  }

  .shell {
    padding: 16px 12px 30px;
  }

  .start-panel {
    width: auto;
    max-width: min(92vw, 420px);
    top: 83%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .zoneA {
    --bar-h: clamp(46px, 12vw, 56px);
    --btn-w: clamp(46px, 12vw, 56px);
    width: min(calc(20ch + var(--btn-w)), calc(100vw - 24px));
    grid-template-columns: min(20ch, calc(100% - var(--btn-w))) var(--btn-w);
  }

  .seed-cell {
    padding: 0 6px;
    font-size: 17px;
  }

  .golf-ball {
    width: clamp(26px, 7.5vw, 36px);
    height: clamp(26px, 7.5vw, 36px);
  }

  .title-bar {
    grid-template-columns: 1fr 52px;
    gap: 10px;
  }

  .title-spacer {
    display: none;
  }

  .title-center {
    justify-self: start;
    text-align: left;
    font-size: 28px;
  }

  .section-title {
    font-size: 24px;
  }

  #opsPage .manage-actions {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
    margin-top: 8px;
  }

  #opsPage .manage-actions .ghost-btn,
  #opsPage .manage-actions .small-btn,
  #opsPage .manage-actions .danger-btn {
    width: 100%;
    padding: 10px 0;
    font-size: 16px;
    white-space: nowrap;
  }

  .event-top,
  .event-middle,
  .event-bottom {
    padding: 18px 16px;
  }

  .event-date {
    font-size: 28px;
  }

  .event-gathering {
    font-size: 18px;
  }

  .event-detail {
    font-size: 18px;
    line-height: 1.72;
  }

  .address-pill-mobile {
    min-height: 58px;
    padding: 8px 8px 8px 14px;
    gap: 8px;
  }

  .address-pill-mobile .address-text {
    font-size: 18px;
  }

  .address-pill-mobile .copy-icon-btn {
    width: 46px;
    height: 46px;
  }

  .address-pill-mobile .copy-icon-btn svg {
    width: 22px;
    height: 22px;
  }
}
