@import url('https://fonts.googleapis.com/css2?family=DM+Mono:wght@400;500&family=Manrope:wght@400;500;600;700;800&display=swap');

:root {
  --ink: #18211d;
  --ink-soft: #31403a;
  --muted: #738078;
  --muted-light: #a7b0aa;
  --canvas: #f2f3ee;
  --surface: #fbfcf8;
  --surface-deep: #e7ebe3;
  --line: #d7ded5;
  --line-strong: #bcc8bd;
  --accent: #e6653f;
  --accent-dark: #b9472b;
  --accent-soft: #fff0ea;
  --success: #4d7c43;
  --shadow: 0 18px 45px rgba(33, 48, 40, .08);
  --mono: 'DM Mono', 'Courier New', monospace;
  --sans: Manrope, 'Microsoft YaHei', sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { min-width: 320px; background: var(--canvas); }

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  font-family: var(--sans);
  background: linear-gradient(135deg, rgba(255, 255, 255, .68), transparent 42%), var(--canvas);
}

body::before {
  position: fixed;
  z-index: -1;
  top: 0;
  right: 0;
  width: min(43vw, 600px);
  height: 100vh;
  border-left: 1px solid rgba(188, 200, 189, .35);
  background: repeating-linear-gradient(90deg, transparent 0 55px, rgba(116, 136, 122, .035) 56px, transparent 57px);
  content: '';
  pointer-events: none;
}

button, input, textarea { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }

.shell {
  display: flex;
  width: min(1240px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: 27px 52px 24px;
  flex-direction: column;
}

.topbar,
.topbar-actions,
.workspace-heading,
.panel-head,
footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.topbar { padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.topbar-actions { gap: 18px; }

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--ink);
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -.02em;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 9px 9px 9px 2px;
  color: #fffaf5;
  background: var(--ink);
  font-size: 20px;
  font-weight: 400;
  line-height: 1;
  box-shadow: 4px 4px 0 rgba(230, 101, 63, .27);
}

.status { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font: 11px var(--mono); }
.top-link, .contact-link { color: var(--muted); font-size: 11px; text-decoration: none; }
.top-link:hover, .contact-link:hover { color: var(--accent-dark); }
.top-link span { color: var(--accent); font-size: 14px; }
.contact-link { padding: 7px 11px; border: 1px solid var(--line-strong); border-radius: 5px; background: transparent; cursor: pointer; font-family: var(--mono); }
.status i { display: block; width: 7px; height: 7px; border-radius: 50%; background: #6a9b5b; box-shadow: 0 0 0 4px rgba(106, 155, 91, .13); }
.view { flex: 1; }

.auth-view {
  display: grid;
  width: min(1040px, 100%);
  margin: 0 auto;
  padding: 104px 0 112px;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 440px);
  align-items: center;
  gap: clamp(60px, 9vw, 132px);
}

.auth-intro { padding-bottom: 12px; }
.eyebrow, .panel-label { color: var(--accent-dark); font: 11px var(--mono); font-weight: 500; letter-spacing: .16em; }

.auth-intro h1 {
  max-width: 530px;
  margin: 18px 0 22px;
  color: var(--ink);
  font-size: clamp(44px, 5.6vw, 76px);
  font-weight: 800;
  letter-spacing: -.065em;
  line-height: .98;
}

.auth-intro h1 em { color: var(--accent); font-style: normal; }
.auth-intro > p { max-width: 440px; margin: 0; color: var(--muted); font-size: 14px; line-height: 1.85; }

.access-notes {
  display: grid;
  max-width: 455px;
  margin: 42px 0 0;
  padding: 18px 0 0;
  border-top: 1px solid var(--line-strong);
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  list-style: none;
}

.access-notes li { display: grid; gap: 5px; }
.access-notes strong { font-size: 13px; font-weight: 800; }
.access-notes span { color: var(--muted); font-size: 11px; line-height: 1.5; }

.panel { border: 1px solid var(--line); border-radius: 10px; background: rgba(251, 252, 248, .92); box-shadow: var(--shadow); }
.auth-panel { position: relative; padding: 34px; }
.auth-panel::before { position: absolute; top: -1px; left: 28px; width: 48px; height: 3px; background: var(--accent); content: ''; }

.panel h2 { margin: 11px 0 8px; color: var(--ink); font-size: 27px; font-weight: 800; letter-spacing: -.045em; line-height: 1.2; }
.panel-copy { margin: 0 0 25px; color: var(--muted); font-size: 12px; line-height: 1.7; }

.input-wrap { display: flex; min-height: 56px; align-items: stretch; padding: 5px; border: 1px solid var(--line-strong); border-radius: 7px; background: #fff; transition: border-color .18s ease, box-shadow .18s ease; }
.input-wrap:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(230, 101, 63, .11); }
.input-icon { display: grid; width: 34px; flex: 0 0 34px; place-items: center; color: var(--accent); font: 15px var(--mono); }
.input-wrap input { width: 100%; min-width: 0; border: 0; outline: 0; color: var(--ink); background: transparent; font: 13px var(--mono); }
.input-wrap input::placeholder, input::placeholder { color: var(--muted-light); }

.input-wrap button { min-width: 124px; padding: 0 14px; border: 0; border-radius: 5px; color: #fffaf5; background: var(--ink); cursor: pointer; font-size: 12px; font-weight: 800; white-space: nowrap; transition: background .18s ease, transform .18s ease; }
.input-wrap button:hover, .receive-btn:hover, .switch-number-btn:hover { transform: translateY(-1px); }
.input-wrap button:hover { background: var(--accent-dark); }
.input-wrap button span { margin-left: 8px; color: #ffb59e; font-size: 16px; }
button:focus-visible, input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
button:disabled { cursor: wait; opacity: .55; }

.message { min-height: 18px; margin-top: 12px; color: var(--accent-dark); font-size: 11px; line-height: 1.55; }
.message.is-success { color: var(--success); }
.hint { margin-top: 18px; color: var(--muted-light); font: 10px var(--mono); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
.process-steps { display: none; }

.plans-section { width: 100%; padding-top: 12px; grid-column: 1 / -1; }
.plans-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 30px; margin-bottom: 19px; padding: 0 2px; }
.plans-heading h2 { margin: 10px 0 0; color: var(--ink); font-size: 29px; font-weight: 800; letter-spacing: -.05em; line-height: 1.1; }
.plans-heading p { max-width: 330px; margin: 0 0 2px; color: var(--muted); font-size: 12px; line-height: 1.7; text-align: right; }
.plans-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.plan-card { position: relative; display: flex; min-height: 244px; padding: 23px 23px 21px; flex-direction: column; border: 1px solid var(--line); border-radius: 8px; background: rgba(251, 252, 248, .82); transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease; }
.plan-card:hover { box-shadow: 0 12px 27px rgba(33, 48, 40, .10); transform: translateY(-2px); }
.plan-card-blue { border-color: #b9d4f0; background: #edf5ff; }
.plan-card-blue:hover { border-color: #78acd9; }
.plan-card-gold { border-color: #e5c86b; background: #fff8df; box-shadow: 0 12px 28px rgba(141, 100, 16, .13); }
.plan-card-gold:hover { border-color: #cda42d; box-shadow: 0 16px 32px rgba(141, 100, 16, .18); }
.plan-card-gold::before { position: absolute; top: -1px; left: 22px; width: 43px; height: 3px; background: #d99312; content: ''; }
.plan-card-rose { border-color: #efbcc4; background: #fff0f2; }
.plan-card-rose:hover { border-color: #d87889; }
.plan-card-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.plan-name { color: var(--ink); font-size: 16px; font-weight: 800; letter-spacing: -.03em; }
.plan-tag { color: var(--accent-dark); font: 10px var(--mono); }
.plan-card-blue .plan-name, .plan-card-blue .plan-price strong { color: #18507d; }
.plan-card-blue .plan-tag { color: #2675b6; }
.plan-card-gold .plan-name, .plan-card-gold .plan-price strong { color: #62450b; }
.plan-card-gold .plan-tag { color: #a86800; }
.plan-card-rose .plan-name, .plan-card-rose .plan-price strong { color: #862b45; }
.plan-card-rose .plan-tag { color: #bb3e5b; }
.plan-price { display: flex; align-items: baseline; gap: 7px; margin-top: 23px; }
.plan-price strong { color: var(--ink); font: 800 34px var(--mono); letter-spacing: -.08em; line-height: 1; }
.plan-price span { color: var(--muted); font-size: 11px; }
.plan-card-blue .plan-price span { color: #587996; }
.plan-card-gold .plan-price span { color: #8b7747; }
.plan-card-rose .plan-price span { color: #9a6875; }
.plan-copy { min-height: 38px; margin: 11px 0 21px; color: var(--muted); font-size: 11px; line-height: 1.7; }
.plan-card-blue .plan-copy { color: #56718b; }
.plan-card-gold .plan-copy { color: #806e42; }
.plan-card-rose .plan-copy { color: #956573; }
.plan-action { display: inline-flex; min-height: 39px; align-items: center; justify-content: center; gap: 7px; margin-top: auto; border-radius: 5px; cursor: pointer; font-size: 11px; font-weight: 800; text-decoration: none; transition: background .18s ease, border-color .18s ease, color .18s ease, transform .18s ease; }
.plan-action:hover { transform: translateY(-1px); }
.plan-action span { color: var(--accent); font-size: 15px; }
.plan-action-outline { border: 1px solid var(--line-strong); color: var(--ink-soft); background: transparent; }
.plan-action-outline:hover { border-color: var(--accent); color: var(--accent-dark); background: var(--accent-soft); }
.plan-card-blue .plan-action-outline { border-color: #8ab8df; color: #18507d; }
.plan-card-blue .plan-action-outline:hover { border-color: #2675b6; color: #123d60; background: #dceeff; }
.plan-card-gold .plan-action-solid { border-color: #d99312; color: #fffdf4; background: #d99312; box-shadow: 0 3px 0 #a86800; }
.plan-card-gold .plan-action-solid:hover { background: #b97405; }
.plan-card-gold .plan-action-solid span { color: #ffe8a4; }
.plan-card-rose .plan-action-outline { border-color: #d98b9b; color: #862b45; }
.plan-card-rose .plan-action-outline:hover { border-color: #bb3e5b; color: #701f38; background: #ffe0e5; }

.workspace-view { width: min(1000px, 100%); margin: 0 auto; padding: 76px 0 92px; }
.workspace-heading { align-items: flex-end; margin-bottom: 34px; }
.workspace-heading h1 { margin: 12px 0 9px; color: var(--ink); font-size: clamp(42px, 6vw, 68px); font-weight: 800; letter-spacing: -.07em; line-height: .98; }
.workspace-heading p { max-width: 470px; margin: 0; color: var(--muted); font-size: 14px; line-height: 1.7; }
.logout { display: inline-flex; align-items: center; gap: 7px; padding: 9px 0; border: 0; color: var(--muted); background: transparent; cursor: pointer; font: 11px var(--mono); }
.logout:hover { color: var(--accent-dark); }
.logout span { color: var(--accent); font-size: 16px; }

.managed-panel { max-width: 1000px; margin-bottom: 18px; padding: 27px 31px 30px; }
.managed-panel .panel-head { margin-bottom: 20px; align-items: flex-start; }
.managed-panel .panel-head h2 { margin-bottom: 0; }
.managed-list { display: grid; gap: 10px; }

.managed-number { display: grid; min-height: 86px; padding: 16px 17px; border: 1px solid var(--line); border-radius: 7px; background: #fff; grid-template-areas: 'info action' 'result result'; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 13px 18px; transition: border-color .18s ease, box-shadow .18s ease; }
.managed-number:hover { border-color: var(--line-strong); box-shadow: 0 7px 20px rgba(33, 48, 40, .05); }
.managed-number-info { display: grid; min-width: 0; grid-area: info; gap: 6px; }
.managed-number-info strong { color: var(--ink); font: 500 21px var(--mono); letter-spacing: -.04em; }
.managed-number-info span { overflow: hidden; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }

.receive-btn { display: inline-flex; min-height: 40px; align-items: center; justify-content: center; padding: 0 15px; border: 0; border-radius: 5px; color: #fffaf5; background: var(--accent); cursor: pointer; font-size: 11px; font-weight: 800; grid-area: action; white-space: nowrap; box-shadow: 0 3px 0 var(--accent-dark); transition: background .18s ease, transform .18s ease; }
.receive-btn:hover { background: var(--accent-dark); }
.receive-btn.is-active { color: #fff; background: var(--ink); box-shadow: 0 3px 0 #060908; }
.receive-btn span { margin-left: 8px; color: #ffd0c1; font-size: 15px; }
.receive-btn.is-active span { color: #fff; }
.managed-empty { padding: 22px 0 8px; color: var(--muted); font: 11px var(--mono); }

.managed-number-result { padding-top: 16px; border-top: 1px solid var(--line); grid-area: result; }
.inline-result { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.inline-result span { color: var(--muted); font-size: 11px; }
.inline-result strong { display: block; margin-top: 5px; color: var(--ink); font: 700 31px var(--mono); letter-spacing: .11em; }
.inline-result strong.is-pending { color: var(--muted); font-size: 18px; letter-spacing: 0; }
.inline-result-side { display: grid; justify-items: end; gap: 5px; text-align: right; }
.refresh-state { color: var(--success) !important; font: 10px var(--mono) !important; }
.refresh-countdown { color: var(--accent-dark); font: 700 14px var(--mono); white-space: nowrap; }
.refresh-countdown.is-overdue { color: var(--accent); }

.switch-number-action { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 13px; padding-top: 13px; border-top: 1px dashed var(--line); }
.switch-number-action > span { color: var(--accent-dark); font: 10px var(--mono); }
.switch-number-btn { min-height: 34px; padding: 0 12px; border: 1px solid var(--accent); border-radius: 5px; color: var(--accent-dark); background: var(--accent-soft); cursor: pointer; font-size: 11px; font-weight: 800; white-space: nowrap; transition: background .18s ease, transform .18s ease; }
.switch-number-btn:hover { background: #ffe3d9; }
.switch-number-btn span { margin-left: 6px; font-size: 14px; }
.switch-number-btn:disabled { border-color: var(--line); color: var(--muted); background: var(--surface-deep); cursor: not-allowed; }
.inline-result-error { color: var(--accent-dark) !important; line-height: 1.6; }
.inline-raw { margin-top: 13px; color: var(--muted); font: 10px var(--mono); }
.inline-raw summary { cursor: pointer; }
.inline-raw pre { max-height: 150px; margin: 8px 0 0; padding: 12px; overflow: auto; border-radius: 5px; color: var(--ink-soft); background: #f1f4ee; white-space: pre-wrap; word-break: break-word; }

footer { gap: 20px; padding: 24px 3px 0; color: var(--muted-light); font: 10px var(--mono); }

body.modal-open { overflow: hidden; }
.contact-modal { position: fixed; z-index: 20; inset: 0; display: grid; place-items: center; padding: 22px; background: rgba(24, 33, 29, .48); backdrop-filter: blur(8px); }
.contact-modal[hidden] { display: none; }
.contact-dialog { position: relative; width: min(390px, 100%); padding: 30px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); box-shadow: 0 28px 70px rgba(24, 33, 29, .22); }
.contact-dialog h2 { margin: 11px 0 8px; font-size: 27px; }
.contact-dialog > p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.7; }
.modal-close { position: absolute; top: 17px; right: 18px; width: 31px; height: 31px; border: 1px solid var(--line); border-radius: 50%; color: var(--muted); background: #fff; cursor: pointer; font-size: 21px; line-height: 1; }
.modal-close:hover { color: var(--accent-dark); border-color: var(--accent); }
.contact-qr { display: grid; width: min(230px, 100%); margin: 22px auto 18px; padding: 9px; border: 1px solid var(--line); border-radius: 7px; background: #fff; }
.contact-qr img { display: block; width: 100%; aspect-ratio: 1; object-fit: contain; }
.contact-meta { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding-top: 12px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; }
.contact-meta + .contact-meta { margin-top: 11px; }
.contact-meta strong { color: var(--ink); font: 500 13px var(--mono); }
.contact-meta a { color: var(--accent-dark); font-size: 11px; font-weight: 700; text-decoration: none; }

@media (max-width: 860px) {
  .shell { padding-right: 30px; padding-left: 30px; }
  .auth-view { gap: 46px; }
  .auth-panel { padding: 29px; }
}

@media (max-width: 700px) {
  .shell { padding: 21px 18px 20px; }
  .auth-view { display: flex; padding: 70px 0 80px; flex-direction: column; align-items: stretch; gap: 39px; }
  .auth-intro h1 { margin-top: 14px; font-size: clamp(45px, 13vw, 68px); }
  .auth-intro > p { max-width: 480px; }
  .access-notes { margin-top: 28px; }
  .auth-panel { width: min(520px, 100%); margin: 0 auto; }
  .plans-section { padding-top: 0; }
  .plans-heading { align-items: flex-start; flex-direction: column; gap: 9px; margin-bottom: 17px; }
  .plans-heading p { max-width: 460px; margin: 0; text-align: left; }
  .plans-grid { grid-template-columns: 1fr; gap: 11px; }
  .plan-card { min-height: 214px; padding: 21px 20px 19px; }
  .plan-price { margin-top: 18px; }
  .plan-copy { min-height: 0; margin-bottom: 18px; }
  .workspace-view { padding: 59px 0 72px; }
  .workspace-heading { align-items: flex-start; gap: 19px; }
  .workspace-heading h1 { font-size: clamp(44px, 13vw, 64px); }
  .managed-panel { padding: 25px 22px 26px; }
}

@media (max-width: 520px) {
  .topbar { padding-bottom: 14px; }
  .brand { font-size: 15px; }
  .brand-mark { width: 31px; height: 31px; font-size: 18px; }
  .status { font-size: 10px; }
  .topbar-actions { gap: 8px; }
  .top-link { display: none; }
  .contact-link { padding: 6px 8px; font-size: 10px; }
  .auth-view { padding-top: 61px; }
  .auth-panel { padding: 27px 19px; }
  .panel h2 { font-size: 25px; }
  .input-wrap { flex-wrap: wrap; }
  .input-wrap input { height: 42px; }
  .input-wrap button { width: 100%; min-height: 42px; }
  .managed-number { grid-template-areas: 'info' 'action' 'result'; grid-template-columns: 1fr; align-items: stretch; }
  .receive-btn { width: 100%; }
  .inline-result { align-items: flex-start; flex-direction: column; gap: 10px; }
  .inline-result-side { justify-items: start; text-align: left; }
  .switch-number-action { align-items: flex-start; flex-direction: column; }
  .switch-number-btn { width: 100%; }
  footer { align-items: flex-start; flex-direction: column; gap: 8px; }
  .contact-dialog { padding: 27px 19px; }
  .contact-meta { align-items: flex-start; flex-direction: column; gap: 5px; }
}
