:root {
  color-scheme: light;
  --bg: #f4f6fb;
  --surface: #ffffff;
  --text: #111827;
  --subtle: #6b7280;
  --line: #e5e7eb;
  --brand: #2152ff;
  --brand-soft: #eaf0ff;
  --success: #047857;
  --shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
}

*:not(input):not(textarea) { box-sizing: border-box; }
body { margin: 0; font-family: "Segoe UI", "PingFang SC", sans-serif; background: var(--bg); color: var(--text); }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; }

.shell { min-height: 100vh; padding-bottom: 88px; }
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; background: rgba(255,255,255,0.92); backdrop-filter: blur(14px); border-bottom: 1px solid rgba(229,231,235,0.9);
}
.brand-title { font-size: 18px; font-weight: 700; }
.brand-subtitle { font-size: 12px; color: var(--subtle); margin-top: 2px; }
.ghost-btn, .primary-btn, .outline-btn { border: 0; border-radius: 10px; padding: 10px 14px; cursor: pointer; }
.ghost-btn { background: var(--brand-soft); color: var(--brand); }
.primary-btn { background: var(--brand); color: #fff; }
.outline-btn { background: transparent; color: var(--brand); border: 1px solid rgba(33,82,255,0.24); }
.page { max-width: 1180px; margin: 0 auto; padding: 20px 16px 32px; }
.hero { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 18px; align-items: stretch; }
.hero-main, .hero-side, .section, .case-card, .package-card, .service-card, .order-card, .profile-card, .login-card, .modal-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow);
}
.hero-main { padding: 28px; background: linear-gradient(135deg, #0f172a, #1d4ed8); color: #fff; }
.hero-main p, .hero-main span { color: rgba(255,255,255,0.82); }
.hero-side { padding: 24px; }
.hero-title { font-size: 34px; line-height: 1.15; margin: 0 0 12px; }
.hero-points { display: flex; gap: 28px; flex-wrap: wrap; margin-bottom: 18px; font-size: 15px; font-weight: 600; }
.hero-actions, .inline-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.inline-actions input { flex: 1; min-width: 160px; }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 12px; margin-top: 20px; }
.stat { padding: 14px; border-radius: 8px; background: rgba(255,255,255,0.1); }
.stat strong { display: block; font-size: 22px; margin-bottom: 6px; }
.grid-2, .grid-5, .profile-wrap, .orders-wrap, .detail-list { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.grid-5 { grid-template-columns: repeat(5, minmax(0,1fr)); }
.packages-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 16px; }
.section { margin-top: 20px; padding: 20px; overflow: hidden; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.section-title { margin: 0; font-size: 24px; }
.section-note, .muted, .menu-sub, .detail-row small { color: var(--subtle); font-size: 14px; }
.menu-item, .service-card, .order-card, .profile-card, .login-card { padding: 18px; }
.menu-item { border: 1px solid var(--line); border-radius: 8px; background: #fbfcff; text-align: left; }
.menu-icon { font-size: 24px; margin-bottom: 12px; }
.menu-title, .case-title, .package-title { font-size: 18px; font-weight: 700; margin-bottom: 8px; }
.case-card, .package-card { overflow: hidden; min-width: 260px; }
.cover { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; display: block; background: #dbe4ff; }
.cover.placeholder { display: grid; place-items: center; font-size: 34px; font-weight: 700; color: var(--brand); }
.case-body, .package-body { padding: 16px; }
.package-body { display: grid; gap: 10px; align-content: start; }
.package-body p { margin: 0; line-height: 1.7; }
.amount { font-size: 28px; font-weight: 800; }
.tag { display: inline-flex; align-items: center; padding: 5px 10px; border-radius: 999px; background: var(--brand-soft); color: var(--brand); font-size: 12px; font-weight: 700; }
.price-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-top: 6px; flex-wrap: wrap; }
.price { font-size: 30px; font-weight: 800; }
.price-row .primary-btn { flex: 0 0 auto; white-space: nowrap; min-width: 112px; text-align: center; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; }
.field { display: flex; flex-direction: column; gap: 8px; }
.field input, .field textarea, .field select { width: 100%; border: 1px solid #d0d5dd; border-radius: 8px; padding: 12px 14px; background: #fff; }
.field textarea { min-height: 120px; resize: vertical; }
.field.full { grid-column: 1 / -1; }
.service-card { display: grid; grid-template-columns: 1fr auto; gap: 18px; align-items: center; }
.detail-row { display: flex; justify-content: space-between; gap: 16px; padding-bottom: 10px; border-bottom: 1px dashed var(--line); }
.detail-row:last-child { border-bottom: 0; padding-bottom: 0; }
.title-row { display: flex; justify-content: space-between; gap: 16px; align-items: center; margin-bottom: 12px; }
.status { padding: 6px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.status.pending { background: #fff4e5; color: #b54708; }
.status.paid { background: #e8fff2; color: var(--success); }
.status.failed { background: #ffe8e8; color: #b42318; }
.empty { padding: 28px; text-align: center; color: var(--subtle); border: 1px dashed var(--line); border-radius: 8px; }
.tabs { position: fixed; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 1px; background: rgba(15,23,42,0.08); border-top: 1px solid rgba(229,231,235,0.8); backdrop-filter: blur(14px); }
.tab-btn { background: rgba(255,255,255,0.95); border: 0; padding: 10px 8px 12px; cursor: pointer; color: var(--subtle); display: grid; gap: 4px; justify-items: center; align-content: center; }
.tab-btn.active { color: var(--brand); font-weight: 700; }
.tab-icon { width: 22px; height: 22px; line-height: 1; }
.tab-icon svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tab-label { font-size: 13px; line-height: 1.2; }
.service-badge { display: inline-flex; align-items: center; gap: 7px; margin: 10px 0 14px; font-size: 13px; font-weight: 700; }
.service-badge span { width: 8px; height: 8px; border-radius: 50%; background: #9ca3af; }
.service-badge.online { color: #16803c; }
.service-badge.online span { background: #20a35a; }
.service-badge.offline { color: #6b7280; }
.service-agent-mark { display: inline-block; margin-left: 8px; padding: 4px 8px; border: 1px solid #bfdbfe; border-radius: 999px; color: #1d4ed8; font-size: 12px; }
.official-service-badge { display: inline-flex; align-items: center; gap: 4px; margin-left: 6px; padding: 2px 9px; border: 1px solid #f6c453; border-radius: 999px; background: linear-gradient(135deg, #fde68a 0%, #f59e0b 100%); color: #7c2d12; font-size: 11px; font-weight: 800; letter-spacing: .04em; box-shadow: 0 1px 3px rgba(245,158,11,.35); vertical-align: middle; }
.official-service-badge::before { content: '★'; font-size: 10px; }
.announce-box { margin-top: 14px; padding: 12px 14px; border: 1px solid #fde68a; border-radius: 8px; background: #fffbeb; }
.announce-title { margin-bottom: 8px; color: #b45309; font-size: 13px; font-weight: 800; }
.announce-item { padding: 8px 0; border-top: 1px dashed #fcd34d; }
.announce-item:first-of-type { border-top: 0; }
.announce-item strong { display: block; margin-bottom: 4px; color: #92400e; font-size: 13px; }
.announce-item p { margin: 0; color: #78350f; font-size: 13px; line-height: 1.6; white-space: pre-wrap; }
.contact-human-btn { margin-top: 8px; padding: 6px 14px; border: 0; border-radius: 999px; background: linear-gradient(135deg, #f59e0b, #d97706); color: #fff; font-size: 12px; font-weight: 700; cursor: pointer; }
.contact-human-btn:hover { filter: brightness(1.05); }
.global-toast { position: fixed; inset: 0; display: grid; place-items: center; opacity: 0; pointer-events: none; transition: opacity .2s ease; z-index: 9999; }
.global-toast.show { opacity: 1; }
.global-toast::before { content: ''; position: absolute; inset: 0; background: rgba(15,23,42,.28); }
.toast-card { position: relative; width: min(320px, 78vw); padding: 26px 22px 22px; border-radius: 18px; background: #fff; text-align: center; box-shadow: 0 24px 60px rgba(15,23,42,.28); transform: translateY(10px) scale(.94); transition: transform .2s ease; }
.global-toast.show .toast-card { transform: translateY(0) scale(1); }
.toast-icon { position: relative; width: 92px; height: 92px; margin: 0 auto 14px; display: grid; place-items: center; border-radius: 50%; font-size: 54px; line-height: 1; }
.toast-card.success .toast-icon { background: #dcfce7; }
.toast-card.error .toast-icon { background: #fee2e2; }
.toast-face { line-height: 1; }
.toast-mark { position: absolute; right: 0; bottom: 0; width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; color: #fff; font-size: 21px; font-weight: 800; border: 3px solid #fff; }
.toast-card.success .toast-mark { background: #16a34a; }
.toast-card.error .toast-mark { background: #dc2626; }
.toast-text { color: #111827; font-size: 15px; font-weight: 600; line-height: 1.55; word-break: break-word; }
.site-footer { margin-top: 28px; padding: 22px 16px 8px; text-align: center; color: #9ca3af; font-size: 13px; line-height: 1.9; }
.footer-docs { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 14px; margin-bottom: 10px; }
.footer-docs button { border: 0; padding: 0; background: transparent; color: #6b7280; font-size: 13px; cursor: pointer; }
.footer-docs button:hover { color: var(--brand); }
.footer-line { color: #9ca3af; }
.footer-copy { margin-top: 2px; color: #b0b6c0; }
.doc-body { display: grid; gap: 14px; }
.doc-block h3 { margin: 0 0 6px; font-size: 15px; color: #111827; }
.doc-block p { margin: 0; color: #4b5563; font-size: 14px; line-height: 1.8; }
.chat-panel { margin-top: 18px; padding: 16px; border: 1px solid var(--line); border-radius: 8px; background: #f8fafc; }
.service-directory { display: grid; gap: 14px; }
.service-list { display: grid; gap: 8px; max-width: 760px; }
.service-list-item { display: grid; grid-template-columns: 46px 1fr auto; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 8px; background: #fff; text-align: left; cursor: pointer; }
.service-list-item.selected { border-color: #2563eb; box-shadow: 0 0 0 2px #dbeafe; }
.service-list-item:disabled { cursor: not-allowed; opacity: .6; }
.service-avatar, .avatar-mini { display: grid; place-items: center; width: 42px; height: 42px; overflow: hidden; border-radius: 50%; background: #dbeafe; color: #1d4ed8; font-weight: 700; }
.service-avatar img { width: 100%; height: 100%; object-fit: cover; }
.service-list-copy { display: grid; gap: 5px; }
.service-list-copy strong { display: flex; align-items: center; gap: 8px; }
.service-list-copy em { padding: 2px 6px; border-radius: 999px; background: linear-gradient(135deg, #fde68a 0%, #f59e0b 100%); color: #7c2d12; font-size: 11px; font-style: normal; font-weight: 800; }
.service-list-copy small { color: var(--subtle); }
.service-chevron { font-size: 25px; color: var(--subtle); }
.service-workspace { display: grid; grid-template-columns: 280px 1fr; min-height: 560px; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #fff; }
.conversation-sidebar { border-right: 1px solid var(--line); background: #f8fafc; }
.service-sidebar-head { display: flex; justify-content: space-between; align-items: center; padding: 14px; border-bottom: 1px solid var(--line); }
.conversation-sidebar .chat-list-item { width: 100%; border: 0; border-radius: 0; background: transparent; }
.conversation-sidebar .chat-list-item.selected { background: #e0edff; box-shadow: none; }
.chat-list-copy { display: grid; gap: 3px; text-align: left; }
.chat-list-copy small { color: var(--subtle); }
.service-chat-main { margin: 0; min-width: 0; border: 0; border-radius: 0; background: #fff; }
.chat-tools { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; align-items: stretch; }
.tool-btn { display: inline-flex; align-items: center; justify-content: center; min-height: 42px; padding: 0 10px; border: 1px solid var(--line); border-radius: 6px; background: #fff; color: var(--text); cursor: pointer; font-size: 13px; }
.tool-btn input { display: none; }
.chat-compose { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin-top: 8px; }
.chat-call { padding: 10px; background: #ecfdf5; color: #047857; border-radius: 6px; font-weight: 700; }
.private-chat-page { display: grid; gap: 12px; max-width: 860px; margin: 0 auto; }
.private-chat-page .service-chat-main { min-height: 620px; display: grid; grid-template-rows: auto 1fr auto; }
.private-chat-page .chat-messages { max-height: none; min-height: 360px; padding: 12px 0; }
.service-directory-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.chat-title { font-weight: 700; margin-bottom: 12px; }
.chat-messages { display: grid; gap: 10px; max-height: 360px; overflow: auto; }
.chat-message { display: flex; gap: 8px; align-items: flex-start; width: min(88%, 560px); }
.chat-message.mine { justify-self: end; flex-direction: row-reverse; }
.chat-avatar { flex: 0 0 auto; width: 34px; height: 34px; display: grid; place-items: center; overflow: hidden; border-radius: 50%; background: #e0e7ff; color: #3730a3; font-size: 14px; font-weight: 700; }
.chat-avatar img { width: 100%; height: 100%; object-fit: cover; }
.chat-avatar.service { background: linear-gradient(135deg, #fde68a, #f59e0b); color: #7c2d12; }
.chat-body { flex: 1 1 auto; min-width: 0; padding: 10px 12px; border-radius: 8px; background: #fff; border: 1px solid var(--line); }
.chat-message.mine .chat-body { background: #eff6ff; border-color: #bfdbfe; }
.chat-author { margin-bottom: 4px; color: var(--subtle); font-size: 12px; font-weight: 700; }
.chat-message time { display: block; margin-top: 6px; color: var(--subtle); font-size: 11px; }
.chat-form { display: grid; gap: 10px; margin-top: 14px; }
.chat-form select { min-height: 42px; }
.chat-compose input[name="message"] { min-height: 52px; padding: 0 14px; font-size: 15px; }
.chat-form > .primary-btn { min-height: 44px; }
.chat-list { display: grid; gap: 8px; margin-top: 14px; }
.chat-list-item { display: flex; justify-content: space-between; padding: 10px 12px; border: 1px solid var(--line); background: #fff; border-radius: 8px; text-align: left; cursor: pointer; }
.chat-list-item span { color: var(--subtle); font-size: 12px; }
.chat-media { display: block; max-width: min(240px, 100%); max-height: 240px; border-radius: 6px; object-fit: contain; }
.chat-order { padding: 10px; background: #eff6ff; color: #1d4ed8; border-radius: 6px; font-weight: 700; }
.profile-avatar { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; border: 1px solid var(--line); margin-bottom: 8px; }
.profile-avatar-fallback { display: grid; place-items: center; background: #e0e7ff; color: #3730a3; font-weight: 700; }
.profile-edit-form { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.login-layout { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card { width: min(460px, 100%); }
.modal { position: fixed; inset: 0; background: rgba(15,23,42,0.48); display: none; align-items: center; justify-content: center; padding: 20px; }
.modal.open { display: flex; }
.modal-card { width: min(720px, 100%); max-height: 90vh; overflow: auto; }
.modal-head, .modal-body { padding: 18px 20px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--line); }
.notice { margin-top: 12px; padding: 12px 14px; border-radius: 8px; background: #fff7ed; color: #9a3412; font-size: 14px; }
.marquee-track-wrap { overflow: hidden; }
.marquee-track { display: flex; gap: 16px; width: max-content; animation: marquee 38s linear infinite; }
.marquee-section:hover .marquee-track { animation-play-state: paused; }
.marquee-card { width: 290px; flex: 0 0 auto; }
.order-layout, .agent-layout { display: grid; grid-template-columns: auto 1fr; gap: 16px; align-items: start; }
.order-logo { width: 88px; height: 88px; border-radius: 8px; object-fit: cover; border: 1px solid var(--line); }
.agent-qr { width: 220px; height: 220px; border-radius: 8px; border: 1px solid var(--line); background: #fff; }
.codepay-box { margin-top: 18px; padding: 16px; border: 1px solid var(--line); border-radius: 10px; background: #fafcff; }
.codepay-qr { display: block; width: min(280px, 100%); aspect-ratio: 1 / 1; object-fit: contain; margin: 16px auto 0; border-radius: 8px; border: 1px solid var(--line); background: #fff; }
.group-image { width: min(420px, 100%); border-radius: 8px; border: 1px solid var(--line); display: block; }
.link-wrap { word-break: break-all; text-align: right; }
.slim { padding: 14px; }
.delivery-card { max-width: 760px; margin: 40px auto 0; padding: 28px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); }
.delivery-title { margin: 14px 0 10px; font-size: 30px; line-height: 1.2; }
.delivery-text { color: var(--subtle); line-height: 1.8; }
.delivery-countdown { margin-top: 18px; font-size: 40px; font-weight: 800; color: var(--brand); }
.delivery-result { margin-top: 22px; padding: 18px; border-radius: 8px; background: #f8fbff; border: 1px solid #dbe4ff; }
.delivery-link { word-break: break-all; text-align: right; }
.copy-inline { display: inline-flex; align-items: center; justify-content: flex-end; gap: 8px; max-width: 100%; }
.copy-value { word-break: break-all; text-align: right; }
.mini-copy-btn { border: 1px solid rgba(33,82,255,0.2); background: #fff; color: var(--brand); border-radius: 8px; padding: 4px 10px; cursor: pointer; flex: 0 0 auto; }
.grid-5::-webkit-scrollbar { height: 6px; }
.grid-5::-webkit-scrollbar-thumb { background: rgba(33,82,255,0.2); border-radius: 999px; }

@keyframes marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

@media (max-width: 960px) {
  .hero, .service-card, .form-grid, .order-layout, .agent-layout { grid-template-columns: 1fr; }
  .service-workspace { grid-template-columns: 1fr; }
  .conversation-sidebar { border-right: 0; border-bottom: 1px solid var(--line); max-height: 240px; overflow: auto; }
  .hero-title { font-size: 28px; }
  .marquee-card { width: 250px; }
  .page { padding: 16px 12px 28px; }
  .section { padding: 16px; }
  .grid-5 {
    grid-auto-flow: column;
    grid-auto-columns: minmax(148px, 58vw);
    overflow-x: auto;
    overflow-y: hidden;
    align-items: stretch;
    padding-bottom: 6px;
    scroll-snap-type: x proximity;
  }
  .grid-5 > * { scroll-snap-align: start; }
  .packages-grid { grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; }
  .package-card, .menu-item { min-height: 100%; min-width: 0; }
  .service-card { align-items: start; }
  .chat-tools { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .login-layout { padding: 16px; }
  .login-card { width: min(720px, 100%); }
}
