:root {
  --brand: #07c160;
  --brand-dark: #06ad56;
  --brand-light: #e8f9ef;
  --ink: #1a1d1f;
  --ink-2: #4a5157;
  --ink-3: #8a9199;
  --line: #eceef0;
  --bg: #f5f6f8;
  --card: #ffffff;
  --radius: 18px;
  --shadow: 0 8px 28px rgba(24, 39, 75, 0.06);
  --shadow-lg: 0 18px 50px rgba(24, 39, 75, 0.12);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(1100px 460px at 50% -12%, #dcf6e6 0%, rgba(245, 246, 248, 0) 62%),
    linear-gradient(180deg, #eef1f4 0%, var(--bg) 42%);
  background-attachment: fixed;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img {
  display: block;
  max-width: 100%;
}

.page {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  padding: 22px 16px 34px;
}

/* ---------------- 卡片 ---------------- */

.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid rgba(255, 255, 255, 0.9);
  padding: 22px 18px;
  margin-bottom: 16px;
  animation: rise 0.45s ease both;
}

.card:nth-of-type(2) {
  animation-delay: 0.08s;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}

/* ---------------- 群信息 ---------------- */

.group-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}

.group-avatar {
  width: 56px;
  height: 56px;
  flex: 0 0 56px;
  border-radius: 16px;
  object-fit: cover;
  box-shadow: 0 6px 16px rgba(7, 193, 96, 0.24);
}

.group-avatar--text {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #22d07a 0%, var(--brand) 55%, var(--brand-dark) 100%);
}

.group-meta {
  min-width: 0;
  flex: 1;
}

.group-name {
  font-size: 19px;
  line-height: 1.35;
  font-weight: 700;
  letter-spacing: 0.2px;
  word-break: break-all;
}

.group-slogan {
  font-size: 13px;
  color: var(--ink-3);
  margin-top: 3px;
  word-break: break-all;
}

.notice {
  font-size: 13.5px;
  color: var(--ink-2);
  background: #f7f9fa;
  border-left: 3px solid var(--brand);
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 18px;
  word-break: break-word;
}

/* ---------------- 二维码 ---------------- */

.qrcode-box {
  position: relative;
  width: 216px;
  height: 216px;
  margin: 4px auto 12px;
  padding: 12px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 10px 26px rgba(24, 39, 75, 0.1), 0 0 0 1px var(--line);
}

.qrcode {
  width: 100%;
  height: 100%;
  border-radius: 8px;
  object-fit: contain;
  display: flex;
  align-items: center;
  justify-content: center;
}

.qrcode canvas,
.qrcode img {
  width: 100% !important;
  height: 100% !important;
  border-radius: 8px;
}

.qrcode-corner {
  position: absolute;
  width: 20px;
  height: 20px;
  border: 3px solid var(--brand);
  border-radius: 4px;
  opacity: 0.85;
}

.qrcode-corner--tl { top: -5px; left: -5px; border-right: 0; border-bottom: 0; border-top-left-radius: 12px; }
.qrcode-corner--tr { top: -5px; right: -5px; border-left: 0; border-bottom: 0; border-top-right-radius: 12px; }
.qrcode-corner--bl { bottom: -5px; left: -5px; border-right: 0; border-top: 0; border-bottom-left-radius: 12px; }
.qrcode-corner--br { bottom: -5px; right: -5px; border-left: 0; border-top: 0; border-bottom-right-radius: 12px; }

.qrcode-box--empty {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  color: var(--ink-3);
  background: repeating-linear-gradient(45deg, #fafbfc, #fafbfc 10px, #f4f6f7 10px, #f4f6f7 20px);
  border: 1px dashed #dfe3e6;
  box-shadow: none;
}

.qrcode-tip {
  text-align: center;
  font-size: 13.5px;
  color: var(--ink-2);
  margin-bottom: 4px;
  word-break: break-word;
}

.qr-section {
  text-align: center;
}

.qr-section-head {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 14px;
}

.qr-section-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
}

.qr-tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}

.qr-tag--friend {
  color: #b26b00;
  background: #fff3d9;
}

.qr-tag--group {
  color: var(--brand-dark);
  background: var(--brand-light);
}

.qr-divider {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 20px 0;
  color: var(--ink-3);
  font-size: 12px;
}

.qr-divider::before,
.qr-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.qr-divider span {
  padding: 0 14px;
  background: var(--card);
}

.group-remark {
  text-align: center;
  font-size: 12px;
  color: var(--ink-3);
  margin-bottom: 4px;
}

/* ---------------- 按钮 ---------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 0;
  border-radius: 999px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  line-height: 1;
  padding: 13px 22px;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease, opacity 0.2s ease;
  -webkit-appearance: none;
}

.btn svg {
  width: 17px;
  height: 17px;
  fill: currentColor;
  flex: 0 0 auto;
}

.btn:active {
  transform: scale(0.975);
}

.btn-primary {
  color: #fff;
  background: linear-gradient(135deg, #21d179 0%, var(--brand) 52%, var(--brand-dark) 100%);
  box-shadow: 0 10px 22px rgba(7, 193, 96, 0.28);
}

.btn-primary:hover {
  box-shadow: 0 12px 26px rgba(7, 193, 96, 0.36);
}

.btn-join {
  display: flex;
  width: 100%;
  height: 50px;
  margin-top: 18px;
  font-size: 16.5px;
  letter-spacing: 0.6px;
}

.btn-disabled {
  background: #c8ccd0;
  box-shadow: none;
  cursor: not-allowed;
}

.btn-sm {
  font-size: 14px;
  padding: 10px 20px;
}

.btn-ghost {
  color: var(--brand-dark);
  background: var(--brand-light);
  font-size: 13px;
  font-weight: 600;
  padding: 8px 16px;
}

.btn-ghost:hover {
  background: #d8f5e5;
}

.btn-ghost.is-done {
  color: #fff;
  background: var(--brand);
}

.group-hint {
  text-align: center;
  font-size: 12px;
  color: var(--ink-3);
  margin-top: 10px;
}

/* ---------------- 分享区 ---------------- */

.share-head {
  text-align: center;
  margin-bottom: 16px;
}

.share-title {
  position: relative;
  display: inline-block;
  font-size: 17px;
  font-weight: 700;
  padding-bottom: 8px;
}

.share-title::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 26px;
  height: 3px;
  border-radius: 2px;
  background: linear-gradient(90deg, #21d179, var(--brand-dark));
  transform: translateX(-50%);
}

.share-sub {
  font-size: 12.5px;
  color: var(--ink-3);
  margin-top: 6px;
}

.tabs {
  display: flex;
  gap: 6px;
  padding: 4px;
  background: #f2f4f6;
  border-radius: 999px;
  margin-bottom: 16px;
}

.tab {
  flex: 1;
  border: 0;
  background: transparent;
  border-radius: 999px;
  padding: 9px 0;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-3);
  cursor: pointer;
  transition: all 0.22s ease;
}

.tab.is-active {
  color: var(--brand-dark);
  background: #fff;
  box-shadow: 0 2px 8px rgba(24, 39, 75, 0.08);
}

.panel {
  display: none;
}

.panel.is-active {
  display: block;
  animation: fade 0.25s ease both;
}

@keyframes fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

.panel-tip {
  font-size: 11.5px;
  color: var(--ink-3);
  text-align: center;
  margin-top: 14px;
}

/* 图片网格 */

.poster-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.poster-item {
  margin: 0;
  cursor: pointer;
}

.poster-thumb {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  background: #f2f4f6;
  aspect-ratio: 3 / 4;
  box-shadow: 0 4px 14px rgba(24, 39, 75, 0.08);
}

.poster-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.poster-item:hover .poster-thumb img {
  transform: scale(1.045);
}

.poster-save {
  position: absolute;
  right: 8px;
  bottom: 8px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  color: #fff;
  background: rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(6px);
}

.poster-item figcaption {
  padding: 7px 2px 0;
  font-size: 12px;
  line-height: 1.45;
}

.poster-item figcaption strong {
  display: block;
  font-weight: 600;
  color: var(--ink);
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
}

.poster-item figcaption em {
  display: block;
  font-style: normal;
  font-size: 11px;
  color: var(--ink-3);
  margin-top: 2px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
}

/* 文案 */

.copy-item {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 12px;
  background: #fcfdfd;
}

.copy-item:last-of-type {
  margin-bottom: 0;
}

.copy-text {
  font-size: 13.5px;
  line-height: 1.75;
  color: var(--ink-2);
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 168px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.copy-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 12px;
  padding-top: 11px;
  border-top: 1px dashed var(--line);
}

.copy-label {
  font-size: 11.5px;
  color: var(--ink-3);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

/* ---------------- 页脚 ---------------- */

.footer {
  text-align: center;
  font-size: 11.5px;
  color: var(--ink-3);
  padding: 8px 10px 0;
  word-break: break-word;
}

.footer-copy {
  margin-top: 6px;
  opacity: 0.75;
}

/* ---------------- 预览层 ---------------- */

.viewer {
  position: fixed;
  inset: 0;
  z-index: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.viewer[hidden] {
  display: none;
}

.viewer-mask {
  position: absolute;
  inset: 0;
  background: rgba(8, 12, 16, 0.86);
  backdrop-filter: blur(3px);
}

.viewer-body {
  position: relative;
  max-width: 92vw;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  animation: zoom 0.22s ease both;
}

@keyframes zoom {
  from { opacity: 0; transform: scale(0.94); }
  to { opacity: 1; transform: none; }
}

.viewer-body img {
  max-width: 100%;
  max-height: 74vh;
  border-radius: 12px;
  object-fit: contain;
  box-shadow: var(--shadow-lg);
}

.viewer-bar {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.viewer-tip {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.7);
}

/* ---------------- 提示 ---------------- */

.toast {
  position: fixed;
  left: 50%;
  top: 50%;
  z-index: 1000;
  transform: translate(-50%, -50%);
  padding: 12px 20px;
  border-radius: 12px;
  font-size: 14px;
  color: #fff;
  background: rgba(20, 24, 28, 0.9);
  box-shadow: var(--shadow-lg);
  max-width: 76vw;
  text-align: center;
  word-break: break-word;
  animation: toastIn 0.2s ease both;
}

.toast[hidden] {
  display: none;
}

.toast.is-error {
  background: rgba(214, 60, 60, 0.94);
}

@keyframes toastIn {
  from { opacity: 0; transform: translate(-50%, -46%); }
  to { opacity: 1; transform: translate(-50%, -50%); }
}

/* ---------------- 分享朋友圈合集 ---------------- */

.share-pack {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 14px;
  background: #fff;
}

.share-pack:last-child {
  margin-bottom: 0;
}

.share-pack-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.share-pack-head h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
}

.share-pack-head span {
  font-size: 11.5px;
  color: var(--ink-3);
  white-space: nowrap;
}

.share-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.share-selected-count {
  font-size: 12px;
  color: var(--ink-3);
}

.share-selected-count b {
  color: var(--brand-dark);
}

.share-toolbar-actions {
  display: flex;
  gap: 6px;
}

.share-mini-btn {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink-2);
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 11.5px;
  font-family: inherit;
  cursor: pointer;
}

.share-mini-btn:hover {
  border-color: var(--brand);
  color: var(--brand-dark);
}

.share-image-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.share-image {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 1;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 10px;
  overflow: hidden;
  background: #f2f4f6;
  cursor: pointer;
  transition: border-color .18s ease, transform .18s ease;
}

.share-image.is-selected {
  border-color: var(--brand);
}

.share-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.share-check {
  position: absolute;
  left: 5px;
  top: 5px;
  width: 19px;
  height: 19px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  background: var(--brand);
  opacity: 0;
  transform: scale(.7);
  transition: all .18s ease;
}

.share-image.is-selected .share-check {
  opacity: 1;
  transform: scale(1);
}

.share-zoom {
  position: absolute;
  right: 5px;
  bottom: 5px;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 10px;
  color: #fff;
  background: rgba(0, 0, 0, .42);
  backdrop-filter: blur(4px);
}

.share-copy-title {
  margin: 14px 0 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-2);
}

.share-copy-list {
  display: grid;
  gap: 8px;
}

.share-copy {
  display: flex;
  gap: 9px;
  width: 100%;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fcfdfd;
  color: var(--ink-2);
  text-align: left;
  font-family: inherit;
  font-size: 12.5px;
  line-height: 1.65;
  cursor: pointer;
  transition: border-color .18s ease, background .18s ease;
}

.share-copy.is-selected {
  border-color: var(--brand);
  background: var(--brand-light);
}

.share-radio {
  flex: 0 0 16px;
  width: 16px;
  height: 16px;
  margin-top: 3px;
  border: 2px solid #cbd1d6;
  border-radius: 50%;
  position: relative;
}

.share-copy.is-selected .share-radio {
  border-color: var(--brand);
}

.share-copy.is-selected .share-radio::after {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: var(--brand);
}

.share-copy-text {
  min-width: 0;
  word-break: break-word;
}

.share-pack-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 13px;
}

.share-pack-actions .btn {
  padding-left: 8px;
  padding-right: 8px;
  font-size: 13px;
}

/* ---------------- 小屏适配 ---------------- */

@media (max-width: 360px) {
  .page { padding: 16px 12px 26px; }
  .card { padding: 18px 14px; }
  .qrcode-box { width: 190px; height: 190px; }
  .poster-grid { gap: 10px; }
  .group-name { font-size: 17.5px; }
}

@media (min-width: 560px) {
  .page { padding-top: 34px; }
  .card { padding: 26px 24px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
