:root {
  --bg: #f2eee5;
  --surface: #ffffff;
  --text: #124375;
  --muted: #6c8299;
  --line: #e2dbd0;
  --primary: #6ec6f9;
  --primary-dark: #4ba8e0;
  --primary-soft: #eaf6fe;
  --blue: #2589ff;
  --green: #16a36a;
  --red: #f16066;
  --amber-bg: #fff7ec;
  --amber-text: #bb6a24;
  --shadow: 0 10px 28px rgba(34, 39, 47, 0.08);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  background: #eef1f5;
  color: var(--text);
  font-family:
    -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei",
    sans-serif;
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.phone-shell {
  width: min(100%, 430px);
  min-height: 100vh;
  margin: 0 auto;
  background: var(--bg);
  overflow: hidden;
}

.app-hero p,
.section-toolbar p {
  margin: 0;
  color: var(--muted);
}

.app-hero {
  padding: 18px 18px 16px;
  display: grid;
  grid-template-columns: 48px 1fr 42px;
  gap: 12px;
  align-items: center;
  background:
    linear-gradient(135deg, rgba(110, 198, 249, 0.15), transparent 46%),
    var(--surface);
  border-bottom: 1px solid #edf0f3;
}

.brand-mark {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  color: #fff;
  font-size: 25px;
  font-weight: 800;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.15), transparent 32%),
    linear-gradient(145deg, #6EC6F9 0%, #4BA8E0 48%, #124375 100%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.16);
}

.app-hero h1 {
  margin: 0 0 2px;
  font-size: 21px;
  line-height: 1.25;
}

.settings-button {
  width: 40px;
  height: 40px;
  border: 1px solid #edf0f4;
  border-radius: 12px;
  color: #20242c;
  background: #fff;
  font-weight: 900;
  box-shadow: 0 8px 18px rgba(32, 36, 44, 0.06);
}

.notice-card,
.group-banner,
.stats-strip,
.tabs,
.entry-form,
.panel {
  margin: 14px;
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.notice-card {
  padding: 14px 16px;
  box-shadow: none;
  border: 1px solid #eef0f4;
  background:
    linear-gradient(135deg, rgba(110, 198, 249, 0.15), transparent 44%), #fff;
}

.group-banner {
  min-height: 118px;
  padding: 18px;
  display: grid;
  align-content: center;
  gap: 8px;
  color: #fff;
  text-decoration: none;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.18), transparent 34%),
    linear-gradient(135deg, #6EC6F9 0%, #4BA8E0 46%, #124375 100%);
}

.group-banner span {
  font-size: 34px;
  line-height: 1.1;
  font-weight: 950;
}

.group-banner small {
  font-size: 15px;
  opacity: 0.86;
  font-weight: 800;
}

.lead-banner {
  min-height: 58px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  color: #fff;
  text-decoration: none;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.18), transparent 34%),
    linear-gradient(110deg, #6EC6F9, #4BA8E0 54%, #124375);
}

.lead-banner span {
  font-weight: 700;
  opacity: 0.86;
}

.lead-banner strong {
  font-size: 18px;
  white-space: nowrap;
}

.notice-head {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}

.notice-card h3 {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-size: 17px;
  line-height: 1.25;
}

.notice-card h3::before {
  content: "";
  width: 5px;
  height: 18px;
  border-radius: 999px;
  background: var(--primary);
}

.pill-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  flex-shrink: 0;
}

.pill-actions a,
.pill-actions button,
.light-button {
  min-height: 34px;
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 18px;
  color: var(--primary);
  background: var(--primary-soft);
  text-decoration: none;
  font-weight: 700;
}

.announcement-body {
  margin: 9px 0 0;
  color: #5f6671;
  font-size: 14px;
  line-height: 1.65;
  white-space: pre-line;
}

.notice-list {
  margin: 14px 0 0;
  padding-left: 0;
  list-style: none;
  color: #62666f;
  font-size: 14px;
  line-height: 1.7;
  counter-reset: rules;
}

.notice-list li {
  counter-increment: rules;
}

.notice-list li::before {
  content: counter(rules) " ";
  color: #7b8087;
  font-weight: 700;
}

.notice-list li:nth-child(1)::before {
  content: "① ";
}

.notice-list li:nth-child(2)::before {
  content: "② ";
}

.notice-list li:nth-child(3)::before {
  content: "③ ";
}

.notice-list li:nth-child(4)::before {
  content: "④ ";
}

.stats-strip {
  min-height: 60px;
  padding: 0 16px;
  display: grid;
  grid-template-columns: repeat(4, auto);
  align-items: center;
  justify-content: space-between;
  box-shadow: none;
}

.stats-strip div {
  display: flex;
  align-items: baseline;
  gap: 8px;
  white-space: nowrap;
}

.stats-strip span {
  color: var(--muted);
  font-size: 14px;
}

.stats-strip strong {
  font-size: 23px;
  color: var(--primary);
}

.stats-strip strong.blue {
  color: var(--blue);
}

.stats-strip .orders {
  color: var(--primary);
  font-weight: 800;
}

.tabs {
  height: 52px;
  padding: 4px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  box-shadow: none;
}

.tab {
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #686d75;
  font-size: 16px;
  font-weight: 800;
}

.tab.active {
  color: #fff;
  background: var(--primary);
}

.panel {
  display: none;
  padding: 18px;
}

.panel.active {
  display: block;
}

.entry-form {
  margin: 0;
  padding: 0;
  box-shadow: none;
}

.amount-library-card {
  min-height: 66px;
  padding: 12px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 12px;
  border: 1px solid #edf0f4;
  border-radius: 10px;
  background: #fbfcfd;
}

.amount-library-card span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.amount-library-card strong {
  display: block;
  margin-top: 4px;
  font-size: 18px;
}

.field {
  display: block;
}

.field span {
  display: block;
  margin-bottom: 9px;
  color: #5a5f67;
  font-weight: 800;
}

.field em {
  color: #a1a6af;
  font-style: normal;
  font-weight: 600;
}

textarea,
input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--text);
  outline: none;
  transition:
    border-color 0.18s,
    box-shadow 0.18s;
}

textarea {
  min-height: 96px;
  padding: 13px;
  resize: vertical;
  line-height: 1.45;
}

input {
  height: 50px;
  padding: 0 13px;
}

textarea::placeholder,
input::placeholder {
  color: #a8adb5;
}

textarea:focus,
input:focus {
  border-color: #6EC6F9;
  box-shadow: 0 0 0 3px rgba(110, 198, 249, 0.2);
}

.input-with-action {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.input-with-action button {
  min-width: 82px;
  border: 0;
  border-radius: 10px;
  color: #fff;
  background: #20242c;
  font-weight: 800;
}

.field-row {
  margin-top: 16px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.field-row textarea {
  min-height: 88px;
}

.compact-field {
  margin-top: 16px;
}

.button-row {
  margin-top: 18px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.primary-button {
  min-height: 52px;
  border: 0;
  border-radius: 10px;
  color: #124375;
  background: var(--primary);
  font-size: 18px;
  font-weight: 800;
  box-shadow: 0 10px 20px rgba(110, 198, 249, 0.3);
}

.primary-button:active {
  background: var(--primary-dark);
  transform: translateY(1px);
}

.primary-button:disabled {
  cursor: not-allowed;
  opacity: 0.65;
  transform: none;
}

.message {
  display: none;
  margin: 14px 0 0;
  padding: 12px;
  border-radius: 9px;
  font-weight: 700;
}

.message.show {
  display: block;
}

.message.error {
  color: var(--red);
  background: #fff0f1;
}

.message.success {
  color: var(--green);
  background: #ecfbf5;
}

.hint-box {
  margin-top: 16px;
  padding: 14px;
  border-radius: 10px;
  background: #fbfcfd;
  color: #68707d;
  border: 1px solid #edf0f4;
  line-height: 1.7;
}

.section-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 14px;
}

.section-toolbar h3 {
  margin: 0 0 3px;
  font-size: 20px;
}

.gap-filter {
  margin: -2px 0 16px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
}

.gap-filter button {
  min-height: 58px;
  padding: 8px 6px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 3px;
  border: 1px solid #e7ebf1;
  border-radius: 12px;
  color: #20242c;
  background: linear-gradient(180deg, #fff, #fafbfc);
  font-weight: 800;
  box-shadow: 0 5px 12px rgba(32, 36, 44, 0.04);
}

.gap-filter button span,
.gap-filter button small {
  display: block;
  line-height: 1.15;
}

.gap-filter button span {
  font-size: 14px;
}

.gap-filter button small {
  color: #8b929c;
  font-size: 11px;
  font-weight: 800;
}

.gap-filter button.active {
  color: #fff;
  border-color: var(--primary);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.18), transparent 42%),
    linear-gradient(135deg, #6EC6F9, #4BA8E0);
  box-shadow: 0 8px 16px rgba(110, 198, 249, 0.3);
}

.gap-filter button.active small {
  color: rgba(255, 255, 255, 0.86);
}

.team-list {
  display: grid;
  gap: 12px;
}

.team-card {
  position: relative;
  overflow: hidden;
  border: 1px solid #edf0f4;
  border-radius: 12px;
  padding: 12px;
  background: #fff;
  box-shadow: 0 8px 18px rgba(32, 36, 44, 0.05);
}

.team-card.done {
  border-color: rgba(22, 163, 106, 0.28);
  background: linear-gradient(180deg, #f6fffb, #fff);
}

.team-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
}

.shop-row {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #5f6671;
  font-size: 13px;
  font-weight: 800;
}

.shop-dot {
  width: 22px;
  height: 22px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  color: #124375;
  background: var(--primary);
  font-size: 13px;
}

.shop-row em {
  margin-left: auto;
  padding: 4px 8px;
  border-radius: 999px;
  color: #16714e;
  background: #e9fbf3;
  font-style: normal;
  font-size: 12px;
}

.team-title {
  min-width: 0;
}

.team-title strong {
  display: block;
  font-size: 18px;
}

.team-title span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.team-link,
.safe-link {
  display: block;
  max-width: 230px;
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-decoration: none;
}

.team-link {
  color: var(--blue);
}

.status-badge {
  flex: 0 0 auto;
  padding: 5px 10px;
  border-radius: 16px;
  color: var(--primary);
  background: var(--primary-soft);
  font-weight: 800;
  font-size: 13px;
}

.status-badge.done {
  color: var(--green);
  background: #e9fbf3;
}

.match-line {
  margin-top: 10px;
  padding: 9px 10px;
  border-radius: 9px;
  color: #124375;
  background: #EAF6FE;
  font-size: 13px;
  font-weight: 700;
}

.risk-line {
  margin-top: 8px;
  padding: 9px 10px;
  border-radius: 9px;
  color: #124375;
  background: #EAF6FE;
  border: 1px solid #c5e4fa;
  font-size: 13px;
  font-weight: 800;
}

.money-grid {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.money-grid div {
  padding: 9px 8px;
  border-radius: 9px;
  background: #f8fafc;
}

.money-grid span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.money-grid strong {
  display: block;
  margin-top: 4px;
  font-size: 17px;
}

.progress-track {
  height: 8px;
  margin-top: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: #edf0f4;
}

.progress-bar {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary), #FCE16D);
}

.team-actions {
  margin-top: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.team-actions small {
  color: var(--muted);
}

.join-button {
  min-width: 88px;
  min-height: 38px;
  border: 0;
  border-radius: 9px;
  color: #fff;
  background: var(--primary);
  font-weight: 800;
}

.delete-team-button,
.danger-button {
  min-height: 38px;
  border: 0;
  border-radius: 9px;
  color: #fff;
  background: var(--red);
  font-weight: 800;
}

.danger-button {
  width: 100%;
  margin-top: 12px;
}

.join-button:disabled {
  cursor: not-allowed;
  color: #8c9199;
  background: #edf0f4;
}

.empty-state {
  padding: 28px 12px;
  border: 1px dashed #d8dde5;
  border-radius: 10px;
  text-align: center;
  color: var(--muted);
  background: #fbfcfd;
}

.footer {
  padding: 26px 14px 34px;
  text-align: center;
  color: #b2b6bd;
  font-weight: 700;
}

.rules-dialog,
.amount-dialog,
.pick-dialog,
.join-dialog,
.admin-dialog {
  width: min(calc(100% - 36px), 390px);
  border: 0;
  border-radius: 12px;
  padding: 22px 18px 18px;
  box-shadow: 0 18px 50px rgba(28, 32, 38, 0.22);
}

.rules-dialog::backdrop,
.amount-dialog::backdrop,
.pick-dialog::backdrop,
.join-dialog::backdrop,
.admin-dialog::backdrop {
  background: rgba(20, 24, 30, 0.36);
}

.rules-dialog h3,
.amount-dialog h3,
.pick-dialog h3,
.join-dialog h3,
.admin-dialog h3 {
  margin: 0 0 12px;
}

.rules-dialog p,
.join-dialog p {
  color: #5e646d;
  line-height: 1.7;
}

.dialog-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: #f2f3f5;
  font-size: 24px;
  line-height: 1;
}

.import-preview {
  margin-top: 10px;
  padding: 11px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-radius: 10px;
  background: #f8fafc;
  border: 1px solid #edf0f4;
}

.import-preview strong {
  color: var(--text);
}

.import-preview span {
  color: var(--muted);
  font-weight: 800;
}

.amount-chips {
  max-height: 210px;
  margin-top: 12px;
  padding: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  overflow: auto;
  border-radius: 10px;
  background: #fbfcfd;
  border: 1px solid #edf0f4;
}

.amount-chips button {
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid #c5e4fa;
  border-radius: 999px;
  color: var(--primary);
  background: #EAF6FE;
  font-weight: 800;
}

.amount-chips.pickable button {
  min-height: 40px;
  color: #20242c;
  background: #fff;
  border-color: #e5e8ee;
}

.empty-inline {
  color: var(--muted);
  font-weight: 700;
}

.dialog-actions.three {
  grid-template-columns: 0.8fr 0.8fr 1.2fr;
}

.join-dialog .field {
  margin-top: 12px;
}

.dialog-risk {
  margin-top: 10px;
}

.join-link-result {
  margin-top: 14px;
  padding: 12px;
  border-radius: 10px;
  background: #f6faff;
  border: 1px solid #dbeaff;
}

.join-link-result span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.join-link-result a {
  display: block;
  margin-top: 6px;
  color: var(--blue);
  overflow-wrap: anywhere;
  text-decoration: none;
  font-weight: 800;
}

.join-link-result button {
  min-height: 36px;
  margin-top: 10px;
  padding: 0 14px;
  border: 0;
  border-radius: 9px;
  color: #fff;
  background: var(--blue);
  font-weight: 800;
}

.dialog-actions {
  margin-top: 16px;
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 10px;
}

.dialog-actions .primary-button,
.dialog-actions .light-button {
  min-height: 46px;
  border-radius: 10px;
}

.full-button {
  width: 100%;
  margin-top: 16px;
}

.admin-panel {
  max-height: min(72vh, 620px);
  overflow: auto;
  padding-right: 2px;
}

.admin-section {
  margin-top: 16px;
  padding: 12px;
  border: 1px solid #edf0f4;
  border-radius: 10px;
  background: #fbfcfd;
}

.admin-section h4 {
  margin: 0 0 10px;
  font-size: 15px;
}

.toggle-row {
  min-height: 38px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #4f5662;
  font-weight: 800;
}

.toggle-row input {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
}

.admin-split {
  margin-top: 14px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.full-inline-button {
  width: 100%;
  margin-top: 12px;
}

@media (max-width: 380px) {
  .notice-card,
  .group-banner,
  .lead-banner,
  .stats-strip,
  .tabs,
  .panel {
    margin-inline: 10px;
  }

  .stats-strip {
    padding-inline: 12px;
  }

  .stats-strip span {
    font-size: 12px;
  }

  .stats-strip strong {
    font-size: 20px;
  }

  .tab,
  .primary-button {
    font-size: 16px;
  }

  .field-row,
  .button-row {
    grid-template-columns: 1fr;
  }
}
