/* ==========================================================================
   账号中心（/account 及其子页）
   左侧导航 + 右侧内容，移动端折叠为横向滚动标签
   ========================================================================== */

.acct-body { min-height: 100vh; }

.acct-shell {
  display: grid;
  grid-template-columns: 216px minmax(0, 1fr);
  gap: 40px;
  padding-block: clamp(28px, 4vw, 48px) 80px;
  align-items: start;
}

/* ---------- 侧边导航 ---------- */
.acct-nav {
  position: sticky;
  top: calc(var(--header-h) + 24px);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.acct-nav-group {
  font-size: var(--fs-2xs);
  font-weight: 600;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--text-subtle);
  padding: 16px 12px 7px;
}

.acct-nav-group:first-child { padding-top: 0; }

.acct-nav a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 9px;
  font-size: var(--fs-sm);
  color: var(--text-muted);
  transition: background var(--dur-fast) var(--ease-out),
              color var(--dur-fast) var(--ease-out);
}

.acct-nav a:hover {
  background: var(--surface);
  color: var(--ink);
}

.acct-nav a[aria-current="page"] {
  background: var(--accent-tint);
  color: var(--accent-text);
  font-weight: 500;
}

.acct-nav .nav-badge {
  font-size: var(--fs-2xs);
  font-weight: 600;
  min-width: 19px;
  height: 19px;
  padding: 0 5px;
  border-radius: var(--radius-pill);
  background: var(--accent);
  color: #fff;
  display: grid;
  place-items: center;
  font-variant-numeric: tabular-nums;
}

/* ---------- 内容区 ---------- */
.acct-main { min-width: 0; }

.acct-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  margin-bottom: 26px;
}

.acct-head h1 {
  font-size: clamp(1.4rem, 1.2rem + .9vw, 1.85rem);
  letter-spacing: -.015em;
  line-height: 1.24;
}

.acct-head p {
  margin-top: 7px;
  font-size: var(--fs-sm);
  color: var(--text-muted);
  line-height: 1.6;
}

/* ---------- 统计卡 ---------- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 30px;
}

.stat {
  padding: 18px 20px;
  border-radius: var(--radius-card);
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line);
}

.stat-label {
  font-size: var(--fs-2xs);
  color: var(--text-subtle);
  letter-spacing: .04em;
  margin-bottom: 8px;
}

.stat-value {
  font-size: 1.4rem;
  font-weight: 650;
  letter-spacing: -.02em;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}

.stat-value small {
  font-size: var(--fs-xs);
  font-weight: 400;
  color: var(--text-subtle);
  margin-left: 3px;
}

.stat.is-accent .stat-value { color: var(--accent-text); }

/* ---------- 机器卡 ---------- */
.machine {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 20px;
  align-items: center;
  padding: 20px 22px;
  border-radius: var(--radius-card);
  background: var(--page);
  box-shadow: 0 0 0 1px var(--line);
  transition: box-shadow var(--dur-fast) var(--ease-out);
}

.machine + .machine { margin-top: 12px; }
.machine:hover { box-shadow: 0 0 0 1px var(--line-strong); }

.machine-icon {
  width: 44px;
  height: 44px;
  border-radius: 11px;
  background: var(--accent-tint);
  color: var(--accent-text);
  display: grid;
  place-items: center;
  font-size: 18px;
  font-weight: 700;
  flex: none;
}

.machine-name {
  font-size: var(--fs-base);
  font-weight: 600;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.machine-meta {
  font-size: var(--fs-xs);
  color: var(--text-subtle);
  line-height: 1.6;
  font-variant-numeric: tabular-nums;
}

.machine-meta code {
  font-family: var(--font-mono);
  font-size: .95em;
  color: var(--text-muted);
}

.machine-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.machine-actions .btn { padding: 8px 14px; font-size: var(--fs-xs); }

/* ---------- 空状态 ---------- */
.empty {
  padding: 52px 28px;
  text-align: center;
  border-radius: var(--radius-panel);
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line);
}

.empty-icon {
  width: 52px;
  height: 52px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: var(--accent-tint);
  color: var(--accent-text);
  display: grid;
  place-items: center;
  font-size: 21px;
}

.empty h3 { font-size: var(--fs-md); margin-bottom: 8px; }

.empty p {
  font-size: var(--fs-sm);
  color: var(--text-muted);
  line-height: 1.62;
  max-width: 400px;
  margin: 0 auto 20px;
}

/* ---------- 表单卡片 ---------- */
.panel {
  padding: 24px 26px;
  border-radius: var(--radius-panel);
  background: var(--page);
  box-shadow: 0 0 0 1px var(--line);
}

.panel + .panel { margin-top: 18px; }

.panel-title {
  font-size: var(--fs-md);
  font-weight: 600;
  margin-bottom: 4px;
}

.panel-desc {
  font-size: var(--fs-sm);
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 22px;
}

.panel-danger { box-shadow: 0 0 0 1px #d645451f; }

/* ---------- 工单 ---------- */
.ticket-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 16px 18px;
  border-radius: var(--radius-card);
  background: var(--page);
  box-shadow: 0 0 0 1px var(--line);
}

.ticket-row + .ticket-row { margin-top: 10px; }

.ticket-id {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--text-subtle);
  white-space: nowrap;
}

.ticket-subject {
  font-size: var(--fs-sm);
  font-weight: 500;
  margin-bottom: 3px;
}

.ticket-meta {
  font-size: var(--fs-2xs);
  color: var(--text-subtle);
  font-variant-numeric: tabular-nums;
}

/* ---------- 消息列表 ---------- */
.msg-list { display: flex; flex-direction: column; gap: 2px; }

.msg-item {
  display: flex;
  gap: 14px;
  padding: 15px 16px;
  border-radius: var(--radius-card);
  transition: background var(--dur-fast) var(--ease-out);
}

.msg-item:hover { background: var(--surface); }

.msg-item.is-unread { background: var(--accent-tint); }

.msg-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--line-strong);
  margin-top: 8px;
  flex: none;
}

.msg-item.is-unread .msg-dot { background: var(--accent); }

.msg-body { flex: 1; min-width: 0; }

.msg-title {
  font-size: var(--fs-sm);
  font-weight: 500;
  margin-bottom: 4px;
}

.msg-text {
  font-size: var(--fs-xs);
  color: var(--text-muted);
  line-height: 1.6;
}

.msg-time {
  font-size: var(--fs-2xs);
  color: var(--text-subtle);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* ---------- 表格（钱包流水） ---------- */
.flow-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-sm);
}

.flow-table th {
  font-size: var(--fs-2xs);
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text-subtle);
  text-align: left;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
}

.flow-table td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  font-variant-numeric: tabular-nums;
}

.flow-table tbody tr:last-child td { border-bottom: none; }

.flow-amount.is-plus { color: var(--success); font-weight: 600; }
.flow-amount.is-minus { color: var(--ink); font-weight: 600; }

/* ---------- 响应式 ---------- */
@media (max-width: 1024px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 860px) {
  .acct-shell {
    grid-template-columns: 1fr;
    gap: 22px;
    padding-block: 20px 60px;
  }

  .acct-nav {
    position: static;
    flex-direction: row;
    overflow-x: auto;
    gap: 6px;
    padding-bottom: 6px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .acct-nav::-webkit-scrollbar { display: none; }

  .acct-nav-group { display: none; }

  .acct-nav a {
    white-space: nowrap;
    padding: 8px 14px;
    background: var(--surface);
    border-radius: var(--radius-pill);
    font-size: var(--fs-xs);
  }

  .acct-nav a[aria-current="page"] {
    background: var(--accent);
    color: #fff;
  }

  .machine {
    grid-template-columns: auto minmax(0, 1fr);
    gap: 14px;
  }

  .machine-actions {
    grid-column: 1 / -1;
    margin-top: 4px;
  }

  .ticket-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }
}

@media (max-width: 560px) {
  .stat-grid { grid-template-columns: 1fr; }
  .acct-head { margin-bottom: 18px; }
  .panel { padding: 20px 18px; }
}
