/* Product portal */
.portal-wrap {
  max-width: 1000px;
  padding-top: 64px;
}
.portal-intro {
  margin-bottom: 36px;
}
.intro-label {
  display: inline-block;
  color: var(--brand);
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 16px;
}
.portal-intro h1 {
  font-size: 40px;
  letter-spacing: -1.5px;
}
.portal-intro p {
  color: var(--muted);
  margin-top: 14px;
  font-size: 15px;
}
.mobile-break {
  display: none;
}
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(292px, 1fr));
  gap: 24px;
}
.product-card {
  display: block;
  padding: 30px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 20px;
  color: var(--ink);
  text-decoration: none;
  transition:
    transform 0.2s,
    box-shadow 0.2s,
    border-color 0.2s;
}
.product-card:hover {
  transform: translateY(-4px);
  border-color: #b9c1ee;
  box-shadow: 0 12px 32px #303f7410;
}
.product-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 30px;
}
.product-icon {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 17px;
  background: #edf1ff;
  color: var(--brand);
}
.product-icon .icon {
  width: 28px;
  height: 28px;
}
.lite-product .product-icon {
  background: #fff4e7;
  color: #b77d31;
}
/* 山野之径：走户外绿，和相机、自动化区分开 */
.wildtrail-product .product-icon {
  background: #e9f3ec;
  color: #3d7a52;
}
.wildtrail-product .product-action {
  color: #3d7a52;
}
.wildtrail-product .arrow-circle {
  background: #e9f3ec;
  color: #3d7a52;
}
.arrow-circle .icon {
  width: 17px;
  height: 17px;
}
.product-kind {
  color: var(--muted);
  font-size: 12px;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 4px 10px;
}
.product-card h2 {
  font-size: 25px;
}
.product-description {
  color: var(--muted);
  font-size: 14px;
  margin-top: 10px;
}
.product-features {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-top: 24px;
  font-size: 12px;
  color: #59657a;
}
.product-features span::before {
  content: "✓";
  color: var(--brand);
  margin-right: 5px;
}
.product-action {
  border-top: 1px solid var(--line);
  margin-top: 28px;
  padding-top: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--brand);
  font-size: 14px;
  font-weight: 600;
}
.arrow-circle {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--tint);
  font-size: 19px;
}
.portal-help {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-top: 28px;
  padding: 22px 24px;
  border: 1px dashed #d8ddea;
  border-radius: 14px;
}
.portal-help .icon {
  color: var(--brand);
  margin-top: 2px;
  width: 19px;
  height: 19px;
}
.portal-help h3 {
  font-size: 14px;
  font-weight: 600;
}
.portal-help p {
  font-size: 13px;
  color: var(--muted);
  margin-top: 5px;
}
/* 小程序码弹层 */
.qr-modal {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 24px;
}
/* .qr-modal 是 grid，会盖掉 [hidden]，这里显式关掉 */
.qr-modal[hidden] {
  display: none;
}
.qr-mask {
  position: absolute;
  inset: 0;
  background: #1b223399;
  backdrop-filter: blur(2px);
}
.qr-dialog {
  position: relative;
  width: min(352px, 100%);
  padding: 32px 28px 24px;
  background: #fff;
  border-radius: 20px;
  text-align: center;
  box-shadow: 0 24px 64px #1b223345;
  animation: qr-in 0.18s ease-out;
}
@keyframes qr-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }
}
.qr-close {
  position: absolute;
  top: 12px;
  right: 12px;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #f4f5fa;
  color: #7d8799;
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
}
.qr-close:hover {
  background: #eaecf5;
  color: var(--ink);
}
.qr-title {
  font-size: 20px;
  letter-spacing: 0.2px;
}
.qr-sub {
  margin-top: 7px;
  color: var(--muted);
  font-size: 13px;
}
.qr-box {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 216px;
  height: 216px;
  margin: 20px auto 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  overflow: hidden;
}
/* 用 max-* 而不是 100%：栅格行高是 auto 时百分比高度算不出来，图会撑破框 */
.qr-box img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
}
/* display:block 会盖掉 [hidden] 的默认 display:none，这里显式收回来 */
.qr-box img[hidden] {
  display: none;
}
.qr-missing {
  padding: 0 12px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.8;
}
.qr-tip {
  margin-top: 16px;
  color: #8791a3;
  font-size: 12px;
}
/* Sign in */
.auth-layout {
  max-width: 1000px;
  min-height: calc(100vh - 80px);
  margin: auto;
  padding: 64px 40px;
  display: grid;
  align-items: center;
  grid-template-columns: 1fr 420px;
  gap: 80px;
}
.auth-intro h1 {
  font-size: 38px;
  line-height: 1.5;
  letter-spacing: -1px;
}
.auth-intro > p {
  color: var(--muted);
  margin-top: 18px;
  max-width: 340px;
}
.auth-features {
  display: grid;
  gap: 24px;
  margin-top: 42px;
}
.auth-feature {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}
.auth-feature > span {
  display: grid;
  place-items: center;
  height: 38px;
  width: 38px;
  border: 1px solid #e0e4f5;
  border-radius: 12px;
  background: #fff;
  color: var(--brand);
  font-size: 14px;
}
.auth-feature b {
  font-size: 14px;
  font-weight: 600;
}
.auth-feature p {
  font-size: 13px;
  color: var(--muted);
  margin-top: 3px;
}
.auth-card {
  padding: 34px;
  box-shadow: 0 12px 40px #303f7408;
}
.auth-card .section-heading {
  margin-bottom: 12px;
}
.auth-card .section-description {
  margin-bottom: 28px;
}
.auth-switch {
  display: flex;
  justify-content: center;
  margin-top: 18px;
}
.auth-footnote {
  font-size: 12px;
  color: var(--muted);
  text-align: center;
  margin-top: 24px;
}
/* Workspace */
.workspace {
  display: grid;
  grid-template-columns: 228px minmax(0, 1fr);
  min-height: calc(100vh - 80px);
}
.sidebar {
  border-right: 1px solid var(--line);
  background: #fff;
  padding: 30px 18px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}
.sidebar-caption {
  font-size: 12px;
  color: #7d8799;
  padding: 0 16px;
  margin-bottom: 12px;
}
.workspace-nav {
  display: grid;
  gap: 7px;
}
.nav-button {
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  width: 100%;
  padding: 13px 16px;
  background: transparent;
  color: #687386;
  font-weight: 500;
}
.nav-button .icon {
  width: 20px;
  height: 20px;
}
.nav-button:hover {
  background: #f8f9fd;
}
.nav-button[aria-current="page"] {
  color: var(--brand);
  background: var(--tint);
  font-weight: 650;
}
.sidebar-help {
  margin-top: auto;
  padding: 16px;
  border-radius: 12px;
  background: #f8f9fc;
  font-size: 12px;
  color: var(--muted);
}
.sidebar-help b {
  display: block;
  color: #4e5970;
  margin-bottom: 5px;
  font-weight: 600;
}
.workspace-main {
  min-width: 0;
  padding: 36px 40px 48px;
  max-width: 1500px;
  width: 100%;
  margin: 0 auto;
}
.workspace-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
  gap: 16px;
}
.workspace-heading h1 {
  font-size: 26px;
}
.workspace-heading p {
  color: var(--muted);
  font-size: 14px;
  margin-top: 7px;
}
.user-control {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
}
.user-avatar {
  background: var(--tint);
  color: var(--brand);
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-weight: 700;
}
.user-name {
  max-width: 130px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.stat-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 28px;
}
.stat {
  padding: 22px 24px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 13px;
}
.stat span {
  color: var(--muted);
  font-size: 13px;
}
.stat b {
  display: block;
  font-size: 29px;
  line-height: 1.3;
  margin-top: 10px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}
.stat:first-child {
  background: var(--tint);
  border-color: #e1e5ff;
}
.stat:first-child b {
  color: var(--brand);
}
.workflow-note {
  display: flex;
  gap: 12px;
  padding: 15px 18px;
  margin-bottom: 24px;
  border-radius: 10px;
  background: #eff2ff;
  color: #5c6687;
  font-size: 13px;
}
.workflow-note .icon {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  color: var(--brand);
}
.workflow-note a {
  font-weight: 600;
  text-underline-offset: 3px;
}
.list-toolbar {
  display: flex;
  gap: 12px;
  margin-bottom: 22px;
}
.search-field {
  max-width: 340px;
  flex: 1;
  position: relative;
}
.search-field .icon {
  position: absolute;
  left: 12px;
  top: 13px;
  color: #8791a3;
  width: 18px;
  height: 18px;
}
.search-field input {
  height: 44px;
  padding-left: 39px;
  font-size: 14px;
}
.filter-select {
  width: 128px;
  height: 44px;
  font-size: 14px;
}
.account-list {
  display: grid;
}
.account-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 21px 0;
  border-top: 1px solid var(--line);
}
.account-main {
  display: grid;
  min-width: 0;
  gap: 5px;
}
.account-title {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
.account-main b {
  font-size: 15px;
  font-weight: 650;
  overflow-wrap: anywhere;
}
.account-meta {
  font-size: 13px;
  color: var(--muted);
  overflow-wrap: anywhere;
}
.account-details {
  font-size: 12px;
  color: var(--muted);
  margin-top: 3px;
}
.account-details summary {
  cursor: pointer;
}
.account-details p {
  overflow-wrap: anywhere;
  margin-top: 6px;
}
.account-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.account-actions .danger {
  color: #b54f49;
}
.empty-state {
  text-align: center;
  padding: 45px 16px;
}
.empty-icon {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  margin: 0 auto 18px;
  border-radius: 17px;
  background: #f1f3fb;
  color: #8b96bb;
}
.empty-state h3 {
  font-size: 16px;
}
.empty-state p {
  font-size: 14px;
  color: var(--muted);
  margin-top: 8px;
}
.empty-state button {
  margin-top: 22px;
}
.account-feedback {
  margin-bottom: 16px;
}
.plan-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  margin-top: 24px;
}
.credit-card {
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}
.credit-card:nth-child(2) {
  border-color: #aeb7ef;
  background: #fafaff;
}
.plan-count {
  font-size: 17px;
  font-weight: 600;
}
.plan-price {
  color: var(--ink);
  font-size: 34px;
  font-weight: 650;
  margin: 18px 0 4px;
}
.plan-price small {
  font-size: 17px;
  margin-right: 3px;
}
.plan-note {
  font-size: 13px;
  color: var(--muted);
}
.credit-card button {
  width: 100%;
  margin-top: 24px;
}
.credit-rules {
  margin-top: 28px;
  padding: 24px;
}
.credit-rules h3 {
  font-size: 15px;
  margin-bottom: 12px;
}
.credit-rules p {
  color: var(--muted);
  font-size: 14px;
  margin-top: 8px;
}
.settings-tabs {
  display: flex;
  gap: 6px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 24px;
  padding-bottom: 12px;
}
.settings-tabs button {
  background: transparent;
  color: var(--muted);
  font-weight: 500;
}
.settings-tabs button[aria-pressed="true"] {
  background: var(--tint);
  color: var(--brand);
}
.settings-section {
  max-width: 900px;
}
.settings-section > .section-description {
  margin: 6px 0 24px;
}
.mode-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}
.radio-inline {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
  font-size: 14px;
}
.radio-inline input {
  accent-color: var(--brand);
  margin-top: 5px;
}
.radio-inline:has(input:checked) {
  background: #f6f7ff;
  border-color: #b5bdef;
}
.radio-inline small {
  display: block;
  color: var(--muted);
  margin-top: 6px;
  font-size: 13px;
}
.mini-title {
  margin: 28px 0 16px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  font-size: 16px;
}
.kv-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 24px;
}
.kv {
  padding: 14px 18px;
  min-width: 0;
  border-bottom: 1px solid var(--line);
}
.kv span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 5px;
}
.kv b {
  font-size: 13px;
  font-weight: 500;
  overflow-wrap: anywhere;
}
.token-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding: 12px;
  background: #f7f8fc;
  border-radius: 10px;
  margin-bottom: 20px;
  font-size: 12px;
  color: var(--muted);
}
.token-row code {
  overflow-wrap: anywhere;
  max-width: 100%;
  color: #4b5879;
}
.token-row button {
  padding: 6px 10px;
  min-height: 36px;
  color: var(--brand);
  background: #fff;
  border-color: var(--line);
  font-size: 12px;
}
.field input[type="file"] {
  height: auto;
  padding: 9px;
  font-size: 13px;
}
.field input::file-selector-button {
  padding: 5px 8px;
  margin-right: 8px;
  border: none;
  border-radius: 4px;
  background: var(--tint);
  color: var(--brand);
  cursor: pointer;
}
.empty-note {
  color: var(--muted);
  font-size: 14px;
  padding: 20px 0;
}
@media (min-width: 1500px) {
  .workspace-main {
    padding: 40px 56px;
  }
}
@media (max-width: 1050px) {
  .workspace {
    grid-template-columns: 190px minmax(0, 1fr);
  }
  .workspace-main {
    padding: 30px 24px;
  }
  .stat {
    padding: 18px;
  }
  .stat-row {
    gap: 12px;
  }
  .auth-layout {
    gap: 40px;
    grid-template-columns: 1fr 390px;
  }
  .plan-cards {
    gap: 12px;
  }
  .credit-card {
    padding: 20px;
  }
}
@media (max-width: 760px) {
  .portal-wrap {
    padding-top: 38px;
  }
  .portal-intro {
    margin-bottom: 28px;
  }
  .portal-intro h1 {
    font-size: 30px;
    line-height: 1.45;
    letter-spacing: -0.8px;
  }
  .portal-intro p {
    font-size: 14px;
    max-width: 290px;
  }
  .mobile-break {
    display: inline;
  }
  .product-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
  }
  .product-card {
    padding: 24px;
    border-radius: 16px;
  }
  .product-top {
    margin-bottom: 22px;
  }
  .product-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
  }
  .product-card h2 {
    font-size: 23px;
  }
  .product-features {
    margin-top: 20px;
    gap: 8px 10px;
  }
  .product-action {
    margin-top: 22px;
    padding-top: 17px;
  }
  .portal-help {
    padding: 18px;
    margin-top: 20px;
  }
  .auth-layout {
    display: block;
    padding: 32px 18px;
    min-height: auto;
  }
  .auth-intro {
    margin: 0 auto 26px;
    max-width: 440px;
  }
  .auth-intro h1 {
    font-size: 28px;
  }
  .auth-intro > p {
    font-size: 14px;
    margin-top: 10px;
    max-width: none;
  }
  .auth-features {
    display: none;
  }
  .auth-card {
    max-width: 440px;
    margin: auto;
    padding: 26px 22px;
  }
  .workspace {
    display: block;
    min-height: calc(100vh - 68px);
  }
  .sidebar {
    padding: 10px 18px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 5;
  }
  .sidebar-caption,
  .sidebar-help {
    display: none;
  }
  .workspace-nav {
    display: flex;
    gap: 8px;
  }
  .nav-button {
    flex: 1;
    width: auto;
    padding: 11px 8px;
    justify-content: center;
    gap: 7px;
    font-size: 13px;
    white-space: nowrap;
  }
  .nav-button .icon {
    width: 17px;
    height: 17px;
  }
  .workspace-main {
    padding: 26px 18px 36px;
  }
  .workspace-heading {
    margin-bottom: 22px;
  }
  .workspace-heading h1 {
    font-size: 24px;
  }
  .workspace-heading p {
    font-size: 13px;
  }
  .user-control {
    gap: 6px;
  }
  .user-name {
    max-width: 72px;
  }
  .user-control button {
    padding: 6px;
    font-size: 12px;
  }
  .user-avatar {
    display: none;
  }
  .stat-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-bottom: 22px;
    gap: 10px;
  }
  .stat {
    padding: 16px 18px;
    border-radius: 11px;
  }
  .stat b {
    font-size: 26px;
    margin-top: 7px;
  }
  .workflow-note {
    padding: 13px 14px;
    margin-bottom: 20px;
    font-size: 12px;
  }
  .accounts-panel {
    padding: 20px 18px;
  }
  .accounts-panel .section-heading h2 {
    font-size: 18px;
  }
  .accounts-panel .section-description {
    font-size: 12px;
  }
  .accounts-panel .section-heading button {
    min-height: 40px;
    padding: 8px 11px;
    font-size: 13px;
  }
  .list-toolbar {
    gap: 10px;
  }
  .search-field input,
  .filter-select {
    font-size: 16px;
  }
  .filter-select {
    width: 112px;
  }
  .account-row {
    padding: 20px 0;
    gap: 14px;
  }
  .account-actions {
    width: 100%;
  }
  .account-actions button {
    flex: 1;
    min-height: 42px;
  }
  .account-meta {
    font-size: 12px;
  }
  .plan-cards {
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
  }
  .credit-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    column-gap: 16px;
    padding: 22px;
  }
  .plan-price {
    grid-column: 2;
    grid-row: 1 / 3;
    margin: 0;
    align-self: center;
    font-size: 30px;
  }
  .plan-note {
    font-size: 12px;
    margin-top: 4px;
  }
  .credit-card button {
    grid-column: 1 / -1;
    margin-top: 18px;
  }
  .settings-tabs {
    gap: 4px;
  }
  .settings-tabs button {
    flex: 1;
    padding: 8px 6px;
    font-size: 13px;
  }
  .mode-row {
    grid-template-columns: minmax(0, 1fr);
  }
  .kv-list {
    grid-template-columns: minmax(0, 1fr);
  }
}
