:root {
  --blue: #2b6de8;
  --blue-dark: #1e57c7;
  --blue-soft: #e8f0fe;
  --ink: #23262d;
  --muted: #8a8f99;
  --muted-light: #b8bdc7;
  --line: #edf0f4;
  --page: #f5f6fa;
  --card: #ffffff;
  --danger: #e1251b;
  --danger-soft: #fff4f4;
  --success: #1a9e4b;
  --success-soft: #eefbf2;
  --warning: #b66b00;
  --warning-soft: #fff7e8;
  --shadow: 0 8px 28px rgba(35, 54, 93, .06);
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--page); }
body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background: var(--page);
  font: 15px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .58; }
:focus-visible { outline: 3px solid rgba(43, 109, 232, .34); outline-offset: 2px; }

.skip-link {
  position: fixed; z-index: 100; top: -50px; left: 16px; padding: 8px 12px;
  border-radius: 8px; color: #fff; background: var(--blue); transition: top .15s ease;
}
.skip-link:focus { top: 12px; }

.site-header {
  position: sticky; z-index: 20; top: 0; color: #fff;
  background: var(--blue); box-shadow: 0 2px 12px rgba(31, 80, 170, .18);
}
.header-inner {
  width: min(1120px, calc(100% - 40px)); height: 68px; margin: 0 auto;
  display: flex; align-items: center; gap: 28px;
}
.brand-mark { display: flex; align-items: baseline; gap: 8px; white-space: nowrap; }
.brand-name { font-size: 23px; font-weight: 750; letter-spacing: .02em; }
.brand-en { font-size: 11px; font-weight: 700; letter-spacing: .12em; opacity: .78; }
.brand-slogan { margin-left: 4px; font-size: 12px; opacity: .72; }
.desktop-nav { display: flex; align-self: stretch; align-items: center; gap: 6px; margin-left: auto; }
.desktop-nav a {
  position: relative; display: flex; align-items: center; height: 100%; padding: 0 15px;
  color: rgba(255,255,255,.75); font-size: 14px; transition: color .15s ease;
}
.desktop-nav a:hover, .desktop-nav a.active { color: #fff; }
.desktop-nav a.active::after {
  content: ""; position: absolute; left: 15px; right: 15px; bottom: 0; height: 3px;
  border-radius: 3px 3px 0 0; background: #fff;
}
.header-service {
  border: 1px solid rgba(255,255,255,.38); border-radius: 18px; padding: 7px 14px;
  color: #fff; background: rgba(255,255,255,.11); font-size: 13px; white-space: nowrap;
}
.header-service:hover { background: rgba(255,255,255,.2); }

.app-shell { width: min(1120px, calc(100% - 40px)); margin: 0 auto; padding: 28px 0 72px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
.page-title { margin: 0; font-size: 25px; line-height: 1.25; font-weight: 720; }
.page-subtitle { margin: 6px 0 0; color: var(--muted); font-size: 13px; }
.page-head-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.card {
  margin-bottom: 16px; padding: 20px; border: 1px solid rgba(224, 229, 239, .74);
  border-radius: 14px; background: var(--card); box-shadow: var(--shadow);
}
.card-title { margin: 0 0 14px; font-size: 17px; font-weight: 680; }
.card-title small { margin-left: 6px; color: var(--muted); font-size: 12px; font-weight: 400; }
.hint { color: var(--muted); font-size: 13px; }
.muted { color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

.activity-hero { margin-bottom: 18px; }
.activity-brand { display: flex; align-items: baseline; gap: 9px; }
.activity-brand strong { color: var(--blue); font-size: 30px; line-height: 1.2; }
.activity-brand span { color: var(--muted); font-size: 12px; letter-spacing: .12em; }
.activity-hero p { margin: 7px 0 0; color: var(--muted); font-size: 14px; }
.search-form { display: flex; gap: 10px; margin-top: 18px; }
.search-input-wrap { position: relative; flex: 1; }
.search-input-wrap::before { content: "⌕"; position: absolute; left: 15px; top: 8px; color: var(--muted); font-size: 21px; line-height: 1; }
.search-input {
  width: 100%; height: 44px; padding: 0 14px 0 43px; border: 1px solid #e1e6ef; border-radius: 12px;
  color: var(--ink); background: #fbfcfe; outline: none; transition: border-color .15s ease, box-shadow .15s ease;
}
.search-input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(43,109,232,.1); }
.search-input::placeholder { color: var(--muted-light); }
.category-strip { display: flex; gap: 8px; overflow-x: auto; padding: 1px 1px 5px; scrollbar-width: thin; }
.category-strip::-webkit-scrollbar { height: 4px; }
.category-strip::-webkit-scrollbar-thumb { background: #d5dce8; border-radius: 4px; }
.category-chip {
  flex: 0 0 auto; padding: 7px 14px; border: 1px solid #e1e6ef; border-radius: 18px;
  color: #565d69; background: #fff; font-size: 13px; white-space: nowrap;
}
.category-chip:hover { border-color: #b8cdf5; color: var(--blue); }
.category-chip.active { border-color: var(--blue); color: var(--blue); background: var(--blue-soft); font-weight: 600; }
.notice { margin: 13px 1px 0; color: var(--muted); font-size: 12px; }
.notice::first-letter { color: var(--blue); }

.feed-layout { display: grid; grid-template-columns: minmax(0, 1fr) 270px; gap: 18px; align-items: start; }
.feed-main { min-width: 0; }
.feed-side { position: sticky; top: 86px; }
.side-card { padding: 18px; }
.side-card + .side-card { margin-top: 14px; }
.side-card h2 { margin: 0 0 8px; font-size: 16px; }
.side-card p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.65; }
.side-link { display: flex; align-items: center; justify-content: space-between; width: 100%; padding: 11px 0 0; border: 0; color: var(--blue); background: none; text-align: left; font-size: 13px; }
.side-link::after { content: "›"; color: var(--muted-light); font-size: 20px; }

.deal-card { padding: 20px; }
.deal-card + .deal-card { margin-top: 14px; }
.deal-head { display: flex; align-items: center; gap: 11px; min-width: 0; }
.avatar {
  display: flex; align-items: center; justify-content: center; flex: 0 0 42px; width: 42px; height: 42px;
  border-radius: 50%; color: #b52b20; background: #e8f0fe; font-size: 20px; font-weight: 720;
}
.head-mid { min-width: 0; flex: 1; }
.deal-source { overflow: hidden; color: #303641; font-size: 14px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.deal-time { margin-top: 2px; color: var(--muted); font-size: 12px; }
.tag { flex: 0 0 auto; padding: 4px 9px; border-radius: 7px; color: var(--blue); background: var(--blue-soft); font-size: 11px; }
.deal-title-link { display: block; margin-top: 15px; color: var(--ink); font-size: 18px; font-weight: 680; line-height: 1.45; }
.deal-title-link:hover { color: var(--blue); }
.deal-content { margin-top: 12px; color: #363b44; font-size: 14px; line-height: 1.78; word-break: break-word; }
.content-line { min-height: 1.78em; white-space: pre-wrap; }
.content-link, .deal-content a { color: #1677ff; text-decoration: none; word-break: break-all; }
.content-link:hover, .deal-content a:hover { text-decoration: underline; }
.content-amount { color: #1677ff; font-weight: 700; }
.deal-thumb { display: block; width: 100%; max-height: 420px; margin-top: 15px; border-radius: 10px; object-fit: cover; background: #f0f2f6; }
.deal-products-mini { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 13px; }
.product-pill { max-width: 100%; padding: 5px 9px; border-radius: 7px; color: #555e6e; background: #f5f6f8; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.product-pill strong { color: var(--danger); font-weight: 650; }
.deal-actions { display: flex; gap: 8px; margin-top: 17px; padding-top: 15px; border-top: 1px solid var(--line); }
.action-btn, .btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 36px; padding: 7px 13px;
  border: 1px solid #dce2ec; border-radius: 9px; color: #535b68; background: #fff; font-size: 13px; line-height: 1.2;
}
.action-btn { flex: 1 1 0; min-width: 0; white-space: nowrap; }
.action-btn:hover, .btn:hover { border-color: #b8cdf5; color: var(--blue); background: #fbfdff; }
.action-btn.primary, .btn.primary { border-color: var(--blue); color: #fff; background: var(--blue); }
.action-btn.primary:hover, .btn.primary:hover { border-color: var(--blue-dark); background: var(--blue-dark); }
.action-btn.fav-on { border-color: #f5c277; color: #bd7100; background: #fff8ec; }
.action-btn.danger, .btn.danger { border-color: #ffd5d2; color: var(--danger); background: var(--danger-soft); }
.action-btn.icon-only { flex: 0 0 auto; width: 38px; padding: 7px; }
.load-more-wrap { display: flex; justify-content: center; margin: 18px 0 4px; }
.load-state { padding: 28px 10px; color: var(--muted); text-align: center; font-size: 13px; }
.load-state.error { color: var(--danger); }
.empty-state { padding: 62px 20px; color: var(--muted); text-align: center; }
.empty-icon { display: block; margin-bottom: 9px; color: #b7c0cf; font-size: 42px; }
.empty-state strong { display: block; color: #606873; font-size: 16px; font-weight: 600; }
.empty-state p { margin: 7px 0 0; font-size: 13px; }

.detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) 270px; gap: 18px; align-items: start; }
.detail-main { min-width: 0; }
.back-link { display: inline-flex; align-items: center; gap: 5px; margin-bottom: 13px; color: var(--blue); font-size: 13px; }
.back-link::before { content: "‹"; font-size: 22px; line-height: .7; }
.detail-card { padding: 24px; }
.detail-card .deal-title-link { margin-top: 18px; font-size: 24px; }
.detail-content { font-size: 15px; line-height: 1.9; }
.detail-images { display: grid; gap: 12px; margin-top: 18px; }
.detail-image { display: block; width: 100%; max-height: 620px; border-radius: 10px; object-fit: contain; background: #f3f5f8; cursor: zoom-in; }
.section-label { margin: 0 0 12px; font-size: 17px; font-weight: 680; }
.product-row { display: flex; align-items: center; gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.product-row:last-child { border-bottom: 0; padding-bottom: 0; }
.product-info { min-width: 0; flex: 1; }
.product-name { color: #343943; font-size: 14px; font-weight: 550; word-break: break-word; }
.product-price { margin-top: 4px; color: var(--danger); font-size: 14px; font-weight: 650; }
.product-payment { color: var(--muted); font-size: 12px; font-weight: 400; }
.product-pin { flex: 0 0 auto; min-width: 88px; }
.link-list { display: grid; gap: 8px; }
.link-row { display: flex; align-items: center; gap: 8px; padding: 10px 11px; border: 1px solid var(--line); border-radius: 8px; background: #fbfcfe; }
.link-row span { flex: 1; min-width: 0; overflow: hidden; color: #1677ff; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.link-row button { flex: 0 0 auto; padding: 3px 8px; border: 0; color: var(--blue); background: none; font-size: 12px; }
.detail-side .card { padding: 18px; }
.detail-side h2 { margin: 0 0 10px; font-size: 16px; }
.detail-side p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.65; }

.order-layout { display: grid; grid-template-columns: minmax(0, 1fr) 310px; gap: 18px; align-items: start; }
.order-form-row { display: flex; gap: 9px; }
.text-input { width: 100%; height: 44px; padding: 0 13px; border: 1px solid #e0e5ed; border-radius: 10px; color: var(--ink); background: #fbfcfe; outline: none; }
.text-input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(43,109,232,.1); }
.order-form-row .text-input { flex: 1; min-width: 0; }
.order-result { margin-top: 15px; padding: 14px; border-radius: 10px; line-height: 1.65; font-size: 14px; word-break: break-word; }
.order-result.ok { color: var(--success); background: var(--success-soft); }
.order-result.warn { color: var(--danger); background: var(--danger-soft); }
.result-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 9px; }
.record-list { display: grid; gap: 0; }
.record-row { display: flex; align-items: flex-start; gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.record-row:last-child { border-bottom: 0; padding-bottom: 0; }
.record-main { min-width: 0; flex: 1; }
.record-id { font-size: 14px; font-weight: 600; }
.record-text { margin-top: 3px; color: #4f5661; font-size: 12px; word-break: break-word; }
.record-text.ok { color: var(--success); }
.record-text.warn { color: var(--danger); }
.record-time { flex: 0 0 auto; color: var(--muted); font-size: 11px; }
.tips { display: grid; gap: 15px; }
.tip { display: flex; gap: 10px; color: #4a4f59; font-size: 13px; line-height: 1.7; }
.tip-number { display: flex; align-items: center; justify-content: center; flex: 0 0 25px; width: 25px; height: 25px; margin-top: 1px; border-radius: 50%; color: var(--blue); background: var(--blue-soft); font-size: 12px; }
.warn-text { color: var(--danger); }

.mine-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 18px; align-items: start; }
.stats-card { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 23px 12px; }
.stat { min-width: 0; text-align: center; }
.stat + .stat { border-left: 1px solid var(--line); }
.stat-num { color: var(--ink); font-size: 28px; font-weight: 720; line-height: 1.2; }
.stat-label { margin-top: 5px; color: var(--muted); font-size: 12px; }
.stats-error { margin: -4px 0 13px; color: var(--danger); font-size: 12px; }
.mine-section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 13px; }
.mine-section-head .card-title { margin: 0; }
.section-action { border: 0; color: var(--blue); background: none; font-size: 12px; }
.fav-list, .history-list { display: grid; gap: 0; }
.fav-row, .history-row { display: flex; align-items: center; gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.fav-row:last-child, .history-row:last-child { border-bottom: 0; padding-bottom: 0; }
.fav-main, .history-main { min-width: 0; flex: 1; }
.fav-name, .history-name { overflow: hidden; color: #343943; font-size: 14px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.fav-meta, .history-meta { margin-top: 3px; color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fav-price { flex: 0 0 auto; color: var(--danger); font-size: 13px; font-weight: 650; }
.row-actions { display: flex; flex: 0 0 auto; gap: 4px; }
.row-action { padding: 5px 6px; border: 0; color: var(--blue); background: none; font-size: 12px; }
.row-action.danger { color: var(--danger); }
.calculator-summary { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; }
.calculator-summary strong { display: block; color: var(--danger); font-size: 30px; line-height: 1.2; }
.calculator-summary span { color: var(--muted); font-size: 12px; }
.summary-actions { display: flex; flex-wrap: wrap; gap: 7px; justify-content: flex-end; }
.quick-links { display: grid; gap: 3px; }
.quick-link { display: flex; align-items: center; justify-content: space-between; width: 100%; padding: 12px 0; border: 0; border-bottom: 1px solid var(--line); color: #343943; background: none; text-align: left; }
.quick-link:last-child { border-bottom: 0; }
.quick-link::after { content: "›"; color: var(--muted-light); font-size: 20px; }
.quick-link:hover { color: var(--blue); }
.empty-inline { padding: 20px 0 4px; color: var(--muted); text-align: center; font-size: 13px; }

.service-modal, .lightbox-modal { position: fixed; z-index: 50; inset: 0; display: flex; align-items: center; justify-content: center; padding: 20px; background: rgba(21, 29, 44, .52); }
.service-dialog { width: min(420px, 100%); padding: 25px; border-radius: 16px; background: #fff; text-align: center; box-shadow: 0 18px 50px rgba(0,0,0,.2); }
.modal-title { margin: 0; font-size: 20px; font-weight: 700; }
.modal-sub { margin: 7px 0 0; color: var(--muted); font-size: 13px; }
.service-qr { display: block; width: min(300px, 80vw); height: min(300px, 80vw); margin: 20px auto; border-radius: 8px; object-fit: contain; background: #f5f6fa; }
.modal-close { width: 100%; }
.modal-empty { padding: 25px 10px 19px; color: var(--muted); font-size: 14px; }
.lightbox-modal img { max-width: min(1100px, 94vw); max-height: 90vh; border-radius: 8px; object-fit: contain; background: #fff; }
.modal-dismiss { position: absolute; top: 16px; right: 18px; width: 36px; height: 36px; border: 0; border-radius: 50%; color: #fff; background: rgba(0,0,0,.35); font-size: 22px; }
.toast { position: fixed; z-index: 80; left: 50%; bottom: 28px; transform: translate(-50%, 15px); max-width: min(420px, calc(100% - 36px)); padding: 10px 17px; border-radius: 20px; color: #fff; background: rgba(25, 30, 42, .9); font-size: 13px; opacity: 0; pointer-events: none; transition: opacity .18s ease, transform .18s ease; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.error-banner { margin-bottom: 15px; padding: 12px 14px; border: 1px solid #ffd6d2; border-radius: 9px; color: var(--danger); background: var(--danger-soft); font-size: 13px; }
.skeleton { height: 110px; border-radius: 14px; background: linear-gradient(90deg, #eef1f6, #f8f9fb, #eef1f6); background-size: 200% 100%; animation: shimmer 1.2s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

.bottom-nav { display: none; }

@media (max-width: 900px) {
  .feed-layout, .detail-grid, .order-layout, .mine-layout { grid-template-columns: 1fr; }
  .feed-side, .detail-side { position: static; }
  .feed-side { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
  .side-card + .side-card { margin-top: 0; }
}

@media (max-width: 680px) {
  body { font-size: 14px; padding-bottom: 62px; }
  .header-inner { width: calc(100% - 28px); height: 58px; gap: 12px; }
  .brand-name { font-size: 20px; }
  .brand-slogan { display: none; }
  .desktop-nav { display: none; }
  .header-service { margin-left: auto; padding: 6px 10px; font-size: 12px; }
  .app-shell { width: calc(100% - 24px); padding: 18px 0 26px; }
  .page-head { align-items: flex-start; flex-direction: column; gap: 12px; }
  .page-title { font-size: 22px; }
  .card, .deal-card, .detail-card { padding: 16px; border-radius: 12px; }
  .activity-brand strong { font-size: 26px; }
  .search-form { gap: 7px; }
  .search-form .btn { padding-left: 12px; padding-right: 12px; }
  .deal-title-link { font-size: 17px; }
  .deal-content { font-size: 14px; }
  .deal-actions { gap: 6px; }
  .action-btn { padding-left: 7px; padding-right: 7px; font-size: 12px; }
  .feed-side { display: block; }
  .feed-side .side-card + .side-card { margin-top: 12px; }
  .detail-card .deal-title-link { font-size: 21px; }
  .order-form-row { flex-wrap: wrap; }
  .order-form-row .btn.primary { width: 100%; }
  .stats-card { padding: 18px 5px; }
  .stat-num { font-size: 25px; }
  .calculator-summary { align-items: flex-start; flex-direction: column; }
  .summary-actions { justify-content: flex-start; }
  .bottom-nav {
    position: fixed; z-index: 25; right: 0; bottom: 0; left: 0; display: flex; height: 61px;
    padding-bottom: env(safe-area-inset-bottom); border-top: 1px solid #e5e8ee; background: rgba(255,255,255,.96); backdrop-filter: blur(12px);
  }
  .bottom-nav a { display: flex; align-items: center; justify-content: center; flex: 1; flex-direction: column; gap: 1px; color: var(--muted); font-size: 11px; }
  .bottom-nav a.active { color: var(--blue); font-weight: 600; }
  .nav-icon { font-size: 22px; line-height: 1.05; }
  .toast { bottom: 79px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
