/* ============================================================
   畅宥菜谱 · 用户中心（/account）
   依赖 site.css 中的设计令牌与通用组件；此处只写用户中心布局。
   ============================================================ */

body.account-page {
  background: var(--account-bg);
}

.account-main {
  min-height: 70vh;
  padding: 120px 0 84px;
}

.account-head {
  max-width: 720px;
  margin-bottom: 38px;
}

.account-head h1 {
  margin: 16px 0 14px;
  font-size: clamp(32px, 4vw, 44px);
  letter-spacing: -0.035em;
}

.account-head p {
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.85;
}

.account-grid {
  display: grid;
  grid-template-columns: 1.05fr 1.2fr;
  gap: 18px;
  align-items: start;
}

.account-card {
  min-width: 0;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--card-bg);
  box-shadow: var(--shadow-sm);
}

.account-card-wide {
  grid-column: 1 / -1;
}

.account-card.is-danger {
  border-color: var(--danger-line);
  background: var(--danger-soft);
}

.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.card-head h2 {
  font-size: 18px;
  letter-spacing: -0.02em;
}

.card-head p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.7;
}

.card-meta {
  flex: 0 0 auto;
  padding-top: 3px;
  color: var(--muted-2);
  font-size: 11.5px;
  white-space: nowrap;
}

.card-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}

.card-actions .card-meta {
  padding-top: 0;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  padding: 3px 9px;
  border: 1px solid var(--ok-line);
  border-radius: 99px;
  background: var(--ok-soft);
  color: var(--ok-text);
  font-size: 11px;
  white-space: nowrap;
}

.status-badge i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--teal);
}

.status-badge.is-muted {
  border-color: var(--line);
  background: var(--surface-2);
  color: var(--muted-2);
}

.status-badge.is-muted i {
  background: var(--muted-2);
}

/* ---------- 账号概览 ---------- */

.overview-profile {
  display: flex;
  align-items: center;
  gap: 16px;
}

.avatar {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: var(--grad);
  color: var(--on-brand);
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 600;
  text-shadow: var(--shadow-sm);
}

.overview-id {
  min-width: 0;
}

.overview-id h3 {
  font-size: 20px;
  letter-spacing: -0.02em;
  overflow-wrap: anywhere;
}

.overview-id p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.overview-rows {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 18px;
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.overview-rows dt {
  color: var(--muted-2);
  font-size: 11.5px;
}

.overview-rows dd {
  margin-top: 3px;
  color: var(--text-soft);
  font-size: 14px;
  font-weight: 500;
}

.overview-note {
  margin-top: 20px;
  color: var(--muted-2);
  font-size: 12px;
  line-height: 1.75;
}

.overview-note a {
  color: var(--brand);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ---------- 我的应用 ---------- */

.app-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.app-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--chip-bg);
  transition: border-color 0.2s, background 0.2s, transform 0.2s var(--ease);
}

.app-item:hover {
  transform: translateY(-1px);
  border-color: var(--brand-line);
  background: var(--surface);
}

.app-icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--app-icon-bg);
  color: var(--app-icon-text);
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
}

.app-copy {
  flex: 1;
  min-width: 0;
}

.app-copy strong {
  display: block;
  font-size: 14px;
  font-weight: 600;
}

.app-copy p {
  display: -webkit-box;
  margin-top: 3px;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.app-arrow {
  flex: 0 0 auto;
  color: var(--muted-2);
  transition: color 0.2s, transform 0.2s;
}

.app-item:hover .app-arrow {
  color: var(--brand);
  transform: translate(2px, -2px);
}

/* ---------- 安全设置 ---------- */

.device-list {
  display: flex;
  flex-direction: column;
}

.device-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 15px 0;
  border-bottom: 1px solid var(--line);
}

.device-item:first-child {
  padding-top: 2px;
}

.device-item:last-child {
  padding-bottom: 2px;
  border-bottom: none;
}

.device-icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--brand-soft);
  color: var(--brand-strong);
}

.device-main {
  flex: 1;
  min-width: 0;
}

.device-title {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.device-title strong {
  font-size: 14px;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.badge-current {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border: 1px solid var(--ok-line);
  border-radius: 99px;
  background: var(--ok-soft);
  color: var(--ok-text);
  font-size: 10.5px;
}

.badge-current i {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--teal);
}

.device-meta {
  display: block;
  margin-top: 3px;
  color: var(--muted-2);
  font-size: 12px;
  line-height: 1.6;
}

.device-hint {
  flex: 0 0 auto;
  color: var(--muted-2);
  font-size: 12px;
  white-space: nowrap;
}

.device-refresh {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.device-refresh.is-busy svg {
  animation: spin 0.9s linear infinite;
}

/* ---------- 退出登录 ---------- */

.logout-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.logout-card h2 {
  font-size: 18px;
}

.logout-card p {
  max-width: 640px;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.75;
}

.logout-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ---------- 加载 / 空 / 错误状态 ---------- */

.state-loading {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 4px 0;
}

.skeleton {
  display: block;
  height: 14px;
  border-radius: 7px;
  background: linear-gradient(90deg, var(--skeleton) 25%, var(--skeleton-shine) 37%, var(--skeleton) 63%);
  background-size: 400% 100%;
  animation: shimmer 1.4s ease infinite;
}

.skeleton-avatar {
  width: 76px;
  height: 76px;
  border-radius: 50%;
}

.skeleton-profile {
  display: flex;
  align-items: center;
  gap: 16px;
}

.skeleton-profile .skeleton-lines {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 10px;
}

.skeleton-lg {
  width: 58%;
  height: 20px;
}

.skeleton-md {
  width: 42%;
}

.skeleton-sm {
  width: 28%;
}

.skeleton-row {
  height: 38px;
  border-radius: 10px;
}

.state-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 34px 22px;
  border: 1px dashed var(--line-strong);
  border-radius: 16px;
  text-align: center;
  color: var(--muted);
}

.state-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-bottom: 4px;
  border-radius: 12px;
  background: var(--brand-soft);
  color: var(--brand-strong);
}

.state-block.is-error .state-icon {
  background: var(--danger-soft);
  color: var(--danger-text);
}

.state-block strong {
  color: var(--text-soft);
  font-size: 14px;
  font-weight: 600;
}

.state-block p {
  max-width: 420px;
  font-size: 12.5px;
  line-height: 1.75;
}

.state-block .btn {
  margin-top: 8px;
}

.account-foot-note {
  margin-top: 28px;
  color: var(--muted-2);
  font-size: 12px;
  line-height: 1.8;
}

.account-foot-note a {
  color: var(--brand);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ---------- 响应式 ---------- */

@media (max-width: 1024px) {
  .account-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .account-main {
    padding: 100px 0 64px;
  }

  .account-head {
    margin-bottom: 28px;
  }

  .account-card {
    padding: 20px;
    border-radius: 18px;
  }

  .overview-rows {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }

  .avatar {
    width: 64px;
    height: 64px;
    font-size: 24px;
  }

  .device-item {
    flex-wrap: wrap;
  }

  .device-hint {
    display: none;
  }

  .device-item .btn {
    margin-left: 52px;
  }

  .logout-actions {
    width: 100%;
  }

  .logout-actions .btn {
    flex: 1;
  }
}

@media (max-width: 480px) {
  .overview-rows {
    grid-template-columns: 1fr;
  }

  .device-item .btn {
    margin-left: 0;
    width: 100%;
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
