:root {
  --bg-page: #070809;
  --bg-shell: #0c0d10;
  --bg-shell-soft: #101218;
  --bg-card: #141721;
  --bg-card-soft: #181b24;

  --border-subtle: rgba(255, 255, 255, 0.06);
  --border-strong: rgba(255, 255, 255, 0.16);

  --color-primary: #f3b673; /* 温暖琥珀 */
  --color-primary-soft: rgba(243, 182, 115, 0.16);
  --color-primary-strong: #f5a642;
  --color-accent: #7fb8ff;

  --text-main: #f5f5f5;
  --text-muted: #a1a5b2;
  --text-soft: #7a7f8b;

  --shadow-soft: 0 26px 70px rgba(0, 0, 0, 0.9);
  --shadow-card: 0 20px 45px rgba(0, 0, 0, 0.85);

  --radius-xl: 24px;
  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-pill: 999px;

  --transition-fast: 0.16s ease-out;
  --transition-normal: 0.22s ease-out;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  font-family:
    "PingFang SC",
    "Hiragino Sans GB",
    "Microsoft YaHei",
    "Source Han Sans SC",
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  color: var(--text-main);
  background:
    radial-gradient(circle at top left, rgba(243, 182, 115, 0.16), transparent 55%),
    radial-gradient(circle at 80% 0%, rgba(127, 184, 255, 0.12), transparent 60%),
    linear-gradient(160deg, #050608, #060709 35%, #050608 100%);
  display: flex;
  justify-content: center;
  align-items: stretch;
  -webkit-font-smoothing: antialiased;
}

body::before {
  /* 轻微噪点纹理 */
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: radial-gradient(circle at 1px 1px, rgba(255, 255, 255, 0.09) 1px, transparent 0);
  background-size: 26px 26px;
  opacity: 0.28;
  mix-blend-mode: soft-light;
}

#app-root {
  width: 100%;
  min-height: 100vh;
  max-width: 1160px;
  padding: 26px 20px 40px;
  margin: 0 auto;
}

/* 顶部应用壳与导航 */
.app-shell {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.app-nav {
  position: relative;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  border-radius: 999px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.04), transparent 55%),
    radial-gradient(circle at 0 0, rgba(243, 182, 115, 0.22), transparent 60%),
    linear-gradient(125deg, rgba(17, 18, 24, 0.96), rgba(10, 11, 16, 0.96));
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.96);
  backdrop-filter: blur(18px);
}

.app-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.app-logo-mark {
  width: 30px;
  height: 30px;
  border-radius: 12px;
  background:
    conic-gradient(from 160deg, rgba(243, 182, 115, 1), #f97316, #7fb8ff, rgba(243, 182, 115, 1));
  position: relative;
  box-shadow:
    0 0 0 1px rgba(24, 24, 27, 1),
    0 0 40px rgba(243, 182, 115, 0.85);
}

.app-logo-mark::after {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: inherit;
  background:
    radial-gradient(circle at 24% 20%, rgba(255, 255, 255, 0.58), transparent 45%),
    radial-gradient(circle at 80% 85%, rgba(17, 17, 23, 0.96), rgba(10, 10, 15, 1));
}

.app-logo-text-main {
  font-family: "Noto Serif SC", "Noto Sans SC", system-ui, sans-serif;
  font-size: 18px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.app-logo-text-sub {
  font-size: 11px;
  color: var(--text-soft);
}

.app-nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
}

.app-nav-link {
  padding: 7px 13px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  color: var(--text-soft);
  cursor: pointer;
  border: 1px solid transparent;
  background: transparent;
  transition:
    background var(--transition-fast),
    color var(--transition-fast),
    border-color var(--transition-fast),
    transform var(--transition-fast),
    box-shadow var(--transition-fast);
}

.app-nav-link:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.16);
  color: var(--text-main);
  transform: translateY(-1px);
}

.app-nav-link--primary {
  background:
    radial-gradient(circle at 0 0, rgba(243, 182, 115, 0.7), transparent 60%),
    linear-gradient(135deg, #f5b561, #f59e3b);
  color: #151519;
  font-weight: 600;
  border-color: rgba(255, 255, 255, 0.24);
  box-shadow:
    0 12px 32px rgba(245, 158, 11, 0.85),
    0 0 0 1px rgba(0, 0, 0, 0.94);
}

.app-nav-link--primary:hover {
  transform: translateY(-1px) scale(1.02);
  box-shadow:
    0 16px 42px rgba(245, 158, 11, 0.95),
    0 0 0 1px rgba(0, 0, 0, 0.96);
}

.app-nav-user {
  display: flex;
  align-items: center;
  gap: 10px;
}

.app-nav-account {
  position: relative;
}

.app-nav-dropdown {
  display: none;
  position: absolute;
  right: 0;
  top: 100%;
  margin-top: 6px;
  min-width: 140px;
  padding: 6px 0;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.9);
  z-index: 9999;
}

.app-nav-dropdown--open {
  display: block;
}

.app-nav-dropdown-item {
  display: block;
  width: 100%;
  padding: 8px 14px;
  border: none;
  background: transparent;
  color: var(--text-main);
  font-size: 13px;
  text-align: left;
  cursor: pointer;
  transition: background var(--transition-fast);
}

.app-nav-dropdown-item:hover {
  background: rgba(255, 255, 255, 0.06);
}

.app-nav-dropdown-item--danger {
  color: #f97373;
}

.badge-pill {
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: var(--text-soft);
  background: rgba(14, 14, 20, 0.9);
}

.badge-pill--member {
  border-color: rgba(243, 182, 115, 0.8);
  color: #fbd38d;
  background:
    radial-gradient(circle at 12% 0, rgba(243, 182, 115, 0.55), transparent 60%),
    rgba(16, 13, 8, 0.96);
}

/* 内容区域与页面结构 */
.app-content {
  margin-top: 4px;
  border-radius: var(--radius-xl);
  background:
    radial-gradient(circle at 0 0, rgba(243, 182, 115, 0.2), transparent 55%),
    radial-gradient(circle at 100% 0, rgba(127, 184, 255, 0.16), transparent 55%),
    linear-gradient(155deg, var(--bg-shell), var(--bg-shell-soft));
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: var(--shadow-soft);
  padding: 20px 20px 26px;
  min-height: calc(100vh - 110px);
  position: relative;
  overflow: hidden;
}

.app-content::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(120deg, rgba(255, 255, 255, 0.04), transparent 50%),
    linear-gradient(0deg, transparent 0, rgba(0, 0, 0, 0.42) 24%, transparent 55%);
  mix-blend-mode: soft-light;
  opacity: 0.7;
}

.app-page {
  position: relative;
  z-index: 1;
}

/* 通用布局与组件 */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  margin-bottom: 20px;
}

.breadcrumb-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.breadcrumb-sep {
  color: var(--text-soft);
  font-size: 14px;
}

.breadcrumb-current {
  margin: 0;
  font-size: 22px;
}

.page-title-group h1,
.page-title-group .breadcrumb-current {
  margin: 0;
  font-family:
    "Songti SC",
    "STSong",
    "PingFang SC",
    "Hiragino Sans GB",
    system-ui,
    sans-serif;
  font-size: 24px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.page-title-group p {
  margin: 8px 0 0;
  font-size: 13px;
  color: var(--text-muted);
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.chip {
  border-radius: var(--radius-pill);
  border: 1px solid rgba(255, 255, 255, 0.16);
  padding: 3px 10px;
  font-size: 11px;
  color: var(--text-soft);
  background: rgba(11, 12, 18, 0.95);
}

.input,
.select {
  width: 100%;
  padding: 8px 11px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(5, 6, 10, 0.96);
  color: var(--text-main);
  font-size: 13px;
  outline: none;
  transition:
    border-color var(--transition-fast),
    box-shadow var(--transition-fast),
    background var(--transition-fast),
    transform var(--transition-fast);
}

.input::placeholder {
  color: var(--text-soft);
}

.input:focus,
.select:focus {
  border-color: rgba(243, 182, 115, 0.9);
  box-shadow: 0 0 0 1px rgba(243, 182, 115, 0.7);
  background: #050609;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 7px 14px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(10, 11, 18, 0.98);
  color: var(--text-main);
  font-size: 13px;
  cursor: pointer;
  transition:
    background var(--transition-fast),
    border-color var(--transition-fast),
    transform var(--transition-fast),
    box-shadow var(--transition-fast),
    color var(--transition-fast);
}

.btn:hover {
  background: rgba(14, 16, 24, 1);
  transform: translateY(-1px);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.8);
}

.btn-primary {
  border-color: rgba(243, 182, 115, 0.9);
  background:
    radial-gradient(circle at 0 -10%, rgba(255, 255, 255, 0.4), transparent 55%),
    linear-gradient(135deg, #f7b867, #f59e3b);
  color: #17130e;
  font-weight: 600;
  box-shadow:
    0 12px 34px rgba(245, 158, 11, 0.9),
    0 0 0 1px rgba(0, 0, 0, 0.96);
}

.btn-primary:hover {
  transform: translateY(-1px) scale(1.01);
  box-shadow:
    0 16px 44px rgba(245, 158, 11, 0.98),
    0 0 0 1px rgba(0, 0, 0, 0.98);
}

.btn-subtle {
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(9, 10, 16, 0.96);
  color: var(--text-soft);
}

.btn-ghost {
  border-color: transparent;
  background: transparent;
  color: var(--text-soft);
}

.btn-sm {
  padding: 4px 10px;
  font-size: 11px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(255, 255, 255, 0.18);
  font-size: 10px;
  color: var(--text-soft);
  background: rgba(8, 9, 15, 0.96);
}

.badge-free {
  border-color: rgba(74, 222, 128, 0.8);
  color: #bbf7d0;
}

.badge-member {
  border-color: rgba(243, 182, 115, 0.85);
  color: #fef3c7;
}

.grid {
  display: grid;
  gap: 12px;
}

.grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

/* 工具广场：分类在上、工具在下 */
.tools-filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 24px;
  padding: 14px 16px;
  margin-bottom: 20px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.03), transparent 55%);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.tools-filter-section {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.tools-filter-label {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
}

.tools-list-section {
  margin-top: 0;
}

.tools-list-header {
  margin-bottom: 12px;
}

.tools-list-header .page-section-title {
  margin-bottom: 0;
}

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

.tool-card {
  display: flex;
  flex-direction: column;
  text-align: left;
  min-height: 0;
}

.tool-card .card-header {
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  margin-bottom: 8px;
}

.tool-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.tool-card .card-title {
  font-size: 14px;
  font-weight: 600;
  flex: 1;
  min-width: 0;
}

.tool-card .card-subtitle {
  font-size: 12px;
  line-height: 1.4;
  color: var(--text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.tool-card .card-tag-row {
  margin-top: 8px;
}

.tool-card .card-footer {
  margin-top: auto;
  padding-top: 10px;
}

.apikey-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.apikey-item {
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.12);
}

.apikey-item:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.apikey-item-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}

.card {
  position: relative;
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at 0 0, rgba(243, 182, 115, 0.14), transparent 60%),
    linear-gradient(150deg, var(--bg-card), var(--bg-card-soft));
  border: 1px solid rgba(255, 255, 255, 0.11);
  padding: 13px 13px 14px;
  box-shadow: var(--shadow-card);
  overflow: hidden;
  transition:
    transform var(--transition-fast),
    box-shadow var(--transition-fast),
    border-color var(--transition-fast),
    background var(--transition-fast);
}

.card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 0 0, rgba(255, 255, 255, 0.22), transparent 55%);
  opacity: 0;
  mix-blend-mode: soft-light;
  transition: opacity var(--transition-fast);
  pointer-events: none;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.96);
  border-color: rgba(243, 182, 115, 0.7);
  background:
    radial-gradient(circle at 0 0, rgba(243, 182, 115, 0.22), transparent 60%),
    linear-gradient(155deg, #181921, #141721);
}

.card:hover::before {
  opacity: 0.4;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.card-title {
  font-size: 13px;
  font-weight: 550;
}

.card-subtitle {
  font-size: 11px;
  color: var(--text-soft);
}

.card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 9px;
  font-size: 11px;
  color: var(--text-soft);
}

.card-tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}

.card-tag {
  border-radius: var(--radius-pill);
  padding: 2px 7px;
  font-size: 10px;
  background: rgba(12, 13, 20, 0.98);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: var(--text-soft);
}

.muted {
  color: var(--text-muted);
  font-size: 12px;
}

.danger {
  color: #f97373;
}

.text-xs {
  font-size: 11px;
}

.text-sm {
  font-size: 13px;
}

.text-right {
  text-align: right;
}

.mt-8 {
  margin-top: 8px;
}

.mt-12 {
  margin-top: 12px;
}

.mt-16 {
  margin-top: 16px;
}

.flex {
  display: flex;
}

.flex-col {
  flex-direction: column;
}

.flex-row {
  flex-direction: row;
}

.items-center {
  align-items: center;
}

.justify-between {
  justify-content: space-between;
}

.gap-8 {
  gap: 8px;
}

.gap-12 {
  gap: 12px;
}

.gap-16 {
  gap: 16px;
}

.w-full {
  width: 100%;
}

.link {
  color: var(--color-accent);
  cursor: pointer;
  text-decoration: none;
  font-size: 12px;
}

.link:hover {
  text-decoration: underline;
}

/* 开关与提示 */
.pill-toggle {
  position: relative;
  width: 44px;
  height: 22px;
  border-radius: 999px;
  background: rgba(12, 13, 20, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.16);
  cursor: pointer;
  transition:
    background var(--transition-fast),
    border-color var(--transition-fast);
}

.pill-toggle-knob {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 17px;
  height: 17px;
  border-radius: 999px;
  background: rgba(248, 250, 252, 0.96);
  transition:
    transform var(--transition-fast),
    background var(--transition-fast),
    box-shadow var(--transition-fast);
}

.pill-toggle--on {
  background:
    radial-gradient(circle at 0 0, rgba(243, 182, 115, 0.6), transparent 65%),
    rgba(22, 22, 12, 0.96);
  border-color: rgba(243, 182, 115, 0.9);
}

.pill-toggle--on .pill-toggle-knob {
  transform: translateX(20px);
  background: #fbbf77;
  box-shadow: 0 0 18px rgba(243, 182, 115, 0.95);
}

.pill-toggle-label {
  font-size: 12px;
  color: var(--text-soft);
}

.alert {
  border-radius: var(--radius-pill);
  padding: 7px 12px;
  border: 1px solid rgba(243, 182, 115, 0.9);
  background:
    radial-gradient(circle at 0 0, rgba(243, 182, 115, 0.32), transparent 60%),
    rgba(12, 12, 16, 0.96);
  font-size: 12px;
  color: #fef9c3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.alert-error {
  border-color: rgba(248, 113, 113, 0.98);
  color: #fee2e2;
  background:
    radial-gradient(circle at 0 0, rgba(248, 113, 113, 0.32), transparent 60%),
    rgba(12, 10, 10, 0.96);
}

.badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--color-primary);
}

.badge-dot--hot {
  background: #fb923c;
}

.text-mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

.code-block {
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(5, 6, 10, 0.98);
  padding: 8px 10px;
  font-size: 12px;
  overflow-x: auto;
}

.page-section-title {
  font-size: 13px;
  font-weight: 560;
  margin-bottom: 6px;
}

.page-section {
  margin-top: 10px;
}

.two-column {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 0.9fr);
  gap: 14px;
}

.divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.28), transparent);
  margin: 12px 0;
}

.text-badge {
  font-size: 10px;
  padding: 2px 7px;
  border-radius: var(--radius-pill);
  background: rgba(15, 16, 22, 0.98);
  border: 1px solid rgba(243, 182, 115, 0.8);
}

.agreement-text {
  line-height: 1.6;
}

.agreement-text p {
  margin-bottom: 6px;
}

/* 应用内弹窗 */
.app-modal {
  display: none;
  position: fixed;
  inset: 0;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.app-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  cursor: default;
}

.app-modal-dialog {
  position: relative;
  width: 100%;
  max-width: 380px;
  padding: 18px 20px;
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.95);
}

.app-modal-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 12px;
}

.app-modal-body {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 18px;
}

.app-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* 响应式 */
@media (max-width: 900px) {
  #app-root {
    padding-inline: 14px;
  }

  .app-content {
    padding: 16px 14px 22px;
    min-height: calc(100vh - 96px);
  }

  .page-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .grid-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tools-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .two-column {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 640px) {
  #app-root {
    padding-inline: 12px;
  }

  .app-nav {
    padding-inline: 12px;
  }

  .app-nav-links {
    display: none;
  }

  .grid-2,
  .grid-3 {
    grid-template-columns: minmax(0, 1fr);
  }

  .tools-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .tools-filter-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .tools-filter-section {
    flex-direction: column;
    align-items: flex-start;
  }
}

