:root { color-scheme: light; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", sans-serif; color: #202a2c; background: #f4f6f6; line-height: 1.6; }
* { box-sizing: border-box; letter-spacing: 0; }
[hidden] { display: none !important; }
body { margin: 0; }
main { max-width: 960px; margin: 0 auto; padding: 0 32px 32px; }
.site-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 28px 0; border-bottom: 1px solid #dce3e3; }
.brand-label { color: #16705c; font-size: 13px; font-weight: 700; }
h1 { font-size: 24px; line-height: 1.4; margin: 3px 0 0; }
h2 { font-size: 23px; line-height: 1.4; margin: 6px 0 12px; }
h3 { font-size: 18px; margin: 0; }
p { margin: 10px 0; }
.site-label, .eyebrow { font-size: 12px; color: #637579; }
.eyebrow { font-weight: 600; }
#auth-section { max-width: 400px; margin: 48px auto 72px; padding: 0; }
.auth-heading { margin-bottom: 26px; }
.auth-switch { display: flex; border-bottom: 1px solid #ccd6d5; margin-bottom: 24px; }
.auth-switch button { flex: 1; border: 0; border-bottom: 3px solid transparent; border-radius: 0; background: transparent; color: #6c7678; }
.auth-switch button[aria-pressed="true"] { color: #126d56; border-bottom-color: #126d56; }
label { display: block; font-size: 14px; font-weight: 600; margin: 0 0 7px; }
input { width: 100%; min-width: 0; min-height: 48px; padding: 11px 13px; border: 1px solid #bac8c7; border-radius: 6px; font: inherit; background: #fff; color: #202a2c; }
input::placeholder { color: #879292; }
#auth-section input { margin-bottom: 20px; }
button, .button { display: inline-block; min-height: 44px; padding: 10px 18px; border: 1px solid #146b55; border-radius: 6px; background: #146b55; color: #fff; font: inherit; font-size: 14px; font-weight: 600; text-align: center; text-decoration: none; cursor: pointer; transition: background .15s; }
button:hover, .button:hover { background: #0f5443; }
button:disabled { cursor: not-allowed; opacity: .5; }
#login-button, #register-button { width: 100%; margin-top: 6px; }
.secondary, #logout { background: transparent; color: #4a5a5b; border-color: #c7d2d1; }
.secondary:hover, #logout:hover { background: #e7eeed; }
:focus-visible { outline: 3px solid #82b6aa; outline-offset: 3px; }
.account-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 24px 0; }
#account { margin: 2px 0 0; font-size: 18px; font-weight: 600; overflow-wrap: anywhere; }
.account-bar > div { min-width: 0; }
#logout { flex-shrink: 0; }
.service-tabs { display: flex; gap: 24px; border-bottom: 1px solid #ccd6d5; }
.service-tabs button { background: none; color: #647273; border: 0; border-bottom: 3px solid transparent; border-radius: 0; padding: 12px 4px; }
.service-tabs button[aria-pressed="true"] { color: #126d56; border-bottom-color: #126d56; }
#member-area section { padding: 30px 0; min-height: 300px; }
#cdk-form { max-width: 460px; margin-top: 26px; }
#cdk-form button { margin-top: 16px; width: 100%; }
#cdk-code { font-family: ui-monospace, monospace; }
.heading, .query-row { display: flex; gap: 12px; align-items: center; justify-content: space-between; }
.heading h2 { margin: 0; }
.heading { margin-bottom: 16px; }
.query-row button { flex-shrink: 0; }
#products { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.product { border: 1px solid #d4dedd; border-radius: 8px; padding: 22px; background: #fff; display: flex; flex-direction: column; align-items: flex-start; }
.product button { margin-top: auto; width: 100%; }
.price { font-size: 26px; font-weight: 700; color: #126d56; }
ul { padding-left: 20px; margin: 8px 0 22px; }
.muted { color: #657173; font-size: 13px; }
#notice:empty { display: none; }
#notice:not(:empty) { padding: 12px 16px; border-left: 3px solid #b68528; background: #fff6e4; font-size: 14px; margin: 20px 0; }
.error { color: #a32922; }
#cdk-message, #products-message, #order-message { font-size: 14px; color: #526365; }
#order-details { margin: 20px 0; border-left: 2px solid #a4c2b9; padding-left: 16px; }
#order-details:empty { display: none; }
#order-details p, .product, #payment-host, #notice, #cdk-message { overflow-wrap: anywhere; }
#payment-host { font-size: 13px; }
footer { border-top: 1px solid #dce3e3; margin-top: 30px; padding-top: 20px; font-size: 12px; color: #7c898a; text-align: center; }
@media (max-width: 540px) {
  main { padding: 0 20px 24px; }
  .site-header { padding: 22px 0; }
  .site-label { display: none; }
  #auth-section { margin: 32px auto 48px; }
  #products { grid-template-columns: minmax(0, 1fr); }
  .query-row { flex-direction: column; align-items: stretch; }
  .service-tabs { gap: 0; }
  .service-tabs button { flex: 1; padding-inline: 8px; }
}

.order-row {
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 10px;
  padding: 0.85rem 1rem;
  margin-bottom: 0.75rem;
}
.order-row-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.35rem;
}
.order-row p { margin: 0.2rem 0; }
.order-row button { margin-top: 0.6rem; }

/* ===== 我的订单（移动优先） ===== */
.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}

.order-tabs{display:flex;gap:8px;overflow-x:auto;-webkit-overflow-scrolling:touch;padding:2px 0 6px}
.order-tabs button{flex:0 0 auto;min-height:44px;padding:0 14px;font-size:14px;border-radius:22px;
  border:1px solid rgba(255,255,255,.18);background:rgba(255,255,255,.04);color:inherit}
.order-tabs button[aria-pressed="true"]{background:rgba(120,170,255,.18);border-color:rgba(120,170,255,.55);font-weight:600}
.order-tabs .order-tab-badge{margin-left:6px;font-size:12px;opacity:.8}

.order-search{margin:8px 0 12px}
.order-search input{min-height:44px;font-size:14px}
.order-search button{min-height:44px;font-size:14px}
.order-filter{display:flex;gap:8px;margin-top:8px;flex-wrap:wrap}
.order-filter button{min-height:44px;padding:0 12px;font-size:14px;border-radius:10px;
  border:1px solid rgba(255,255,255,.18);background:rgba(255,255,255,.04);color:inherit}
.order-filter button[aria-pressed="true"]{background:rgba(120,170,255,.18);border-color:rgba(120,170,255,.55);font-weight:600}

.order-card{display:block;width:100%;text-align:left;border:1px solid rgba(255,255,255,.12);
  border-radius:14px;padding:14px;margin:10px 0;background:rgba(255,255,255,.03);color:inherit}
.order-card:active{background:rgba(255,255,255,.07)}
.order-card-top{display:flex;align-items:center;gap:10px}
.order-card-icon{flex:0 0 auto;width:40px;height:40px;border-radius:10px;display:grid;place-items:center;
  font-size:20px;background:rgba(255,255,255,.07)}
.order-card-title{flex:1 1 auto;min-width:0;font-size:15px;font-weight:600;
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.order-card-amount{font-size:20px;font-weight:700;letter-spacing:.2px}
.order-card-meta{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin-top:8px;font-size:13px}
.order-card-time{font-size:13px;opacity:.72}
.order-card-actions{display:flex;gap:8px;flex-wrap:wrap;margin-top:12px}
.order-card-actions>*{min-height:44px;font-size:14px;padding:0 14px;border-radius:10px}

/* 状态标签：颜色 + 图标 + 文字三重区分，不依赖颜色单一通道 */
.order-state{display:inline-flex;align-items:center;gap:5px;font-size:13px;font-weight:600;
  padding:5px 10px;border-radius:999px;border:1px solid transparent;white-space:nowrap}
.order-state[data-state="awaiting_payment"]{color:#ffcf8a;background:rgba(255,160,40,.14);border-color:rgba(255,160,40,.45)}
.order-state[data-state="processing"]{color:#9ec8ff;background:rgba(90,150,255,.14);border-color:rgba(90,150,255,.45)}
.order-state[data-state="completed"]{color:#8fe3b0;background:rgba(60,200,120,.14);border-color:rgba(60,200,120,.45)}
.order-state[data-state="closed"]{color:#c3c8d2;background:rgba(160,170,190,.12);border-color:rgba(160,170,190,.35)}
.order-countdown{font-variant-numeric:tabular-nums;font-size:13px;color:#ffcf8a}

.order-empty{text-align:center;padding:34px 12px}
.order-empty-icon{font-size:40px;display:block;margin-bottom:10px}
.order-empty-title{font-size:16px;font-weight:600;margin:0 0 4px}
.order-empty button{margin-top:14px;min-height:44px;padding:0 20px;font-size:14px}

/* 骨架屏 */
.order-skeleton{border:1px solid rgba(255,255,255,.08);border-radius:14px;padding:14px;margin:10px 0}
.skeleton-line{height:14px;border-radius:7px;margin:8px 0;
  background:linear-gradient(90deg,rgba(255,255,255,.06) 25%,rgba(255,255,255,.14) 37%,rgba(255,255,255,.06) 63%);
  background-size:400% 100%;animation:skeleton 1.4s ease infinite}
.skeleton-line.w40{width:40%}.skeleton-line.w60{width:60%}.skeleton-line.w25{width:25%}
@keyframes skeleton{0%{background-position:100% 50%}100%{background-position:0 50%}}
@media (prefers-reduced-motion:reduce){.skeleton-line{animation:none}}

/* 下拉刷新提示 */
.order-pull{height:0;overflow:hidden;text-align:center;font-size:13px;opacity:.8;transition:height .18s ease}
.order-pull[data-active="1"]{height:28px;line-height:28px}

/* 详情页 */
.order-back{min-height:44px;font-size:14px;margin-bottom:10px}
.order-detail-card{border:1px solid rgba(255,255,255,.12);border-radius:14px;padding:16px;margin-bottom:12px;
  background:rgba(255,255,255,.03)}
.order-detail-amount{font-size:26px;font-weight:700;margin:6px 0 2px}
.order-timeline{list-style:none;padding:0;margin:8px 0 0}
.order-timeline li{position:relative;padding:0 0 18px 26px;font-size:14px}
.order-timeline li::before{content:"";position:absolute;left:6px;top:4px;width:10px;height:10px;border-radius:50%;
  background:rgba(255,255,255,.2)}
.order-timeline li::after{content:"";position:absolute;left:10px;top:16px;bottom:0;width:2px;background:rgba(255,255,255,.12)}
.order-timeline li:last-child{padding-bottom:0}
.order-timeline li:last-child::after{display:none}
.order-timeline li[data-done="1"]::before{background:#8fe3b0}
.order-timeline li[data-done="1"] .order-timeline-label{font-weight:600}
.order-timeline li[data-current="1"]::before{background:#9ec8ff;box-shadow:0 0 0 4px rgba(90,150,255,.2)}
.order-timeline-time{display:block;font-size:12px;opacity:.7;margin-top:2px}
.order-kv{display:flex;justify-content:space-between;gap:12px;font-size:14px;padding:9px 0;
  border-bottom:1px dashed rgba(255,255,255,.1)}
.order-kv:last-child{border-bottom:0}
.order-kv dt{opacity:.72;margin:0}
.order-kv dd{margin:0;text-align:right;word-break:break-all}
.order-copy{min-height:36px;padding:0 10px;font-size:13px;border-radius:8px;margin-left:8px}
.order-detail-actions{display:flex;gap:10px;flex-wrap:wrap;margin-top:6px}
.order-detail-actions>*{flex:1 1 140px;min-height:48px;font-size:15px;border-radius:12px}
.order-grant{display:flex;justify-content:space-between;font-size:14px;padding:8px 0;
  border-bottom:1px dashed rgba(255,255,255,.1)}
.order-grant:last-child{border-bottom:0}
.order-danger{border-color:rgba(255,120,120,.5);color:#ffb3b3;background:rgba(255,90,90,.08)}

/* 支付二维码。
   order-qr-wrap 必须 flex-basis:100% —— 父级 .order-detail-actions 给每个直接子元素
   设了 flex:1 1 140px，不覆盖会把整块挤成 140px 宽的一列，二维码被压变形。
   图片固定正方形且 image-rendering:pixelated：二维码缩放插值会让定位点边缘发虚、影响识别率。 */
.order-qr-wrap{flex:1 1 100%;display:flex;flex-direction:column;gap:10px;align-items:stretch}
.order-qr,.payment-qr{margin:0;padding:14px;border:1px solid #c7d2d1;border-radius:12px;
  background:#fff;display:flex;flex-direction:column;align-items:center;gap:8px}
.order-qr img,.payment-qr img{display:block;width:220px;height:220px;image-rendering:pixelated}
.payment-qr img{width:240px;height:240px}
.order-qr figcaption,.payment-qr figcaption{font-size:13px;text-align:center;word-break:break-all}

/* 收银台弹层：复用页面主色 #146b55 与边框色 #c7d2d1，不引入新配色。 */
#checkout{border:1px solid #c7d2d1;border-radius:12px;padding:0;max-width:420px;width:calc(100% - 32px);
  color:#243133;background:#fff}
#checkout::backdrop{background:rgba(12,28,26,.45)}
#checkout-form{display:flex;flex-direction:column;gap:12px;padding:20px;margin:0}
#checkout h2{margin:0;font-size:18px}
#checkout-summary{margin:0}
#checkout-channels-label{margin:0;order:-1}
#checkout-channels{display:flex;flex-direction:column;gap:10px}
/* 通道按钮：左对齐多行内容，覆盖全局 button 的居中与内联显示 */
.checkout-channel{display:flex;flex-direction:column;align-items:flex-start;gap:2px;width:100%;
  padding:12px 14px;text-align:left;background:#fff;color:#243133;border:1px solid #c7d2d1;border-radius:10px;
  font-weight:500}
.checkout-channel:hover{background:#eef4f3}
/* 选中态用 aria-checked 驱动，避免再造一个 class 与无障碍状态两处漂移 */
.checkout-channel[aria-checked="true"]{border-color:#146b55;background:#e8f3f0;box-shadow:inset 0 0 0 1px #146b55}
.checkout-channel-label{font-size:15px;font-weight:600}
.checkout-channel-hint{font-size:12px;color:#637579}
#checkout-message{margin:0;font-size:13px;color:#8a4b12;min-height:18px}
.checkout-actions{display:flex;gap:10px;flex-wrap:wrap}
.checkout-actions>*{flex:1 1 0}

/* 微信支付链接弹层：沿用 #checkout 的尺寸与配色口径，不新增配色。
   长 URL 必须能横向滚动而不撑破弹层，故 input 固定 100% 宽 + box-sizing。 */
#paylink{border:1px solid #c7d2d1;border-radius:12px;padding:0;max-width:420px;width:calc(100% - 32px);
  color:#243133;background:#fff}
#paylink::backdrop{background:rgba(12,28,26,.45)}
#paylink form{display:flex;flex-direction:column;gap:12px;padding:20px;margin:0}
#paylink h2{margin:0;font-size:18px}
#paylink p{margin:0}
#paylink-input{width:100%;box-sizing:border-box;padding:10px 12px;border:1px solid #c7d2d1;border-radius:8px;
  font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:12px;color:#243133;background:#f7faf9}
#paylink-message{font-size:13px;color:#8a4b12;min-height:18px}
