:root {
  --ink: #132721;
  --muted: #6e7e78;
  --paper: #f5f3ec;
  --paper-deep: #ebe7dc;
  --line: rgba(19, 39, 33, .13);
  --green: #0a7b63;
  --green-dark: #0d352e;
  --lime: #b9dc73;
  --orange: #e87942;
  --white: #fffef9;
  --shadow: 0 32px 90px rgba(31, 54, 45, .14);
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: var(--paper);
}

* { box-sizing: border-box; }

html { min-height: 100%; background: var(--paper); }

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background:
    linear-gradient(rgba(19, 39, 33, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(19, 39, 33, .035) 1px, transparent 1px),
    var(--paper);
  background-size: 38px 38px;
}

button, input { font: inherit; }
button { color: inherit; }

.ambient {
  position: fixed;
  z-index: -1;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(1px);
}

.ambient-one {
  width: 520px;
  height: 520px;
  top: -250px;
  right: -120px;
  background: radial-gradient(circle, rgba(185, 220, 115, .28), rgba(185, 220, 115, 0) 70%);
}

.ambient-two {
  width: 420px;
  height: 420px;
  bottom: -210px;
  left: -180px;
  background: radial-gradient(circle, rgba(10, 123, 99, .13), rgba(10, 123, 99, 0) 70%);
}

.site-header {
  width: min(1240px, calc(100% - 56px));
  height: 104px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 13px;
  color: inherit;
  text-decoration: none;
}

.brand strong {
  display: block;
  font-family: "Songti SC", "STSong", serif;
  font-size: 20px;
  letter-spacing: .08em;
}

.brand small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: .22em;
}

.brand-device, .mini-device, .empty-device {
  position: relative;
  display: grid;
  place-items: center;
  border: 2px solid currentColor;
  border-radius: 10px;
}

.brand-device {
  width: 31px;
  height: 43px;
  color: var(--green);
  transform: rotate(-5deg);
}

.brand-device span, .mini-device span, .empty-device span {
  position: absolute;
  bottom: 4px;
  width: 8px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
}

.header-account {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 14px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #41b883;
  box-shadow: 0 0 0 5px rgba(65, 184, 131, .13);
}

.text-button {
  margin-left: 8px;
  padding: 7px 0 7px 15px;
  border: 0;
  border-left: 1px solid var(--line);
  background: transparent;
  cursor: pointer;
}

main {
  width: min(1240px, calc(100% - 56px));
  min-height: calc(100vh - 174px);
  margin: 0 auto;
}

.login-layout {
  min-height: calc(100vh - 174px);
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(380px, .75fr);
  align-items: center;
  gap: clamp(48px, 9vw, 130px);
  padding: 72px 0 80px;
}

.login-story {
  max-width: 680px;
  animation: rise .7s both cubic-bezier(.2, .8, .2, 1);
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 11px;
  color: var(--green);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .22em;
}

.eyebrow span {
  width: 34px;
  height: 2px;
  background: var(--orange);
}

.login-story h1, .dashboard-heading h1 {
  font-family: "Songti SC", "STSong", serif;
  font-weight: 700;
}

.login-story h1 {
  margin: 26px 0 24px;
  font-size: clamp(50px, 6.1vw, 86px);
  line-height: 1.08;
  letter-spacing: -.055em;
}

.login-story h1 em {
  color: var(--green);
  font-style: normal;
}

.lead {
  max-width: 600px;
  margin: 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.9;
}

.story-rule {
  width: 100%;
  height: 1px;
  margin: 42px 0 28px;
  background: var(--line);
}

.story-points {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.story-points article {
  display: flex;
  gap: 12px;
}

.story-points strong {
  color: var(--orange);
  font-family: Georgia, serif;
  font-size: 12px;
}

.story-points b, .story-points span {
  display: block;
}

.story-points b {
  margin-bottom: 8px;
  font-size: 14px;
}

.story-points span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.login-panel {
  position: relative;
  padding: 44px 42px 34px;
  overflow: hidden;
  border: 1px solid rgba(13, 53, 46, .13);
  border-radius: 3px 34px 3px 3px;
  background: rgba(255, 254, 249, .88);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  animation: rise .7s .12s both cubic-bezier(.2, .8, .2, 1);
}

.login-panel::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 110px;
  height: 5px;
  background: var(--green);
}

.panel-number {
  position: absolute;
  top: 18px;
  right: 24px;
  color: rgba(13, 53, 46, .34);
  font: 10px/1 Georgia, serif;
  letter-spacing: .18em;
}

.login-heading {
  display: flex;
  align-items: center;
  gap: 17px;
  margin-bottom: 38px;
}

.mini-device {
  width: 48px;
  height: 63px;
  color: var(--green);
  border-radius: 15px;
  background: rgba(10, 123, 99, .06);
}

.login-heading h2 {
  margin: 0;
  font-family: "Songti SC", "STSong", serif;
  font-size: 27px;
}

.login-heading p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 13px;
}

form label {
  display: block;
  margin-bottom: 21px;
}

form label > span {
  display: block;
  margin-bottom: 9px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

input {
  width: 100%;
  height: 52px;
  padding: 0 15px;
  border: 1px solid rgba(19, 39, 33, .16);
  border-radius: 4px;
  outline: none;
  color: var(--ink);
  background: rgba(255, 255, 255, .72);
  transition: border-color .2s, box-shadow .2s, background .2s;
}

input:focus {
  border-color: var(--green);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(10, 123, 99, .09);
}

.password-field { position: relative; }
.password-field input { padding-right: 60px; }

.password-field button {
  position: absolute;
  top: 0;
  right: 0;
  height: 52px;
  padding: 0 14px;
  border: 0;
  color: var(--green);
  background: transparent;
  font-size: 12px;
  cursor: pointer;
}

.form-error {
  min-height: 22px;
  margin: -5px 0 10px;
  color: #b84e39;
  font-size: 12px;
}

.primary-button, .secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  border: 0;
  cursor: pointer;
  transition: transform .2s, box-shadow .2s, background .2s;
}

.primary-button {
  width: 100%;
  height: 56px;
  color: #fff;
  border-radius: 4px 15px 4px 4px;
  background: var(--green-dark);
  box-shadow: 0 14px 30px rgba(13, 53, 46, .2);
  font-weight: 600;
}

.primary-button svg, .secondary-button svg {
  width: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.primary-button:hover:not(:disabled) {
  transform: translateY(-2px);
  background: var(--green);
  box-shadow: 0 18px 38px rgba(10, 123, 99, .23);
}

.primary-button:disabled { cursor: wait; opacity: .65; }

.login-footnote {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin: 24px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.login-footnote svg {
  width: 16px;
  fill: none;
  stroke: var(--green);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.dashboard {
  padding: 68px 0 88px;
  animation: rise .55s both cubic-bezier(.2, .8, .2, 1);
}

.dashboard-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 42px;
}

.dashboard-heading h1 {
  margin: 18px 0 11px;
  font-size: clamp(39px, 5vw, 62px);
}

.dashboard-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.secondary-button {
  min-width: 130px;
  height: 44px;
  padding: 0 17px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: rgba(255, 254, 249, .72);
}

.secondary-button:hover {
  transform: translateY(-1px);
  border-color: rgba(10, 123, 99, .42);
  color: var(--green);
  background: #fff;
}

.dashboard-notice {
  margin: -22px 0 26px;
  padding: 12px 15px;
  border-left: 3px solid var(--orange);
  color: #8c4b2d;
  background: rgba(232, 121, 66, .08);
  font-size: 13px;
}

.phone-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
}

.phone-card {
  position: relative;
  min-height: 460px;
  padding: 28px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 4px 28px 4px 4px;
  background: rgba(255, 254, 249, .84);
  box-shadow: 0 18px 45px rgba(31, 54, 45, .08);
}

.phone-card::after {
  content: "";
  position: absolute;
  top: -55px;
  right: -55px;
  width: 130px;
  height: 130px;
  border: 1px solid rgba(10, 123, 99, .12);
  border-radius: 50%;
}

.phone-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.phone-icon {
  display: grid;
  width: 44px;
  height: 58px;
  place-items: center;
  border: 1px solid rgba(10, 123, 99, .25);
  border-radius: 12px;
  color: var(--green);
  background: rgba(10, 123, 99, .07);
}

.phone-icon svg {
  width: 23px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.6;
}

.state-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
}

.state-pill::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.state-online { color: #16865c; background: rgba(22, 134, 92, .09); }
.state-offline { color: #9a5a45; background: rgba(154, 90, 69, .09); }

.phone-card h2 {
  margin: 0 0 5px;
  font-family: "Songti SC", "STSong", serif;
  font-size: 23px;
}

.phone-title-row {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-top: 22px;
}

.phone-code {
  color: var(--muted);
  font: 11px/1.5 Georgia, serif;
  letter-spacing: .08em;
}

.business-state {
  flex: none;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 3px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .04em;
}

.business-state.is-open {
  color: #08785b;
  border-color: rgba(8, 120, 91, .22);
  background: rgba(8, 120, 91, .07);
}

.business-state.is-closed {
  color: #6e6252;
  background: rgba(110, 98, 82, .07);
}

.business-state.is-attention {
  color: #a7592f;
  border-color: rgba(167, 89, 47, .22);
  background: rgba(232, 121, 66, .08);
}

.business-state.is-working {
  color: #436c73;
  background: rgba(67, 108, 115, .08);
}

.business-state.is-error {
  color: #b33f36;
  background: rgba(179, 63, 54, .08);
}

.state-message {
  min-height: 42px;
  margin: 20px 0 18px;
  padding: 12px 14px;
  border-left: 2px solid var(--green);
  color: #405a52;
  background: rgba(10, 123, 99, .055);
  font-size: 12px;
  line-height: 1.5;
}

.business-actions {
  min-height: 115px;
}

.guided-step {
  display: flex;
  gap: 12px;
  margin-bottom: 14px;
}

.step-number {
  color: var(--orange);
  font: 12px/1.4 Georgia, serif;
}

.guided-step b,
.guided-step p {
  display: block;
  margin: 0;
}

.guided-step b { font-size: 13px; }
.guided-step p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.controlled-input {
  display: block;
  margin-bottom: 12px;
}

.controlled-input span {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

.controlled-input input {
  height: 44px;
  background: #fff;
}

.split-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}

.change-phone {
  margin-top: 14px;
  padding-top: 11px;
  border-top: 1px solid var(--line);
}

.change-phone summary {
  width: fit-content;
  color: var(--green);
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
  list-style-position: inside;
}

.change-phone[open] summary {
  margin-bottom: 12px;
}

.change-phone .business-button {
  min-height: 42px;
}

.change-phone > p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
}

.business-button {
  width: 100%;
  min-height: 46px;
  padding: 0 14px;
  border: 1px solid var(--green-dark);
  border-radius: 4px 13px 4px 4px;
  color: #fff;
  background: var(--green-dark);
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  transition: transform .2s, border-color .2s, background .2s;
}

.business-button:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: var(--green);
  background: var(--green);
}

.business-button.is-secondary {
  color: var(--green-dark);
  border-color: rgba(13, 53, 46, .22);
  background: transparent;
}

.business-button.is-secondary:hover:not(:disabled) {
  color: var(--green);
  background: rgba(10, 123, 99, .05);
}

.business-button.is-start {
  box-shadow: 0 12px 26px rgba(13, 53, 46, .16);
}

.business-button.is-stop {
  color: #a33e2f;
  border-color: rgba(163, 62, 47, .28);
  background: rgba(163, 62, 47, .05);
}

.business-button.is-stop:hover:not(:disabled) {
  color: #fff;
  border-color: #a33e2f;
  background: #a33e2f;
}

.business-button.is-logout {
  color: #7a3e35;
  border-color: rgba(122, 62, 53, .24);
  background: transparent;
}

.business-button.is-logout:hover:not(:disabled) {
  color: #fff;
  border-color: #7a3e35;
  background: #7a3e35;
}

.business-button:disabled {
  color: var(--muted);
  border-color: var(--line);
  background: var(--paper-deep);
  cursor: wait;
}

.safety-note {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  min-height: 52px;
  margin-bottom: 12px;
}

.safety-note span {
  flex: none;
  width: 8px;
  height: 8px;
  margin-top: 4px;
  border-radius: 50%;
  background: #9b8c70;
  box-shadow: 0 0 0 5px rgba(155, 140, 112, .12);
}

.safety-note.is-live span {
  background: #1b9b6c;
  box-shadow: 0 0 0 5px rgba(27, 155, 108, .12);
}

.safety-note p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.55;
}

.command-result {
  margin-top: 15px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  background: rgba(235, 231, 220, .45);
  font-size: 11px;
}

.command-result > div {
  display: flex;
  justify-content: space-between;
  gap: 14px;
}

.command-result strong { color: var(--green); }
.command-result.is-failed strong,
.command-result.is-expired strong { color: #aa4937; }
.command-result.is-running strong { animation: pulse 1.2s infinite alternate; }

.command-result p {
  margin: 7px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.phone-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 9px;
}

.phone-tools {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 29px;
  margin-top: 13px;
}

.view-link,
.support-link {
  padding: 0;
  border: 0;
  border-bottom: 1px solid currentColor;
  background: transparent;
  cursor: pointer;
  font-size: 10px;
}

.view-link {
  color: var(--green);
  font-weight: 700;
}

.view-link span {
  margin-left: 5px;
  padding: 2px 5px;
  border: 1px solid rgba(10, 123, 99, .2);
  border-radius: 10px;
  font-size: 8px;
  letter-spacing: .08em;
}

.support-link { color: var(--muted); }

.view-link:disabled,
.support-link:disabled {
  color: var(--muted);
  cursor: wait;
  opacity: .6;
}

.phone-facts {
  margin: 24px 0 25px;
  border-top: 1px solid var(--line);
}

.phone-facts div {
  display: flex;
  justify-content: space-between;
  gap: 15px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
}

.phone-facts dt { color: var(--muted); }
.phone-facts dd { margin: 0; text-align: right; }
.healthy { color: var(--green); font-weight: 600; }

.connect-button {
  width: 100%;
  height: 48px;
  border: 0;
  border-radius: 4px 13px 4px 4px;
  color: #fff;
  background: var(--green-dark);
  cursor: pointer;
  font-weight: 600;
  transition: background .2s, transform .2s;
}

.connect-button:hover:not(:disabled) {
  transform: translateY(-1px);
  background: var(--green);
}

.connect-button:disabled {
  color: var(--muted);
  background: var(--paper-deep);
  cursor: not-allowed;
}

.phone-error {
  margin: 13px 0 0;
  padding: 9px 11px;
  border-left: 2px solid #a95036;
  background: rgba(169, 80, 54, .06);
  color: #a95036;
  font-size: 11px;
  line-height: 1.5;
}

.confirm-dialog {
  position: fixed;
  z-index: 40;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
}

.confirm-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(12, 28, 23, .66);
  backdrop-filter: blur(8px);
}

.confirm-card {
  position: relative;
  width: min(470px, 100%);
  padding: 35px;
  border: 1px solid rgba(255, 255, 255, .35);
  border-radius: 4px 28px 4px 4px;
  background: var(--white);
  box-shadow: 0 34px 100px rgba(0, 0, 0, .28);
  animation: rise .25s both;
}

.confirm-kicker {
  color: var(--orange);
  font: 10px/1 Georgia, serif;
  letter-spacing: .2em;
}

.confirm-card h2 {
  margin: 17px 0 13px;
  font-family: "Songti SC", "STSong", serif;
  font-size: 30px;
}

.confirm-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.75;
}

.confirm-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 28px;
}

.dialog-secondary,
.dialog-danger {
  height: 46px;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 700;
}

.dialog-secondary {
  border: 1px solid var(--line);
  background: transparent;
}

.dialog-danger {
  border: 1px solid #a33e2f;
  color: #fff;
  background: #a33e2f;
}

.empty-state {
  padding: 90px 20px;
  text-align: center;
}

.empty-device {
  width: 58px;
  height: 78px;
  margin: 0 auto 24px;
  color: rgba(10, 123, 99, .35);
  border-radius: 17px;
}

.empty-state h2 {
  margin: 0 0 10px;
  font-family: "Songti SC", "STSong", serif;
}

.empty-state p { color: var(--muted); }

footer {
  width: min(1240px, calc(100% - 56px));
  height: 70px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
}

.is-hidden { display: none !important; }

@keyframes rise {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
  from { opacity: .45; }
  to { opacity: 1; }
}

@media (max-width: 960px) {
  .login-layout {
    grid-template-columns: 1fr;
    gap: 45px;
    padding-top: 48px;
  }
  .login-story { max-width: none; }
  .login-story h1 { font-size: clamp(47px, 10vw, 72px); }
  .login-panel { width: min(520px, 100%); }
  .phone-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  .site-header, main, footer { width: min(100% - 32px, 1240px); }
  .site-header { height: 82px; }
  .brand small { display: none; }
  .header-account #headerName { display: none; }
  .login-layout { padding: 42px 0 56px; }
  .login-story h1 { margin-top: 18px; font-size: 43px; }
  .lead { font-size: 15px; line-height: 1.75; }
  .story-points { grid-template-columns: 1fr; gap: 15px; }
  .story-rule { margin: 30px 0 22px; }
  .login-panel { padding: 38px 24px 27px; border-radius: 3px 25px 3px 3px; }
  .dashboard { padding-top: 42px; }
  .dashboard-heading { align-items: flex-start; flex-direction: column; }
  .phone-grid { grid-template-columns: 1fr; }
  .phone-card { min-height: 0; }
  footer { align-items: flex-start; height: auto; padding: 24px 0; flex-direction: column; gap: 8px; }
}

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