/* Points and support dialogs: self-contained colours so they look the same on every page. */
.tw-dialog {
  width: min(560px, calc(100vw - 32px));
  max-height: min(86dvh, 760px);
  margin: auto;
  padding: 24px;
  overflow: auto;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 16px;
  background: #0b0b0b;
  color: #f5f5f7;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  box-shadow: 0 24px 64px rgba(0,0,0,.5);
}
.tw-dialog::backdrop { background: rgba(0,0,0,.72); }
.tw-dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.tw-dialog-head h2 { margin: 0; font-size: 20px; font-weight: 600; letter-spacing: -.01em; }
.tw-dialog .tw-dialog-close {
  display: grid; place-items: center; width: 36px; height: 36px; min-height: 0; margin: -6px -6px 0 0; padding: 0;
  border: 1px solid rgba(255,255,255,.14); border-radius: 50%; background: transparent; color: rgba(245,245,247,.72);
  font-family: inherit; font-size: 22px; font-weight: 300; line-height: 1; cursor: pointer;
}
.tw-dialog .tw-dialog-close:hover { color: #fff; border-color: rgba(255,255,255,.3); }
.tw-dialog-note { margin: 0 0 12px; color: rgba(245,245,247,.62); font-size: 13px; line-height: 1.7; }
.tw-dialog-note:empty { display: none; }
.tw-dialog-footnote { margin: 16px 0 0; color: rgba(245,245,247,.42); font-size: 11px; line-height: 1.7; }
.tw-dialog-subtitle { margin: 20px 0 10px; color: rgba(245,245,247,.62); font-size: 12px; font-weight: 500; letter-spacing: .04em; }

.tw-points-summary { display: flex; align-items: baseline; gap: 10px; margin: 4px 0 10px; }
.tw-points-summary strong { font-size: 40px; font-weight: 600; line-height: 1; font-variant-numeric: tabular-nums; }
.tw-points-summary span { color: rgba(245,245,247,.62); font-size: 13px; }
.tw-points-links { display: flex; flex-wrap: wrap; gap: 8px; }
.tw-points-links a {
  padding: 7px 12px; border: 1px solid rgba(255,255,255,.16); border-radius: 999px;
  color: #f5f5f7; font-size: 12px; text-decoration: none;
}
.tw-points-links a:hover { background: rgba(255,255,255,.06); }
.tw-points-table { border: 1px solid rgba(255,255,255,.11); border-radius: 12px; overflow: hidden; }
.tw-points-row {
  display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 14px; align-items: center;
  padding: 11px 14px; border-top: 1px solid rgba(255,255,255,.08); font-size: 13px;
}
.tw-points-row:first-child { border-top: 0; }
.tw-points-header { color: rgba(245,245,247,.45); font-size: 11px; background: rgba(255,255,255,.03); }
.tw-points-row span:nth-child(2) { min-width: 64px; text-align: right; font-variant-numeric: tabular-nums; }
.tw-points-row span:nth-child(3) { color: rgba(245,245,247,.5); font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tw-points-row.is-gain span:nth-child(2) { color: #fff; font-weight: 600; }
.tw-points-row.is-spend span:nth-child(2), .tw-points-row.is-zero span:nth-child(2), .tw-points-row.is-held span:nth-child(2) { color: rgba(245,245,247,.6); }

.tw-support-form { display: grid; gap: 12px; }
.tw-support-form textarea {
  width: 100%; min-height: 140px; padding: 12px 14px; box-sizing: border-box; resize: vertical;
  border: 1px solid rgba(255,255,255,.2); border-radius: 12px; background: #141414; color: #f5f5f7;
  font-family: inherit; font-size: 15px; line-height: 1.6;
}
.tw-support-form textarea:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.tw-support-files { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.tw-support-files:empty { display: none; }
.tw-support-files li { display: flex; align-items: center; gap: 6px; max-width: 100%; padding: 5px 6px 5px 10px; border: 1px solid rgba(255,255,255,.16); border-radius: 999px; font-size: 12px; }
.tw-support-files li span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tw-support-files li button { width: 22px; height: 22px; min-height: 0; padding: 0; border: 0; border-radius: 50%; background: rgba(255,255,255,.1); color: #f5f5f7; cursor: pointer; }
.tw-dialog .tw-support-attach { display: inline-flex; flex-direction: row; align-items: center; gap: 8px; width: fit-content; color: rgba(245,245,247,.72); font-size: 13px; cursor: pointer; }
.tw-support-attach input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.tw-support-attach svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.tw-support-attach:hover { color: #fff; }
.tw-support-attach:has(input:focus-visible) { outline: 2px solid #fff; outline-offset: 3px; border-radius: 6px; }
.tw-support-attach:has(input:disabled) { opacity: .4; cursor: not-allowed; }
.tw-dialog .tw-dialog-primary {
  min-height: 46px; padding: 0 18px; border: 0; border-radius: 10px; background: #fff; color: #090909;
  font-family: inherit; font-size: 14px; font-weight: 600; line-height: 1; cursor: pointer;
}
.tw-dialog .tw-dialog-primary:hover { background: #e6e6e6; }
.tw-dialog .tw-dialog-primary:disabled { background: #2b2b2d; color: #777; cursor: wait; }
@media (max-width: 560px) {
  .tw-dialog { padding: 20px 16px; }
  .tw-points-row { grid-template-columns: minmax(0, 1fr) auto; }
  .tw-points-row span:nth-child(3) { grid-column: 1 / -1; margin-top: -6px; }
  .tw-points-header span:nth-child(3) { display: none; }
}

/* Compact confirmations (question price, not enough points). */
.tw-dialog.tw-dialog-compact { width: min(420px, calc(100vw - 32px)); }
.tw-dialog-compact h2 { margin: 0 0 8px; font-size: 18px; font-weight: 600; }
.tw-dialog-lead { margin: 0 0 8px; color: #f5f5f7; font-size: 16px; line-height: 1.6; }
.tw-dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.tw-dialog .tw-dialog-secondary {
  min-height: 46px; padding: 0 18px; border: 1px solid rgba(255,255,255,.2); border-radius: 10px;
  background: transparent; color: #f5f5f7; font-family: inherit; font-size: 14px; font-weight: 500; line-height: 1; cursor: pointer;
}
.tw-dialog .tw-dialog-secondary:hover { background: rgba(255,255,255,.06); }
.tw-dialog-compact .tw-points-links { margin-top: 4px; }

/* One-time welcome after sign-up. */
.tw-toast {
  position: fixed; top: 16px; left: 50%; z-index: 1000; transform: translateX(-50%);
  display: flex; align-items: flex-start; gap: 12px; width: min(480px, calc(100vw - 32px)); box-sizing: border-box;
  padding: 14px 14px 14px 18px; border: 1px solid rgba(255,255,255,.18); border-radius: 14px;
  background: #121212; color: #f5f5f7; box-shadow: 0 18px 48px rgba(0,0,0,.5);
  font: 14px/1.65 -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
}
.tw-toast p { margin: 0; flex: 1; }
/* On the phone workspace the note sits below the top bar, so profile, points and account stay usable. */
@media (max-width: 1080px) {
  .reading-ui .tw-toast { top: calc(72px + env(safe-area-inset-top)); }
}
.tw-toast .tw-toast-close {
  flex: none; width: 28px; height: 28px; min-height: 0; padding: 0; border: 0; border-radius: 50%;
  background: rgba(255,255,255,.08); color: #f5f5f7; font-family: inherit; font-size: 18px; font-weight: 300; line-height: 1; cursor: pointer;
}

/* The points badge's card. It follows the page theme through the product colours. */
.tw-points-card {
  position: fixed; z-index: 45; width: min(320px, calc(100vw - 24px)); box-sizing: border-box; padding: 14px 10px 8px;
  border: 1px solid var(--product-line-strong, rgba(255,255,255,.2)); border-radius: 16px;
  background: var(--product-elevated, #111); color: var(--product-text, #f5f5f7);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  box-shadow: 0 18px 48px rgba(0,0,0,.42);
}
.tw-points-card[hidden] { display: none; }
.tw-points-card-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 34px; margin: 0 4px 6px; padding-bottom: 12px;
  border-bottom: 1px dashed var(--product-line-strong, rgba(255,255,255,.2));
}
.tw-points-card-head strong { font-size: 15px; font-weight: 600; }
.tw-points-card .tw-points-card-cta {
  min-height: 32px; padding: 0 18px; border: 0; border-radius: 999px; background: #f5f5f7; color: #0b0b0b;
  font-family: inherit; font-size: 13px; font-weight: 600; line-height: 1; cursor: pointer;
}
.tw-points-card .tw-points-card-cta:hover { background: #fff; }
.tw-points-card-row {
  display: grid; grid-template-columns: 18px minmax(0, 1fr) auto; align-items: center; gap: 12px; width: 100%; min-height: 50px;
  box-sizing: border-box; margin: 0; padding: 6px 8px; border: 0; border-radius: 10px; background: transparent; color: inherit;
  font: inherit; text-align: left; text-decoration: none;
}
.tw-points-card-row[hidden] { display: none; }
.tw-points-card-row > svg { width: 18px; height: 18px; fill: none; stroke: var(--product-secondary, rgba(245,245,247,.62)); stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.tw-points-card-row.is-action { cursor: pointer; }
.tw-points-card-row.is-action:hover { background: var(--product-hover, #181818); }
.tw-points-card :is(a, button):focus-visible { outline: 2px solid var(--theme-focus, #fff); outline-offset: 1px; }
.tw-points-card-label { display: grid; gap: 4px; min-width: 0; font-size: 14px; line-height: 1.3; }
.tw-points-card-label small { display: flex; align-items: center; gap: 7px; color: var(--product-tertiary, rgba(245,245,247,.38)); font-size: 11px; }
.tw-points-card-value { font-size: 20px; font-weight: 600; line-height: 1; font-variant-numeric: tabular-nums; }
.tw-points-card-value.is-quiet { color: var(--product-secondary, rgba(245,245,247,.62)); font-size: 14px; font-weight: 500; }
.tw-points-card-state { display: inline-flex; align-items: center; gap: 4px; color: var(--product-secondary, rgba(245,245,247,.62)); font-size: 12px; white-space: nowrap; }
.tw-points-card-state [hidden] { display: none; }
.tw-points-card-state svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.tw-streak { display: inline-flex; gap: 3px; }
.tw-streak i { width: 6px; height: 6px; border-radius: 50%; background: var(--product-line-strong, rgba(255,255,255,.2)); }
.tw-streak i.is-on { background: var(--product-text, #f5f5f7); }
.tw-points-card-more {
  display: flex; align-items: center; gap: 4px; min-height: 36px; margin: 2px 0 0; padding: 0 8px;
  color: var(--product-tertiary, rgba(245,245,247,.38)); font-size: 12px; text-decoration: none;
}
.tw-points-card-more:hover { color: var(--product-text, #f5f5f7); }
@media (prefers-reduced-motion: no-preference) {
  .tw-points-card:not([hidden]) { animation: points-card-in 150ms cubic-bezier(.4, 0, .2, 1); }
}
@keyframes points-card-in { from { opacity: 0; transform: translateY(-4px) scale(.985); } to { opacity: 1; transform: none; } }
html[data-theme="light"] .tw-points-card { box-shadow: 0 18px 48px rgba(25,25,20,.14); }
html[data-theme="light"] .tw-points-card .tw-points-card-cta { background: var(--product-accent); color: var(--theme-button-text); }
html[data-theme="light"] .tw-points-card .tw-points-card-cta:hover { background: #41413f; }

/* The same dialogs share one appearance across every page. */
html[data-theme="light"] :is(.tw-dialog, .tw-toast) { background: var(--product-elevated); color: var(--product-text); border-color: var(--product-line); box-shadow: 0 24px 64px rgba(32,32,32,.16); }
html[data-theme="light"] .tw-dialog::backdrop { background: rgba(32,32,32,.28); }
html[data-theme="light"] :is(.tw-dialog .tw-dialog-close, .tw-points-summary span, .tw-dialog-note, .tw-dialog-subtitle, .tw-dialog .tw-support-attach) { color: var(--product-secondary); }
html[data-theme="light"] :is(.tw-dialog-footnote, .tw-points-header, .tw-points-row span:nth-child(3)) { color: var(--product-tertiary); }
html[data-theme="light"] :is(.tw-dialog .tw-dialog-close, .tw-points-links a, .tw-points-table, .tw-points-row, .tw-support-form textarea, .tw-support-files li, .tw-dialog .tw-dialog-secondary) { border-color: var(--product-line); }
html[data-theme="light"] :is(.tw-points-links a, .tw-points-row.is-gain span:nth-child(2), .tw-dialog-lead, .tw-dialog .tw-dialog-secondary) { color: var(--product-text); }
html[data-theme="light"] :is(.tw-points-row.is-spend span:nth-child(2), .tw-points-row.is-zero span:nth-child(2), .tw-points-row.is-held span:nth-child(2)) { color: var(--product-secondary); }
html[data-theme="light"] :is(.tw-points-header, .tw-support-files li button, .tw-toast .tw-toast-close) { background: var(--product-base); }
html[data-theme="light"] :is(.tw-points-links a:hover, .tw-dialog .tw-dialog-secondary:hover) { background: var(--product-hover); }
html[data-theme="light"] :is(.tw-dialog .tw-dialog-close:hover, .tw-support-attach:hover) { color: var(--product-text); }
html[data-theme="light"] .tw-dialog .tw-dialog-close:hover { border-color: var(--product-line-strong); }
html[data-theme="light"] .tw-support-form textarea { background: var(--product-elevated); color: var(--product-text); border-color: var(--product-line-strong); }
html[data-theme="light"] :is(.tw-support-files li button, .tw-toast .tw-toast-close) { color: var(--product-text); }
html[data-theme="light"] :is(.tw-support-form textarea:focus-visible, .tw-support-attach:has(input:focus-visible)) { outline-color: var(--theme-focus); }
html[data-theme="light"] .tw-dialog .tw-dialog-primary { background: var(--product-accent); color: var(--theme-button-text); }
html[data-theme="light"] .tw-dialog .tw-dialog-primary:hover { background: #41413f; }
html[data-theme="light"] .tw-dialog .tw-dialog-primary:disabled { background: var(--product-hover); color: var(--product-tertiary); }

/* 充值: one narrow sheet. A segmented 会员 | 点数包 switch shows one choice at a time, each with a single pay
   button and one line of fine print. Gold belongs to membership only; everything else is greyscale. */
.tw-dialog .tw-points-buy { width: 100%; margin: 4px 0 14px; }
.tw-dialog.tw-buy-dialog { width: min(440px, calc(100vw - 32px)); padding: 24px 24px 18px; }
.tw-buy-dialog .tw-dialog-head { margin-bottom: 4px; }
.tw-buy-meta { margin: 0 0 20px; color: rgba(245,245,247,.5); font-size: 13px; font-variant-numeric: tabular-nums; }
.tw-buy-test { margin: -8px 0 16px; color: #e8c37a; }
.tw-buy-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; margin: 0 0 24px; padding: 3px; border-radius: 10px; background: rgba(255,255,255,.06); }
.tw-dialog .tw-buy-tabs button { min-height: 34px; padding: 0; border: 0; border-radius: 8px; background: transparent; color: rgba(245,245,247,.55); font-family: inherit; font-size: 13px; font-weight: 500; line-height: 1; cursor: pointer; }
.tw-dialog .tw-buy-tabs button:hover { color: #f5f5f7; }
.tw-dialog .tw-buy-tabs button[aria-selected="true"] { background: rgba(255,255,255,.12); color: #f5f5f7; box-shadow: 0 1px 2px rgba(0,0,0,.35); }
.tw-dialog .tw-buy-tabs button:focus-visible { outline: 2px solid rgba(255,255,255,.6); outline-offset: 1px; }
.tw-buy-panel[hidden] { display: none; }
.tw-plan-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.tw-plan-head h3 { margin: 0; color: #f5f5f7; font-size: 15px; font-weight: 600; letter-spacing: .01em; }
.tw-plan-badge { padding: 4px 10px; border-radius: 999px; background: rgba(255,255,255,.1); color: #f5f5f7; font-size: 12px; font-weight: 500; white-space: nowrap; }
.tw-plan-price { display: flex; align-items: baseline; gap: 4px; margin: 12px 0 0; }
.tw-plan-price strong { font-size: 38px; font-weight: 600; line-height: 1; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.tw-plan-price span { color: rgba(245,245,247,.5); font-size: 14px; }
.tw-plan-perks { display: grid; gap: 12px; margin: 20px 0 24px; padding: 20px 0 0; border-top: 1px solid rgba(255,255,255,.08); list-style: none; }
.tw-plan-perks li { display: flex; align-items: flex-start; gap: 10px; color: rgba(245,245,247,.88); font-size: 14px; line-height: 1.45; }
.tw-plan-perks svg { flex: 0 0 18px; width: 18px; height: 18px; margin-top: 1px; fill: none; stroke: rgba(245,245,247,.72); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tw-dialog .tw-buy-action { display: grid; place-items: center; width: 100%; font-family: inherit; font-size: 14px; font-weight: 600; line-height: 1; text-decoration: none; }
.tw-dialog .tw-buy-go:disabled { cursor: progress; opacity: .6; }
.tw-buy-fine { margin: 10px 0 0; color: rgba(245,245,247,.42); font-size: 12px; line-height: 1.6; text-align: center; }
.tw-buy-packs { display: grid; gap: 8px; margin: 0 0 22px; }
.tw-dialog .tw-buy-pack { display: grid; grid-template-columns: 16px minmax(0, 1fr) auto; align-items: center; gap: 14px; width: 100%; min-height: 66px; padding: 12px 16px; border: 1px solid rgba(255,255,255,.1); border-radius: 12px; background: transparent; color: #f5f5f7; font-family: inherit; font-size: 14px; font-weight: 400; text-align: left; box-shadow: none; cursor: pointer; }
.tw-dialog .tw-buy-pack:hover { border-color: rgba(255,255,255,.24); }
.tw-dialog .tw-buy-pack[aria-checked="true"] { border-color: rgba(245,245,247,.9); background: rgba(255,255,255,.05); }
.tw-dialog .tw-buy-pack:focus-visible { outline: 2px solid rgba(255,255,255,.6); outline-offset: 2px; }
.tw-buy-radio { width: 16px; height: 16px; box-sizing: border-box; border: 1.5px solid rgba(255,255,255,.32); border-radius: 50%; transition: border-width .12s; }
.tw-buy-pack[aria-checked="true"] .tw-buy-radio { border: 5px solid #f5f5f7; }
.tw-buy-main { display: grid; gap: 4px; min-width: 0; }
.tw-buy-points { display: flex; align-items: baseline; gap: 4px; font-size: 16px; font-weight: 600; font-variant-numeric: tabular-nums; }
.tw-buy-points small { color: rgba(245,245,247,.5); font-size: 12px; font-weight: 400; }
.tw-buy-tag { margin-left: 6px; color: rgba(245,245,247,.62); font-size: 11px; font-weight: 500; }
.tw-buy-detail { color: rgba(245,245,247,.5); font-size: 12px; line-height: 1.4; }
.tw-buy-side { display: grid; justify-items: end; gap: 4px; }
.tw-buy-price { font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }
.tw-buy-foot { display: flex; align-items: center; gap: 18px; margin-top: 22px; padding-top: 14px; border-top: 1px solid rgba(255,255,255,.08); font-size: 12px; }
.tw-buy-foot a { color: rgba(245,245,247,.5); text-decoration: none; }
.tw-buy-foot a:hover { color: #f5f5f7; }
.tw-buy-currency-label { margin-right: auto; }
.tw-dialog .tw-buy-currency { field-sizing: content; width: auto; height: 28px; min-height: 0; padding: 0 2px; border: 0; background: transparent; color: rgba(245,245,247,.6); font: inherit; font-size: 12px; cursor: pointer; }
.tw-buy-currency option { color: #111; }
.tw-visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
html[data-theme="light"] .tw-buy-test { color: #8a5a00; }
html[data-theme="light"] :is(.tw-buy-meta, .tw-plan-price span, .tw-buy-points small, .tw-buy-detail, .tw-buy-foot a, .tw-dialog .tw-buy-currency) { color: var(--product-secondary); }
html[data-theme="light"] .tw-buy-fine { color: var(--product-tertiary); }
html[data-theme="light"] .tw-buy-tabs { background: var(--product-hover); }
html[data-theme="light"] .tw-dialog .tw-buy-tabs button { color: var(--product-secondary); }
html[data-theme="light"] .tw-dialog .tw-buy-tabs button[aria-selected="true"] { background: var(--product-elevated); color: var(--product-text); box-shadow: 0 1px 2px rgba(32,32,32,.12); }
html[data-theme="light"] .tw-plan-head h3 { color: var(--product-text); }
html[data-theme="light"] .tw-buy-tag { color: var(--product-secondary); }
html[data-theme="light"] .tw-plan-badge { background: var(--product-hover); color: var(--product-text); }
html[data-theme="light"] .tw-plan-perks { border-color: var(--product-line); }
html[data-theme="light"] .tw-plan-perks li { color: var(--product-text); }
html[data-theme="light"] .tw-plan-perks svg { stroke: var(--product-secondary); }
html[data-theme="light"] .tw-dialog .tw-buy-pack { border-color: var(--product-line); color: var(--product-text); }
html[data-theme="light"] .tw-dialog .tw-buy-pack:hover { border-color: var(--product-line-strong); }
html[data-theme="light"] .tw-dialog .tw-buy-pack[aria-checked="true"] { border-color: var(--product-text); background: var(--product-hover); }
html[data-theme="light"] .tw-buy-radio { border-color: var(--product-line-strong); }
html[data-theme="light"] .tw-buy-pack[aria-checked="true"] .tw-buy-radio { border-color: var(--product-text); }
html[data-theme="light"] .tw-buy-foot { border-color: var(--product-line); }
html[data-theme="light"] .tw-buy-foot a:hover { color: var(--product-text); }

/* 分享这份解读: the link, once made, sits in a read-only field (also the copy fallback). */
.tw-dialog .tw-share-url { box-sizing: border-box; width: 100%; min-height: 42px; margin: 4px 0 8px; padding: 0 12px; border: 1px solid rgba(255,255,255,.16); border-radius: 10px; background: #111; color: #f5f5f7; font-family: inherit; font-size: 13px; }
.tw-dialog .tw-share-url[hidden] { display: none; }
.tw-dialog .tw-share-status { margin: 0; }
html[data-theme="light"] .tw-dialog .tw-share-url { border-color: var(--product-line-strong); background: var(--product-base); color: var(--product-text); }
