:root {
  --bg-app: #f9f9fb;
  --bg-card: #ffffff;
  --bg-header: #f9fafb;
  --border: #e2e8f0;
  --title-primary: #2a3782;
  --title-secondary: #4d525e;
  --text-body: #7e828c;
  --text-note: #a1a1a1;
  --btn-primary: #a1a3f7;
  --btn-primary-border: #878ad3;
  --btn-secondary-border: #aeb0d7;
  --btn-secondary-text: #bcbef9;
  --success-bg: #f2fff5;
  --success-border: #b7ebc6;
  --warning-bg: #fff8ed;
  --warning-border: #f2d39c;
  --shadow-card: 0 18px 48px rgba(93, 103, 137, 0.08);
  --radius-xl: 24px;
  --radius-lg: 20px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --sidebar-width: 88px;
  --main-width: 1260px;
  --space-1: 8px;
  --space-2: 12px;
  --space-3: 16px;
  --space-4: 20px;
  --space-5: 24px;
  --space-6: 32px;
  --control-compact-h: 40px;
  --control-h: 56px;
  --textarea-h: 148px;
  --upload-h: 188px;
  --primary-h: 48px;
  --secondary-h: 40px;
  --font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { background: var(--bg-app); color: var(--text-body); font-family: var(--font-family); }
button, input, textarea { font: inherit; }
button { border: 0; outline: none; }

.app-shell { display: grid; grid-template-columns: var(--sidebar-width) minmax(0, 1fr); min-height: 100vh; }

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  min-height: 100vh;
  flex-direction: column;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-5) 0;
  border-right: 1px solid #e6ebf5;
}

.brand-mark {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: 18px;
  border: 1px solid var(--btn-primary-border);
  background: linear-gradient(160deg, #adb0ff 0%, #7f82ef 100%);
  color: #fff;
  font-size: 22px;
  font-weight: 700;
  box-shadow: 0 16px 30px rgba(135, 138, 211, 0.24);
}

.sidebar-nav { display: flex; flex-direction: column; gap: var(--space-3); }

.nav-icon {
  display: grid;
  width: 72px;
  height: 72px;
  place-items: center;
  border-radius: 22px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--title-primary);
  box-shadow: 0 10px 24px rgba(149, 157, 185, 0.12);
  cursor: pointer;
  transition: 0.2s ease;
}

.nav-icon:hover,
.nav-icon.is-active {
  border-color: #8893ff;
  background: #fff;
  color: var(--title-primary);
  box-shadow: 0 14px 30px rgba(135, 138, 211, 0.22);
}

.nav-glyph { font-size: 18px; line-height: 1; }
.nav-icon__image {
  width: 42px;
  height: 42px;
  object-fit: contain;
  image-rendering: auto;
}
.nav-bottom { margin-top: auto; }

.app-main {
  width: min(var(--main-width), calc(100vw - 120px));
  margin: 0 auto;
  padding: var(--space-5) var(--space-5) var(--space-6);
}

.top-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  min-height: 76px;
  margin-bottom: var(--space-4);
  padding: var(--space-3) var(--space-4);
  border: 1px solid #dbe3ff;
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, #f5f7ff 0%, #f7f9ff 100%);
}

.top-banner__title { color: var(--title-primary); font-size: 16px; font-weight: 700; line-height: 1.6; }
.top-banner__desc { color: var(--text-body); font-size: 14px; line-height: 1.7; }
.top-banner__actions { display: flex; gap: var(--space-2); align-items: center; }

.workspace-nav {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: var(--space-4);
  overflow-x: auto;
}

.workspace-tab {
  display: inline-flex;
  height: 44px;
  align-items: center;
  gap: 8px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 14px;
  background: transparent;
  color: #7f8897;
  font-size: 16px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}

.workspace-tab.is-active {
  border-color: #bfd2ff;
  background: #fff;
  color: var(--title-primary);
  box-shadow: 0 10px 24px rgba(135, 138, 211, 0.08);
}

.workspace-tab__icon {
  width: 18px;
  height: 18px;
  object-fit: contain;
  image-rendering: auto;
  flex: 0 0 auto;
}

.workspace-tab__icon--placeholder,
.nav-icon__placeholder {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: #eef1ff;
  color: var(--title-primary);
  font-size: 16px;
  font-weight: 700;
}

.workspace-tab__icon--placeholder {
  width: 22px;
  height: 22px;
}

.nav-icon__placeholder {
  width: 42px;
  height: 42px;
}

.page { display: none; }
.page.is-active { display: block; }

.dashboard-grid,
.content-grid,
.membership-grid,
.dashboard-subgrid { display: grid; gap: var(--space-4); }

.dashboard-grid { grid-template-columns: minmax(0, 1.8fr) minmax(320px, 0.8fr); }
.dashboard-subgrid { margin-top: var(--space-4); grid-template-columns: repeat(2, minmax(0, 1fr)); }
.content-grid,
.membership-grid { grid-template-columns: minmax(0, 1.7fr) minmax(300px, 0.9fr); }

.card {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: var(--bg-card);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.card > * + * {
  margin-top: var(--space-4);
}

.card-hero {
  padding: 0;
}
.card-side { align-self: start; }
.card-body { display: flex; flex-direction: column; gap: var(--space-4); }

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  margin: 0;
  min-height: 50px;
  padding: 0 22px;
  margin: 2px 2px 0;
  background: var(--bg-header);
  border-radius: 22px 22px 0 0;
}

.card > .section-head + * {
  margin-top: 16px;
}

.card > :not(.section-head) {
  margin-left: 24px;
  margin-right: 24px;
}

.card > :first-child:not(.section-head) {
  margin-top: 24px;
}

.card > :last-child {
  margin-bottom: 24px;
}

.section-kicker { margin-bottom: var(--space-1); color: var(--btn-secondary-text); font-size: 14px; font-weight: 700; }
.page-title, .section-title { margin: 0; color: var(--title-primary); line-height: 1.4; }
.page-title, .section-title { font-size: 24px; font-weight: 700; }
.page-desc { margin: var(--space-2) 0 0; color: var(--text-body); font-size: 16px; line-height: 1.9; }

.section-title-wrap { display: flex; align-items: center; gap: var(--space-2); }
.section-bar { display: inline-block; width: 8px; height: 26px; border-radius: 999px; background: #818cf8; }
.card-title { margin: 0; color: var(--title-secondary); font-size: 20px; font-weight: 700; line-height: 1.5; }

.quick-entry-grid,
.choice-grid,
.tool-grid { display: grid; gap: var(--space-3); grid-template-columns: repeat(2, minmax(0, 1fr)); }
.section-stack { display: grid; gap: var(--space-4); }
.tool-selector-grid {
  display: grid;
  gap: var(--space-3);
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.tool-selector-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: #fff;
  text-align: left;
  cursor: pointer;
  transition: 0.2s ease;
}

.tool-selector-card:hover,
.tool-selector-card.is-active {
  border-color: #bfd2ff;
  background: #f8faff;
  box-shadow: 0 10px 24px rgba(135, 138, 211, 0.08);
}

.tool-selector-card__icon {
  display: inline-flex;
  width: 50px;
  height: 50px;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  border: 1px solid #dbe3ff;
  background: #eef1ff;
  color: var(--title-primary);
  font-size: 16px;
  font-weight: 700;
}

.tool-selector-card__icon-image {
  width: 38px;
  height: 38px;
  object-fit: contain;
  image-rendering: auto;
}

.tool-selector-card__title {
  color: var(--title-secondary);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.6;
}

.tool-selector-card__meta {
  color: var(--text-note);
  font-size: 13px;
  line-height: 1.6;
}

.tool-detail-wrap {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.subtab-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.subtab-btn {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  border: 1px solid var(--btn-secondary-border);
  border-radius: 14px;
  background: #fff;
  color: var(--text-body);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.subtab-btn.is-active {
  border-color: #bfd2ff;
  background: #eef1ff;
  color: var(--title-primary);
}

.subtab-panel { display: none; }
.subtab-panel.is-active { display: block; }
.subtab-panel.is-active > * + * { margin-top: 16px; }

[data-page="tools"] [data-tab-group="tools-main"],
[data-page="tools"] [data-tab-group="audio-tools-sub"],
[data-page="tools"] [data-tab-group="realtime-synthesis-sub"],
[data-page="tools"] [data-tab-group="resource-sub"] {
  display: none;
}

.panel-card,
.mini-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: #fff;
}

.panel-card__head {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.panel-card__title {
  margin: 0;
  color: var(--title-secondary);
  font-size: 18px;
  font-weight: 700;
  line-height: 1.6;
}

.panel-card__desc {
  margin: 0;
  color: var(--text-body);
  font-size: 14px;
  line-height: 1.8;
}

.preset-strip {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: #fbfcff;
}

.preset-strip__label {
  color: var(--title-secondary);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.6;
}

.preset-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.preset-chip {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  border: 1px solid var(--btn-secondary-border);
  border-radius: 999px;
  background: #fff;
  color: var(--text-body);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: 0.2s ease;
}

.preset-chip:hover {
  border-color: #ccd6ff;
  color: var(--title-primary);
}

.preset-chip.is-active {
  border-color: var(--btn-primary-border);
  background: #eef1ff;
  color: var(--title-primary);
}

.field-grid-3 .field-block,
.field-grid-4 .field-block {
  min-width: 0;
}

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

.mini-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.mini-grid--wide,
.effects-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.mini-card h4 {
  margin: 0;
  color: var(--title-secondary);
  font-size: 16px;
  font-weight: 700;
}

.fold-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: #fff;
}

.fold-card[open] {
  box-shadow: 0 10px 24px rgba(135, 138, 211, 0.08);
}

.fold-card__summary {
  display: flex;
  min-height: 44px;
  align-items: center;
  padding: 0 16px;
  color: var(--title-secondary);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}

.fold-card__summary::-webkit-details-marker { display: none; }
.fold-card__body { padding: 0 16px 16px; }
.terms-row { display: flex; align-items: center; }
.upload-panel--compact { min-height: 132px; }
.pricing-hero { display: flex; flex-direction: column; gap: 8px; }

.entry-card,
.choice-chip,
.tool-card {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: #fff;
}

.entry-card { padding: 18px; text-align: left; cursor: pointer; transition: 0.2s ease; }
.entry-card:hover, .choice-chip:hover, .tool-card:hover { transform: translateY(-1px); border-color: #ccd6ff; }
.entry-card__title, .timeline-title, .help-card__title, .tool-card__title { color: var(--title-secondary); font-size: 18px; font-weight: 700; line-height: 1.6; }
.entry-card__desc, .timeline-desc, .tool-card__desc, .help-card__desc, .result-placeholder { color: var(--text-body); font-size: 14px; line-height: 1.8; }

.price-line, .pricing-amount { color: var(--title-primary); font-size: 30px; font-weight: 700; line-height: 1.4; }
.bullet-list { margin: 0; padding-left: 20px; }
.bullet-list li { margin-bottom: 8px; color: var(--text-body); font-size: 16px; line-height: 1.8; }

.timeline-list, .benefit-list, .help-list, .env-list { display: grid; gap: var(--space-3); }
.timeline-item { display: flex; align-items: flex-start; gap: var(--space-3); }
.timeline-index {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 999px;
  background: #eef1ff;
  color: var(--title-primary);
  font-size: 14px;
  font-weight: 700;
}

.notice-block {
  min-height: 48px;
  padding: 14px 16px;
  border: 1px solid var(--warning-border);
  border-radius: var(--radius-sm);
  background: var(--warning-bg);
  color: #9a5c00;
  font-size: 14px;
  line-height: 1.8;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 140px;
  padding: 0 22px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: 0.2s ease;
}

.btn-icon {
  object-fit: contain;
  image-rendering: auto;
  flex: 0 0 auto;
}

.btn-icon--auth {
  width: 32px;
  height: 32px;
  margin-left: -6px;
}

.btn-icon--action {
  width: 26px;
  height: 26px;
}

.btn:hover { transform: translateY(-1px); }

.btn-primary {
  min-height: var(--primary-h);
  border: 1px solid var(--btn-primary-border);
  background: #fff;
  color: var(--btn-secondary-text);
  font-size: 20px;
  font-weight: 700;
}

.btn-secondary {
  min-height: var(--primary-h);
  border: 1px solid var(--btn-secondary-border);
  background: #fff;
  color: var(--btn-secondary-text);
  font-size: 20px;
  font-weight: 700;
}

.btn.small { min-height: var(--control-compact-h); padding: 0 14px; font-size: 14px; }
.full-width { width: auto; min-width: 0; align-self: stretch; }

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

.icon-btn {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid #dfe5ff;
  border-radius: 999px;
  background: #fff;
  color: var(--btn-secondary-text);
  cursor: pointer;
}

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-3); }
.field-span-2 { grid-column: span 2; }
.field-block { display: flex; flex-direction: column; gap: 10px; }
.field-label { color: var(--title-secondary); font-size: 16px; font-weight: 700; line-height: 1.75; }
.field-note { color: var(--text-note); font-size: 14px; line-height: 1.7; }

.upload-panel,
.control-input,
.control-select,
.control-textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: #fff;
}

.upload-panel {
  display: grid;
  min-height: var(--upload-h);
  place-items: center;
  padding: var(--space-5);
  border-style: dashed;
  background: #fcfcff;
  text-align: center;
}

.upload-panel__icon-image {
  width: 34px;
  height: 34px;
  margin-bottom: 8px;
  object-fit: contain;
  image-rendering: auto;
}
.upload-panel__title { color: var(--title-secondary); font-size: 16px; font-weight: 700; line-height: 1.75; }
.upload-panel__note { color: var(--text-note); font-size: 14px; line-height: 1.7; }

.control-input,
.control-select { min-height: var(--control-compact-h); padding: 0 16px; }
.control-input { color: var(--text-body); }
.control-select { display: flex; align-items: center; justify-content: space-between; color: var(--text-body); cursor: pointer; }
.control-textarea { min-height: var(--textarea-h); padding: 16px; resize: none; color: var(--text-body); }

.select-menu {
  position: relative;
}

.select-trigger {
  position: relative;
  z-index: 2;
}

.select-menu.is-open .select-trigger {
  border-color: #8893ff;
  box-shadow: 0 0 0 2px rgba(136, 147, 255, 0.08);
}

.select-trigger__content {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.select-trigger__label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.select-trigger__icon,
.select-option__icon {
  width: 16px;
  height: 16px;
  background-color: #c8cedb;
  -webkit-mask: url("./assets/icons/common/check.png") center/contain no-repeat;
  mask: url("./assets/icons/common/check.png") center/contain no-repeat;
  flex: 0 0 auto;
}

.select-trigger__chevron {
  width: 14px;
  height: 14px;
  background: url("./assets/icons/common/angle-small-down.png") center/contain no-repeat;
  color: transparent;
  font-size: 0;
  line-height: 0;
  flex: 0 0 auto;
  transition: transform 0.2s ease;
}

.select-menu.is-open .select-trigger__chevron {
  transform: rotate(180deg);
}

.select-menu__panel {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  z-index: 10;
  max-height: 252px;
  overflow-y: auto;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 18px 38px rgba(77, 82, 94, 0.12);
}

.select-option {
  display: flex;
  width: 100%;
  min-height: 40px;
  align-items: center;
  gap: 10px;
  padding: 0 10px;
  border-radius: 10px;
  background: transparent;
  color: var(--title-secondary);
  font-size: 16px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}

.select-option:hover,
.select-option.is-selected {
  background: #dfe5ff;
  color: var(--title-primary);
}

.select-option.is-selected .select-option__icon {
  background-color: #22c55e;
}

.select-menu .select-trigger__icon {
  background-color: #22c55e;
}

.path-picker { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: center; }
.hidden-file-input { display: none; }

.toggle-row { display: flex; flex-wrap: wrap; align-items: center; gap: 20px; margin-top: var(--space-4); }
.toggle-item { display: inline-flex; min-height: 48px; align-items: center; gap: 10px; color: var(--text-body); font-size: 16px; }
.toggle-item em { padding: 3px 10px; border-radius: 999px; background: #fff6ec; color: #b7791f; font-size: 12px; font-style: normal; }

.action-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.action-row > .btn,
.action-row > a.btn {
  min-height: 40px;
  padding-top: 0;
  padding-bottom: 0;
  font-size: 16px;
}
.action-row > .btn.small,
.action-row > a.btn.small {
  min-height: 40px;
  font-size: 16px;
}
.action-row .btn-icon--action {
  width: 24px;
  height: 24px;
}

.slider-mock { display: flex; align-items: center; gap: 12px; }
.slider-track,
.progress-bar {
  position: relative;
  overflow: hidden;
  border-radius: 999px;
  background: #e9ecfb;
}

.slider-track {
  flex: 1;
  height: 8px;
}

.slider-track span,
.progress-bar span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #9ea3ff 0%, #8c92f4 100%);
}

.slider-value {
  min-width: 46px;
  color: var(--title-secondary);
  font-size: 14px;
  font-weight: 600;
  text-align: right;
}

.range-control {
  display: flex;
  align-items: center;
  gap: 12px;
}

.range-input {
  flex: 1;
  height: 8px;
  margin: 0;
  appearance: none;
  border-radius: 999px;
  background: linear-gradient(90deg, #9ea3ff 0%, #8c92f4 var(--range-percent), #e9ecfb var(--range-percent), #e9ecfb 100%);
  outline: none;
}

.range-input::-webkit-slider-runnable-track {
  height: 8px;
  border-radius: 999px;
  background: transparent;
}

.range-input::-webkit-slider-thumb {
  appearance: none;
  width: 18px;
  height: 18px;
  margin-top: -5px;
  border: 2px solid #8c92f4;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 6px 18px rgba(135, 138, 211, 0.22);
  cursor: pointer;
}

.range-input::-moz-range-track {
  height: 8px;
  border-radius: 999px;
  background: transparent;
}

.range-input::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border: 2px solid #8c92f4;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 6px 18px rgba(135, 138, 211, 0.22);
  cursor: pointer;
}

.result-card,
.progress-box {
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-header);
}

.result-title, .progress-box__label { margin-bottom: 12px; color: var(--title-secondary); font-size: 16px; font-weight: 700; }
.progress-bar { height: 8px; margin-bottom: 10px; }

.tool-card { display: flex; flex-direction: column; gap: 10px; padding: 18px; cursor: pointer; }
.tool-card__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.tool-card__footer { margin-top: 12px; color: var(--text-note); font-size: 14px; }

.tag-member, .tag-free, .pricing-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 14px;
}

.tag-member { background: #fff6ec; color: #b7791f; }
.tag-free { background: #eef9f1; color: #2f855a; }
.pricing-badge { background: #eef1ff; color: var(--title-primary); font-weight: 700; }
.pricing-note { margin-top: 6px; color: var(--text-body); font-size: 14px; }
.benefit-item { padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--bg-header); color: var(--text-body); font-size: 16px; line-height: 1.7; }

.pay-channel-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.pay-card {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 56px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: #fff;
  color: var(--title-secondary);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
}

.pay-card.is-active { border-color: var(--btn-primary-border); background: #eef1ff; color: var(--title-primary); }

.pay-card__icon {
  width: 18px;
  height: 18px;
  object-fit: contain;
  image-rendering: auto;
  flex: 0 0 auto;
}

.tab-strip { display: flex; gap: 10px; margin-bottom: var(--space-4); }
.tab-strip__btn {
  min-height: var(--secondary-h);
  padding: 0 16px;
  border: 1px solid var(--btn-secondary-border);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--btn-secondary-text);
  cursor: pointer;
}

.tab-strip__btn.is-active { border-color: var(--btn-primary-border); background: var(--btn-primary); color: #fff; }
.tab-panel { display: none; }
.tab-panel.is-active { display: block; }
.tab-panel.is-active > * + * { margin-top: var(--space-4); }

.account-summary { display: flex; align-items: center; gap: var(--space-3); margin-bottom: var(--space-4); }
.account-avatar {
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  border-radius: 18px;
  background: #eef1ff;
  color: var(--title-primary);
  font-size: 22px;
  font-weight: 700;
}

.account-name { color: var(--title-secondary); font-size: 18px; font-weight: 700; }
.account-state { color: var(--text-body); font-size: 14px; }
.account-info-list { display: grid; gap: 12px; }
.account-info-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-header);
  color: var(--text-body);
  font-size: 16px;
}

.account-info-item strong { color: var(--title-secondary); }

.help-toolbar { display: grid; grid-template-columns: minmax(0, 1fr) 180px; gap: var(--space-3); margin-bottom: var(--space-4); }
.help-card { display: flex; flex-direction: column; gap: 10px; padding: 18px; border: 1px solid var(--border); border-radius: var(--radius-md); background: #fff; }
.help-card.is-hidden { display: none; }

.auth-entry { display: flex; align-items: center; justify-content: flex-end; min-width: 280px; }
.auth-entry__buttons { display: flex; gap: 12px; align-items: center; }
.btn-auth { min-width: 140px; }
.text-link {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--btn-primary-border);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
}

.user-menu { position: relative; min-width: 248px; }
.user-menu__trigger {
  display: flex;
  width: 100%;
  min-height: 56px;
  align-items: center;
  gap: 12px;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: #fff;
  box-shadow: 0 10px 24px rgba(149, 157, 185, 0.12);
  cursor: pointer;
}
.user-menu__avatar {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 14px;
  background: #eef1ff;
  color: var(--title-primary);
  font-weight: 700;
}
.user-menu__content { display: flex; flex-direction: column; flex: 1; align-items: flex-start; }
.user-menu__content strong { color: var(--title-secondary); font-size: 16px; }
.user-menu__content span { color: var(--text-body); font-size: 13px; }
.user-menu__chevron { color: var(--text-note); font-size: 14px; }
.user-menu__panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 30;
  display: grid;
  gap: 8px;
  width: 280px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: #fff;
  box-shadow: 0 24px 48px rgba(54, 63, 94, 0.16);
}
.user-menu__summary { padding: 8px 4px 10px; border-bottom: 1px solid var(--border); }
.user-menu__summary-title { color: var(--title-secondary); font-size: 16px; font-weight: 700; }
.user-menu__summary-meta { margin-top: 4px; color: var(--text-body); font-size: 14px; line-height: 1.7; }
.dropdown-item {
  display: flex;
  min-height: 40px;
  align-items: center;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  color: var(--title-secondary);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.dropdown-item:hover { border-color: #bfd2ff; background: #f8faff; }
.dropdown-item.danger { color: #c74d4d; }

.auth-modal {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: min(560px, 100%);
  padding: 28px 32px;
  border: 1px solid var(--border);
  border-radius: 32px;
  background: #fff;
  box-shadow: 0 26px 64px rgba(54, 63, 94, 0.2);
}
.auth-modal__close {
  position: absolute;
  top: 18px;
  right: 18px;
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 999px;
  background: #fff;
  color: var(--title-secondary);
  font-size: 26px;
  cursor: pointer;
}
.auth-modal__logo {
  display: grid;
  width: 72px;
  height: 72px;
  margin: 0 auto;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: linear-gradient(160deg, #adb0ff 0%, #7f82ef 100%);
  color: #fff;
  font-size: 28px;
  font-weight: 700;
}
.auth-modal__title {
  color: var(--title-secondary);
  text-align: center;
  font-size: 24px;
  font-weight: 700;
  line-height: 1.5;
}
.auth-modal__panel { display: none; gap: 16px; }
.auth-modal__panel.is-active { display: grid; }
.auth-modal__footer {
  color: var(--text-body);
  text-align: center;
  font-size: 15px;
  line-height: 1.8;
}
.auth-modal__result { margin-top: 4px; }

.stats-grid { display: grid; gap: 16px; grid-template-columns: repeat(5, minmax(0, 1fr)); }
.membership-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stat-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-header);
}
.stat-card__label { color: var(--text-note); font-size: 14px; }
.stat-card__value { color: var(--title-primary); font-size: 24px; font-weight: 700; }

.record-list { display: grid; gap: 12px; }
.record-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-header);
}
.record-item strong { color: var(--title-secondary); font-size: 16px; }
.record-item span, .record-item small { color: var(--text-body); font-size: 14px; line-height: 1.7; }
.record-empty {
  padding: 18px;
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
  background: #fff;
  color: var(--text-note);
  font-size: 14px;
  text-align: center;
}
.compact-list .record-item { padding: 12px 14px; }
.admin-list-item { text-align: left; cursor: pointer; }
.admin-list-item.is-active { border-color: #bfd2ff; background: #f8faff; }
.action-row--wrap { flex-wrap: wrap; }
.is-locked { opacity: 0.65; }

.admin-body { background: var(--bg-app); }
.admin-shell {
  width: min(1360px, calc(100vw - 48px));
  margin: 0 auto;
  padding: 24px 0 36px;
}
.admin-banner { margin-bottom: 24px; }
.admin-grid { margin-top: 20px; }
.admin-panel { display: grid; gap: 20px; }
.admin-login { width: min(760px, 100%); margin: 40px auto 0; }

.modal-backdrop {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.24);
}

.modal-backdrop.is-open { display: flex; }

.modal-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  width: min(860px, 100%);
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: #fff;
  box-shadow: 0 24px 64px rgba(54, 63, 94, 0.18);
}

.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-4); }

.env-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-header);
}

.env-item.is-ok { border-color: var(--success-border); background: var(--success-bg); }
.env-item.is-fail { border-color: var(--warning-border); background: var(--warning-bg); }
.env-item__title { color: var(--title-secondary); font-size: 16px; font-weight: 700; line-height: 1.75; }
.env-item__desc { color: var(--text-body); font-size: 14px; line-height: 1.7; }
.env-item__actions { display: flex; align-items: center; gap: 10px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 12px; }

@media (max-width: 1180px) {
  .dashboard-grid,
  .content-grid,
  .membership-grid,
  .dashboard-subgrid { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar {
    position: static;
    min-height: auto;
    flex-direction: row;
    justify-content: center;
    gap: 12px;
    padding: 16px;
  }
  .sidebar-nav { flex-direction: row; flex-wrap: wrap; justify-content: center; }
  .nav-bottom { margin-top: 0; }
  .app-main { width: min(100%, 100vw); padding: 0 16px 24px; }
  .section-head { min-height: 50px; padding: 0 18px; }
  .card > :not(.section-head) { margin-left: 20px; margin-right: 20px; }
  .card > :first-child:not(.section-head) { margin-top: 20px; }
  .card > :last-child { margin-bottom: 20px; }
  .top-banner { flex-direction: column; align-items: stretch; }
  .top-banner__actions,
  .action-row,
  .env-item__actions { width: 100%; flex-wrap: wrap; }
  .form-grid,
  .field-grid-3,
  .field-grid-4,
  .tool-selector-grid,
  .quick-entry-grid,
  .choice-grid,
  .tool-grid,
  .stats-grid,
  .membership-stats,
  .pay-channel-row,
  .help-toolbar,
  .mini-grid,
  .mini-grid--wide,
  .effects-grid { grid-template-columns: 1fr; }
  .field-span-2 { grid-column: span 1; }
  .path-picker { grid-template-columns: 1fr; }
  .env-item { flex-direction: column; align-items: stretch; }
  .subtab-strip { flex-direction: column; }
}
