@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
  --bg-color: #f4f5f7;
  --sidebar-bg: #ffffff;
  --card-bg: #ffffff;
  --primary: #00d26a;
  /* 爱奇艺主色调绿 */
  --primary-hover: #00c060;
  --text-main: #222222;
  --text-muted: #888888;
  --border-color: #ebecf0;
  --shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
  --border-radius: 8px;
  --danger: #ff4d4f;
  --warning: #faad14;
  --success: #00d26a;
  --bg-input: #f8f9fa;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  background-color: var(--bg-color);
  color: var(--text-main);
  line-height: 1.5;
  font-size: 14px;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: #dcdcdc;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #c0c0c0;
}

h1,
h2,
h3,
h4 {
  color: var(--text-main);
  font-weight: 600;
}

a {
  color: var(--primary);
  text-decoration: none;
}

/* ============ Layout ============ */
.app-layout {
  display: flex;
  height: 100vh;
  overflow: hidden;
  background: var(--bg-color);
}

.sidebar {
  width: 216px;
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease;
  z-index: 100;
  border-right: 1px solid var(--border-color);
}

.sidebar-header {
  height: 58px;
  display: flex;
  align-items: center;
  padding: 0 18px;
  border-bottom: 1px solid var(--border-color);
}

.logo {
  font-size: 22px;
  margin-right: 8px;
}

.brand {
  font-size: 17px;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: 0;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 12px 10px;
}

.nav-group {
  margin-bottom: 14px;
}

.nav-group-title {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 6px;
  padding: 0 10px;
}

.nav-item {
  display: flex;
  align-items: center;
  padding: 8px 10px;
  border-radius: 6px;
  cursor: pointer;
  color: #444;
  font-weight: 500;
  margin-bottom: 4px;
  transition: all 0.2s;
}

.nav-item:hover {
  background: var(--bg-input);
  color: var(--primary);
}

.nav-item.active {
  background: #e6faef;
  /* 浅绿色背景 */
  color: var(--primary);
  font-weight: 600;
}

.nav-item .icon {
  margin-right: 10px;
  font-size: 16px;
  opacity: 0.9;
}

.sidebar-footer {
  padding: 12px;
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 12px;
}

.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #e6faef;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  color: var(--primary);
  border: 1px solid var(--primary);
}

.user-info {
  flex: 1;
}

.user-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-main);
}

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

.logout-btn {
  cursor: pointer;
  padding: 8px;
  border-radius: 4px;
  transition: background 0.2s;
}

.logout-btn:hover {
  background: var(--bg-input);
  color: var(--danger);
}

.main-content {
  flex: 1;
  min-width: 0;
  padding: 14px 16px;
  overflow-y: auto;
  display: block;
}

/* Mobile Header */
.mobile-header {
  display: none;
  height: 60px;
  background: var(--card-bg);
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  border-bottom: 1px solid var(--border-color);
  z-index: 90;
}

.sidebar-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 95;
  display: none;
  opacity: 0;
  transition: opacity 0.3s;
}

.sidebar-overlay.open {
  display: block;
  opacity: 1;
}

.menu-toggle {
  font-size: 24px;
  cursor: pointer;
  background: none;
  border: none;
  color: var(--text-main);
}

/* ============ Pages & Components ============ */

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

.page-title {
  display: none;
}

.page-desc {
  display: none;
}

.card {
  background: var(--card-bg);
  border-radius: var(--border-radius);
  padding: 24px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border-color);
  margin-bottom: 20px;
}

.card-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Button */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 38px;
  padding: 0 16px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  border: 1px solid transparent;
  gap: 8px;
  white-space: nowrap;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 2px 6px rgba(0, 210, 106, 0.2);
}

.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 210, 106, 0.3);
}

.btn-outline {
  background: transparent;
  border-color: #d9d9d9;
  color: #333;
}

.btn-outline:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.btn-danger {
  background: var(--danger);
  color: #fff;
}

.btn-danger:hover {
  opacity: 0.9;
}

.btn-warning {
  background: #fa8c16;
  color: #fff;
}

.btn-warning:hover {
  background: #e07b10;
}

.btn-refresh-author {
  background: #fff7e6;
  color: #d46b08;
  border: 1px solid #ffd591;
  border-radius: 6px;
  padding: 3px 9px;
  font-size: 12px;
  cursor: pointer;
  transition: background .15s;
}

.btn-refresh-author.inline {
  position: static;
  height: 28px;
  padding: 0 9px;
}
.btn-refresh-author:hover {
  background: #ffe7ba;
}
.btn-refresh-author:disabled {
  opacity: .6;
  cursor: default;
}

.author-mcn-tag {
  display: inline-block;
  margin-top: 4px;
  padding: 2px 8px;
  background: #f0f5ff;
  color: #2f54eb;
  border: 1px solid #adc6ff;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.author-cat-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 3px;
}
.cat-primary {
  display: inline-block;
  padding: 1px 7px;
  background: #e6f7ff;
  color: #0958d9;
  border: 1px solid #91caff;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
}
.cat-secondary {
  display: inline-block;
  padding: 1px 7px;
  background: #f9f0ff;
  color: #531dab;
  border: 1px solid #d3adf7;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
}
.cat-empty {
  display: inline-block;
  padding: 1px 7px;
  background: #f5f5f5;
  color: #8c8c8c;
  border: 1px solid #d9d9d9;
  border-radius: 4px;
  font-size: 11px;
}


.btn-success {
  background: var(--success);
  color: #fff;
}

.btn-success:hover {
  opacity: 0.9;
}

.btn-lg {
  height: 46px;
  padding: 0 24px;
  font-size: 16px;
  border-radius: 8px;
  font-weight: 600;
}

.btn-sm {
  height: 28px;
  padding: 0 10px;
  font-size: 12px;
  border-radius: 4px;
}

/* Dashboard Grids */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 20px;
}

.stat-card {
  background: var(--card-bg);
  padding: 24px 20px;
  border-radius: var(--border-radius);
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow);
}

.stat-icon {
  font-size: 32px;
  margin-bottom: 16px;
  display: inline-flex;
  padding: 12px;
  background: #e6faef;
  border-radius: 8px;
  width: fit-content;
}

.stat-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-main);
}

.stat-label {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Grid Layouts */
.author-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
}

#authorsGrid.author-grid {
  display: block;
  width: 100%;
}

.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 14px;
  align-items: start;
}

/* Author Card */
.author-card {
  background: var(--card-bg);
  border-radius: var(--border-radius);
  padding: 16px;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  border: 1px solid var(--border-color);
}

.author-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
}

.author-top {
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
  align-items: flex-start;
}

.author-avatar img {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid #eee;
}

.author-name {
  font-weight: 600;
  font-size: 15px;
  margin-bottom: 4px;
}

.author-cat {
  font-size: 12px;
  color: var(--primary);
  background: #e6faef;
  padding: 2px 6px;
  border-radius: 4px;
  display: inline-block;
}

.author-signature {
  font-size: 12px;
  color: #666;
  line-height: 1.4;
  margin-bottom: 12px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 33px;
}

.author-stats {
  display: flex;
  justify-content: space-between;
  border-top: 1px solid var(--border-color);
  padding-top: 12px;
  margin-bottom: 12px;
}

.s-val {
  font-weight: 600;
  font-size: 14px;
}

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

.author-video-stats {
  display: flex;
  gap: 8px;
}

.author-card-actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  margin-top: 12px;
}

.author-card-actions .btn {
  width: 100%;
  min-width: 0;
  padding: 0 6px;
  font-size: 12px;
}

.author-list-table-wrap {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  max-width: 100%;
  overflow-x: auto;
}

.author-list-table {
  width: 100%;
  min-width: 1240px;
  table-layout: auto;
}

.author-list-table th,
.author-list-table td {
  vertical-align: middle;
  white-space: nowrap;
}

.author-list-table th:first-child,
.author-list-table td:first-child {
  width: 230px;
  min-width: 230px;
  max-width: 230px;
}

.author-row-profile {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.author-row-meta {
  min-width: 0;
  flex: 1;
}

.author-row-avatar {
  width: 42px;
  height: 42px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  border-radius: 50%;
  flex: 0 0 auto;
}

.author-row-avatar img {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid #eee;
  display: block;
}

.author-row-name {
  display: block;
  max-width: 130px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text-color);
  font-size: 14px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.author-row-name:hover {
  color: var(--primary);
}

.author-row-secuid {
  max-width: 140px;
  margin-top: 3px;
  color: var(--text-muted);
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.btn-refresh-author.inline {
  position: static;
  margin-left: 2px;
  flex: 0 0 auto;
}

.author-home-link {
  color: var(--primary);
  font-weight: 500;
}

.num-cell {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.featured-count {
  color: #e65100;
}

.non-featured-count {
  color: #1565c0;
}

.author-row-actions {
  flex-wrap: nowrap;
}

.author-row-actions .btn {
  padding: 0 9px;
}

.featured-stat,
.non-featured-stat {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
}

.featured-stat {
  background: linear-gradient(135deg, #fff3e0 0%, #ffe0b2 100%);
  color: #e65100;
  border: 1px solid #ffcc80;
}

.non-featured-stat {
  background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
  color: #1565c0;
  border: 1px solid #90caf9;
}

.featured-stat .stat-icon,
.non-featured-stat .stat-icon {
  font-size: 16px;
}

.featured-stat .stat-number,
.non-featured-stat .stat-number {
  font-size: 18px;
  font-weight: 700;
}

.featured-stat .stat-text,
.non-featured-stat .stat-text {
  font-size: 11px;
}

/* Video Card */
.video-card {
  background: var(--card-bg);
  border-radius: var(--border-radius);
  overflow: hidden;
  border: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
}

.cover-wrap {
  position: relative;
  aspect-ratio: 3 / 4;
  background: #eee;
  overflow: hidden;
}

.cover-wrap.is-clickable {
  cursor: pointer;
}

.cover-wrap.is-clickable img,
.cover-wrap.is-clickable .cover-empty {
  transition: transform 0.2s ease;
}

.cover-wrap.is-clickable:hover img,
.cover-wrap.is-clickable:hover .cover-empty {
  transform: scale(1.02);
}

.cover-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.cover-empty,
.cover-missing::after {
  content: '暂无封面';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #999;
  font-size: 13px;
  background: #f1f1f1;
}

.jingxuan-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  color: #fff;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
}

.jingxuan-badge.featured {
  background: #ff2a44;
}

.jingxuan-badge.normal {
  background: rgba(20, 20, 20, 0.72);
}

.duration-badge {
  position: absolute;
  bottom: 6px;
  right: 6px;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 11px;
}

.select-check {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 20px;
  height: 20px;
  border-radius: 4px;
  border: 2px solid #fff;
  background: rgba(0, 0, 0, 0.3);
  cursor: pointer;
  transition: all 0.2s;
}

.select-check.checked {
  background: var(--primary);
  border-color: var(--primary);
}

.select-check.checked::after {
  content: '✓';
  color: #fff;
  position: absolute;
  top: -2px;
  left: 3px;
  font-size: 14px;
  font-weight: bold;
}

.video-info {
  padding: 10px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.video-desc {
  font-size: 12px;
  font-weight: 500;
  margin-bottom: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.4;
  color: #333;
  min-height: 34px;
}

.video-stats {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: #666;
  margin-bottom: 6px;
}

.video-tags-line {
  font-size: 11px;
  color: #999;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-bottom: 5px;
  min-height: 16px;
}

.video-meta-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
  padding-top: 5px;
}

.video-author-chip {
  font-size: 11px;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 50%;
}

.video-date-chip {
  font-size: 11px;
  color: #aaa;
  flex-shrink: 0;
}

.video-card-actions {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}

.video-card-actions .btn {
  flex: 1;
  justify-content: center;
  padding: 5px 6px;
  font-size: 12px;
}

.extract-progress {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.extract-progress-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  color: var(--text-muted);
}

.extract-progress-track {
  height: 8px;
  border-radius: 999px;
  background: #edf0f2;
  overflow: hidden;
}

.extract-progress-fill {
  height: 100%;
  width: 0%;
  background: var(--primary);
  transition: width 0.25s ease;
}

.copy-result {
  white-space: pre-wrap;
  line-height: 1.7;
  background: #fafafa;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 14px;
}

/* Forms */
.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  font-size: 14px;
  color: var(--text-main);
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  height: 38px;
  padding: 0 12px;
  background: #fafafa;
  border: 1px solid #d9d9d9;
  border-radius: 6px;
  color: var(--text-main);
  font-size: 14px;
  transition: all 0.2s;
  font-family: inherit;
}

.form-input:hover,
.form-select:hover,
.form-textarea:hover {
  border-color: #bbb;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--primary);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(0, 210, 106, 0.1);
}

.form-textarea {
  height: auto;
  min-height: 100px;
  padding: 10px 12px;
  resize: vertical;
}

.extract-input-card {
  max-width: 920px;
  margin-bottom: 20px;
  padding: 22px 24px;
  background:
    radial-gradient(circle at top left, rgba(0, 210, 106, 0.10), transparent 34%),
    var(--card-bg);
}

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

.extract-input-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-main);
}

.extract-input-desc {
  margin-top: 4px;
  color: var(--text-muted);
  font-size: 13px;
}

.extract-input-tip {
  flex: 0 0 auto;
  padding: 5px 10px;
  border-radius: 999px;
  background: #e6faef;
  color: var(--primary-hover);
  border: 1px solid rgba(0, 210, 106, 0.18);
  font-size: 12px;
  font-weight: 600;
}

.extract-paste-panel {
  border: 1px solid #d9f5e7;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.76);
  padding: 12px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

.extract-url-textarea {
  min-height: 118px;
  border: 0;
  background: #fff;
  line-height: 1.65;
  border-radius: 10px;
  box-shadow: inset 0 0 0 1px #e7e8eb;
}

.extract-url-textarea:focus {
  box-shadow:
    inset 0 0 0 1px var(--primary),
    0 0 0 3px rgba(0, 210, 106, 0.10);
}

.extract-input-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
}

.extract-preview-line {
  min-width: 0;
  color: var(--text-muted);
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.extract-preview-line.is-ok {
  color: var(--primary-hover);
  font-weight: 600;
}

.extract-preview-line.is-warn {
  color: #d48806;
}

.extract-input-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex: 0 0 auto;
}

/* Tables */
.table-wrap {
  overflow-x: auto;
}

.table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.table th,
.table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
}

.table th {
  font-weight: 600;
  color: #555;
  background: #fafafa;
  font-size: 13px;
}

.table td {
  font-size: 13px;
}

.table tbody tr:hover {
  background: #f9f9f9;
}

.list-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid var(--border-color);
  border-radius: 14px;
  background: #fff;
  box-shadow: var(--shadow);
}

.pagination-summary {
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.5;
}

.pagination-summary strong {
  color: var(--text-main);
}

.pagination-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 6px;
}

.pagination-size,
.pagination-btn {
  height: 32px;
  border: 1px solid #dfe5e9;
  border-radius: 10px;
  background: #fff;
  color: #34423a;
  font-size: 13px;
  font-weight: 650;
}

.pagination-size {
  padding: 0 10px;
}

.pagination-btn {
  min-width: 34px;
  padding: 0 10px;
  cursor: pointer;
  transition: all 0.16s ease;
}

.pagination-btn:hover:not(:disabled) {
  border-color: rgba(0, 210, 106, 0.45);
  color: #0e8c4b;
  background: #f4fff9;
}

.pagination-btn.active {
  border-color: #0e8c4b;
  background: #0e8c4b;
  color: #fff;
}

.pagination-btn:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

/* Settings Rows & Sections (used on Dashboard and Rankings) */
.settings-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 20px;
}

.settings-section {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 24px;
  margin-bottom: 20px;
}

.settings-section h3 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-main);
}

.settings-section .section-desc {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.settings-shell {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.settings-hero {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at top right, rgba(0, 210, 106, 0.18), transparent 34%),
    linear-gradient(135deg, #fffef8 0%, #f6fff9 55%, #eefaf4 100%);
  border: 1px solid rgba(0, 210, 106, 0.14);
  border-radius: 24px;
  padding: 28px 30px;
  box-shadow: 0 14px 40px rgba(30, 60, 40, 0.08);
}

.settings-hero::after {
  content: '';
  position: absolute;
  inset: auto -30px -36px auto;
  width: 180px;
  height: 180px;
  border-radius: 999px;
  background: rgba(0, 210, 106, 0.08);
  filter: blur(6px);
}

.settings-hero-copy {
  position: relative;
  z-index: 1;
  max-width: 720px;
}

.settings-hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  margin-bottom: 12px;
  border-radius: 999px;
  background: rgba(0, 210, 106, 0.1);
  color: #0e8c4b;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.settings-hero-title {
  font-size: 30px;
  line-height: 1.15;
  font-weight: 800;
  color: #163222;
  margin-bottom: 10px;
}

.settings-hero-desc {
  font-size: 14px;
  line-height: 1.75;
  color: #4d6357;
}

.settings-hero-meta {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.settings-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(0, 0, 0, 0.05);
  background: rgba(255, 255, 255, 0.72);
  color: #345246;
  font-size: 12px;
  font-weight: 600;
}

.settings-pill code {
  background: rgba(0, 0, 0, 0.05);
  padding: 2px 6px;
  border-radius: 999px;
  font-size: 11px;
}

.settings-pill.is-green {
  border-color: rgba(0, 210, 106, 0.16);
}

.settings-pill.is-blue {
  border-color: rgba(26, 115, 232, 0.16);
}

.settings-pill.is-amber {
  border-color: rgba(255, 164, 27, 0.18);
}

.settings-grid {
  display: grid;
  gap: 18px;
}

.settings-grid-primary {
  grid-template-columns: 1fr;
}

.platform-settings-grid {
  grid-template-columns: minmax(420px, 1fr) minmax(280px, 0.58fr);
  align-items: start;
}

.dy-interface-grid,
.docs-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
}

.settings-grid-compact {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
}

.settings-grid-compact .settings-section:last-child {
  grid-column: span 2;
}

.settings-section-featured {
  border-color: rgba(0, 210, 106, 0.16);
  box-shadow: 0 12px 34px rgba(0, 210, 106, 0.08);
}

.settings-section-soft {
  background: linear-gradient(180deg, #ffffff 0%, #fbfdfc 100%);
}

.settings-section-wide {
  margin-bottom: 0;
}

.settings-card-polished {
  margin-bottom: 0;
  border-radius: 22px;
  border-color: rgba(22, 50, 34, 0.08);
  background:
    radial-gradient(circle at top right, rgba(0, 210, 106, 0.08), transparent 32%),
    linear-gradient(180deg, #ffffff 0%, #fbfdfc 100%);
  box-shadow: 0 14px 38px rgba(22, 50, 34, 0.07);
}

.settings-section-head {
  margin-bottom: 18px;
}

.settings-section-title {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.settings-section-title h3 {
  margin: 0 0 5px;
}

.settings-section-icon {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  background: rgba(0, 210, 106, 0.12);
  color: #0e8c4b;
  font-size: 20px;
}

.settings-section-icon.is-blue {
  background: rgba(26, 115, 232, 0.12);
  color: #1a73e8;
}

.settings-section-icon.is-green {
  background: rgba(0, 210, 106, 0.14);
  color: #0e8c4b;
}

.settings-section-icon.is-amber {
  background: rgba(255, 164, 27, 0.16);
  color: #a15d00;
}

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

.settings-form-grid-single {
  grid-template-columns: 1fr;
}

.field-help {
  margin-top: 8px;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.6;
}

.settings-cookie-textarea {
  min-height: 118px;
  resize: vertical;
  line-height: 1.6;
}

.settings-inline-tip {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 2px 0 16px;
  padding: 11px 12px;
  border: 1px dashed rgba(26, 115, 232, 0.18);
  border-radius: 14px;
  background: rgba(26, 115, 232, 0.04);
  color: #48615a;
  font-size: 12px;
  line-height: 1.6;
}

.settings-inline-tip code,
.endpoint-line code,
.docs-flow-step code,
.docs-list strong,
.settings-mini-list strong {
  word-break: break-all;
}

.method-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 46px;
  padding: 4px 9px;
  border-radius: 999px;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.method-get {
  background: #1a73e8;
}

.method-post {
  background: #0e8c4b;
}

.method-put {
  background: #8a5cf6;
}

.method-delete {
  background: #d14343;
}

.settings-hero-platform {
  background:
    radial-gradient(circle at 88% 18%, rgba(255, 164, 27, 0.18), transparent 28%),
    radial-gradient(circle at 12% 8%, rgba(0, 210, 106, 0.14), transparent 32%),
    linear-gradient(135deg, #fffdf6 0%, #f7fff9 56%, #f4fbff 100%);
}

.clean-config-page {
  gap: 16px;
}

.clean-page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 18px;
  padding: 24px 26px;
  border: 1px solid rgba(22, 50, 34, 0.08);
  border-radius: 22px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(248, 253, 250, 0.96)),
    radial-gradient(circle at 92% 0%, rgba(0, 210, 106, 0.12), transparent 32%);
  box-shadow: 0 14px 34px rgba(22, 50, 34, 0.06);
}

.clean-page-kicker {
  margin-bottom: 8px;
  color: #0e8c4b;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.clean-page-title {
  color: #14231b;
  font-size: 28px;
  font-weight: 800;
  line-height: 1.2;
}

.clean-page-desc {
  max-width: 680px;
  margin-top: 8px;
  color: #607066;
  font-size: 14px;
  line-height: 1.7;
}

.clean-page-chip {
  flex: 0 0 auto;
  padding: 8px 12px;
  border: 1px solid rgba(0, 210, 106, 0.18);
  border-radius: 999px;
  background: #f2fff8;
  color: #0e8c4b;
  font-size: 12px;
  font-weight: 700;
}

.platform-settings-layout {
  display: grid;
  grid-template-columns: minmax(420px, 1fr) minmax(320px, 380px);
  gap: 18px;
  align-items: start;
}

.clean-settings-card,
.brand-preview-panel {
  padding: 24px;
  border: 1px solid rgba(22, 50, 34, 0.08);
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 14px 34px rgba(22, 50, 34, 0.06);
}

.clean-card-head {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 22px;
}

.clean-card-icon {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  background: #173d2d;
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.clean-card-head h3 {
  margin: 0 0 6px;
  color: #14231b;
  font-size: 18px;
  font-weight: 800;
}

.clean-card-head p {
  margin: 0;
  color: #6b786f;
  font-size: 13px;
  line-height: 1.65;
}

.platform-name-field {
  margin-bottom: 18px;
}

.platform-name-input {
  height: 46px;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 700;
}

.platform-name-actions {
  display: flex;
  gap: 10px;
  margin-top: 4px;
}

.clean-note {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
  padding: 12px 14px;
  border-radius: 14px;
  background: #f7faf8;
  color: #66736b;
  font-size: 12px;
}

.clean-note code {
  color: #173d2d;
  font-weight: 800;
  word-break: break-all;
}

.brand-preview-panel {
  background:
    linear-gradient(180deg, #ffffff 0%, #fbfdfc 100%);
}

.brand-preview-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.brand-preview-title span {
  color: #14231b;
  font-size: 16px;
  font-weight: 800;
}

.brand-preview-title strong {
  padding: 5px 9px;
  border-radius: 999px;
  background: #edf9f3;
  color: #0e8c4b;
  font-size: 11px;
}

.preview-window {
  overflow: hidden;
  border: 1px solid rgba(22, 50, 34, 0.08);
  border-radius: 18px;
  background: #f6faf8;
}

.preview-window-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 12px;
  border-bottom: 1px solid rgba(22, 50, 34, 0.08);
  background: #fff;
}

.preview-window-bar i {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #d6e1da;
}

.preview-window-bar i:nth-child(1) {
  background: #ff7b6f;
}

.preview-window-bar i:nth-child(2) {
  background: #ffc857;
}

.preview-window-bar i:nth-child(3) {
  background: #41d681;
}

.preview-window-body {
  padding: 16px;
}

.preview-login-card {
  display: flex;
  align-items: center;
  gap: 13px;
  min-height: 112px;
  padding: 18px;
  border-radius: 18px;
  background:
    radial-gradient(circle at 88% 8%, rgba(255, 255, 255, 0.22), transparent 30%),
    linear-gradient(135deg, #173d2d 0%, #0e8c4b 100%);
  color: #fff;
  box-shadow: 0 14px 28px rgba(14, 140, 75, 0.18);
}

.preview-brand-mark {
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  font-size: 20px;
  font-weight: 900;
}

.preview-brand-name {
  color: #fff;
  font-size: 18px;
  font-weight: 900;
  line-height: 1.3;
}

.preview-brand-subtitle {
  margin-top: 6px;
  color: rgba(255, 255, 255, 0.74);
  font-size: 12px;
}

.preview-meta-grid {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.preview-meta-item {
  display: grid;
  gap: 5px;
  padding: 12px;
  border-radius: 14px;
  background: #f7faf8;
}

.preview-meta-item span {
  color: #7a887f;
  font-size: 12px;
}

.preview-meta-item strong {
  color: #20342a;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.45;
  word-break: break-all;
}

.settings-hero-dy {
  background:
    radial-gradient(circle at 14% 18%, rgba(26, 115, 232, 0.15), transparent 30%),
    radial-gradient(circle at 88% 12%, rgba(0, 210, 106, 0.18), transparent 32%),
    linear-gradient(135deg, #f7fbff 0%, #f5fff8 58%, #fffdf6 100%);
  border-color: rgba(26, 115, 232, 0.12);
}

.settings-preview-card {
  min-height: 100%;
}

.platform-preview {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  border-radius: 18px;
  background: #173d2d;
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.platform-preview-logo {
  width: 46px;
  height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.12);
  font-size: 22px;
}

.platform-preview-name {
  font-size: 18px;
  font-weight: 800;
  line-height: 1.25;
}

.platform-preview-meta {
  margin-top: 5px;
  color: rgba(255, 255, 255, 0.68);
  font-size: 12px;
}

.settings-mini-list,
.docs-list {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.settings-mini-list div,
.docs-list div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 12px;
  border-radius: 13px;
  background: rgba(22, 50, 34, 0.04);
  font-size: 12px;
}

.settings-mini-list span,
.docs-list span {
  color: var(--text-muted);
}

.settings-mini-list strong,
.docs-list strong {
  color: var(--text-main);
  font-weight: 700;
  text-align: right;
}

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

.settings-save-note {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed rgba(0, 0, 0, 0.08);
  color: #5f7569;
  font-size: 12px;
  line-height: 1.6;
}

.settings-save-note code {
  background: rgba(0, 0, 0, 0.045);
  padding: 2px 6px;
  border-radius: 999px;
}

.settings-bottom-tip {
  margin-bottom: 0;
}

.settings-hero-model {
  background:
    radial-gradient(circle at 12% 18%, rgba(26, 115, 232, 0.16), transparent 28%),
    radial-gradient(circle at 88% 8%, rgba(0, 210, 106, 0.2), transparent 30%),
    linear-gradient(135deg, #f8fbff 0%, #eef8f3 54%, #f7fbff 100%);
  border-color: rgba(26, 115, 232, 0.12);
}

.settings-hero-docs {
  background:
    radial-gradient(circle at 12% 18%, rgba(255, 164, 27, 0.16), transparent 28%),
    radial-gradient(circle at 88% 10%, rgba(26, 115, 232, 0.15), transparent 32%),
    linear-gradient(135deg, #fffdf7 0%, #f7fbff 56%, #f5fff8 100%);
  border-color: rgba(255, 164, 27, 0.14);
}

.docs-shell {
  gap: 20px;
}

.docs-grid {
  display: grid;
  gap: 18px;
}

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

.docs-quick-card {
  display: grid;
  gap: 5px;
  padding: 16px;
  border-radius: 18px;
  border: 1px solid rgba(22, 50, 34, 0.07);
  background: linear-gradient(180deg, #ffffff 0%, #fbfdfc 100%);
  box-shadow: 0 10px 28px rgba(22, 50, 34, 0.06);
}

.docs-quick-card span {
  color: #0e8c4b;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.docs-quick-card strong {
  color: var(--text-main);
  font-size: 15px;
}

.docs-quick-card em {
  color: var(--text-muted);
  font-size: 12px;
  font-style: normal;
  line-height: 1.55;
}

.docs-card {
  padding: 22px;
  border-radius: 22px;
  border: 1px solid rgba(22, 50, 34, 0.08);
  background: linear-gradient(180deg, #ffffff 0%, #fbfdfc 100%);
  box-shadow: 0 14px 38px rgba(22, 50, 34, 0.07);
}

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

.docs-card-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
}

.docs-card-header h3 {
  margin: 0 0 5px;
  color: var(--text-main);
  font-size: 17px;
}

.docs-card-header p {
  margin: 0;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.6;
}

.docs-card-icon {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  background: rgba(26, 115, 232, 0.12);
  font-size: 20px;
}

.docs-card-icon.is-green {
  background: rgba(0, 210, 106, 0.14);
}

.docs-card-icon.is-amber {
  background: rgba(255, 164, 27, 0.16);
}

.endpoint-line {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border-radius: 14px;
  background: rgba(22, 50, 34, 0.04);
  overflow-x: auto;
}

.endpoint-line code {
  color: #173d2d;
  font-size: 12px;
  white-space: nowrap;
}

.docs-code {
  margin: 14px 0 0;
  padding: 15px;
  border-radius: 14px;
  background: #13241b;
  color: #e7fff0;
  font-size: 12px;
  line-height: 1.7;
  overflow-x: auto;
}

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

.docs-flow-step {
  display: grid;
  gap: 8px;
  padding: 14px;
  border-radius: 16px;
  background: rgba(22, 50, 34, 0.04);
}

.docs-flow-step span {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  background: #173d2d;
  color: #fff;
  font-weight: 800;
}

.docs-flow-step strong {
  color: var(--text-main);
}

.docs-flow-step code {
  color: #4d6357;
  font-size: 12px;
}

.clean-docs-page {
  gap: 16px;
}

.openapi-docs-page {
  max-width: 1180px;
}

.docs-page-head {
  background:
    radial-gradient(circle at 88% 12%, rgba(255, 182, 72, 0.2), transparent 28%),
    radial-gradient(circle at 12% 2%, rgba(20, 128, 82, 0.16), transparent 30%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(248, 252, 255, 0.96));
}

.docs-head-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.docs-download-btn {
  height: 36px;
  padding: 0 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 850;
  box-shadow: 0 10px 22px rgba(14, 140, 75, 0.16);
}

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

.docs-summary-card {
  padding: 18px;
  border: 1px solid rgba(22, 50, 34, 0.08);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(22, 50, 34, 0.05);
}

.docs-summary-card span {
  display: inline-flex;
  margin-bottom: 12px;
  color: #0e8c4b;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.docs-summary-card strong {
  display: block;
  color: #14231b;
  font-size: 16px;
  font-weight: 850;
}

.docs-summary-card p {
  margin: 7px 0 0;
  color: #6b786f;
  font-size: 13px;
  line-height: 1.65;
}

.docs-detail-stack {
  display: grid;
  gap: 16px;
}

.doc-api-card {
  padding: 24px;
  border: 1px solid rgba(22, 50, 34, 0.08);
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 14px 34px rgba(22, 50, 34, 0.06);
}

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

.doc-api-label {
  display: inline-flex;
  margin-bottom: 8px;
  color: #0e8c4b;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.1em;
}

.doc-api-head h3 {
  margin: 0;
  color: #14231b;
  font-size: 19px;
  font-weight: 850;
  line-height: 1.3;
}

.doc-api-head p {
  margin: 7px 0 0;
  color: #6b786f;
  font-size: 13px;
  line-height: 1.65;
}

.doc-status-pill {
  flex: 0 0 auto;
  padding: 6px 10px;
  border-radius: 999px;
  background: #f7f0df;
  color: #8a5a00;
  font-size: 12px;
  font-weight: 800;
}

.doc-endpoint-row {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 13px 14px;
  border-radius: 15px;
  background: #f7faf8;
}

.doc-endpoint-row span {
  color: #6b786f;
  font-size: 12px;
  font-weight: 700;
}

.doc-endpoint-row code {
  color: #173d2d;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.55;
  word-break: break-all;
}

.doc-info-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.doc-info-grid div {
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid rgba(22, 50, 34, 0.06);
  border-radius: 14px;
  background: #fff;
}

.doc-info-grid span {
  color: #7a887f;
  font-size: 12px;
}

.doc-info-grid strong {
  color: #20342a;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.45;
  word-break: break-word;
}

.doc-two-column {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) minmax(280px, 0.9fr);
  gap: 12px;
  margin-top: 12px;
}

.doc-code-block {
  margin: 0;
  padding: 16px;
  border-radius: 16px;
  background: #13241b;
  color: #e7fff0;
  font-size: 12px;
  line-height: 1.7;
  overflow-x: auto;
}

.doc-info-grid-compact {
  grid-template-columns: 1fr;
  margin-top: 0;
}

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

.doc-step-card {
  display: grid;
  gap: 8px;
  padding: 15px;
  border-radius: 16px;
  background: #f7faf8;
}

.doc-step-card span {
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: #173d2d;
  color: #fff;
  font-size: 13px;
  font-weight: 900;
}

.doc-step-card strong {
  color: #20342a;
  font-size: 14px;
  font-weight: 850;
}

.doc-step-card code {
  color: #5f6f65;
  font-size: 12px;
  line-height: 1.45;
  word-break: break-all;
}

.openapi-access-card {
  background:
    radial-gradient(circle at 94% 8%, rgba(14, 140, 75, 0.09), transparent 30%),
    #fff;
}

.openapi-code-pair {
  align-items: stretch;
}

.openapi-code-pair .doc-code-block {
  min-height: 100%;
}

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

.doc-note-box {
  margin-top: 12px;
  padding: 14px 16px;
  border: 1px solid rgba(14, 140, 75, 0.16);
  border-radius: 16px;
  background: #f5fbf7;
  color: #3f5c4a;
  font-size: 13px;
  line-height: 1.75;
}

.openapi-section {
  scroll-margin-top: 18px;
}

.doc-endpoint-table {
  overflow: hidden;
  border: 1px solid rgba(22, 50, 34, 0.08);
  border-radius: 16px;
  background: #fff;
}

.doc-endpoint-table-head,
.doc-endpoint-table-row {
  display: grid;
  grid-template-columns: 76px minmax(210px, 1.1fr) 76px minmax(220px, 1fr) minmax(170px, 0.9fr);
  gap: 12px;
  align-items: center;
}

.doc-endpoint-table-head {
  padding: 12px 14px;
  background: #f6faf7;
  color: #627369;
  font-size: 12px;
  font-weight: 850;
}

.doc-endpoint-table-row {
  padding: 13px 14px;
  border-top: 1px solid rgba(22, 50, 34, 0.08);
  color: #35483e;
  font-size: 13px;
  line-height: 1.55;
}

.doc-endpoint-table-row code {
  color: #113d2a;
  font-size: 12px;
  font-weight: 750;
  word-break: break-all;
}

.doc-endpoint-table-row em {
  color: #7a887f;
  font-size: 12px;
  font-style: normal;
  line-height: 1.55;
  word-break: break-word;
}

.doc-auth-pill {
  justify-self: start;
  padding: 4px 9px;
  border-radius: 999px;
  background: #edf5ff;
  color: #1a73e8;
  font-size: 11px;
  font-weight: 850;
}

.doc-auth-pill.is-public {
  background: #effaf2;
  color: #0e8c4b;
}

.openapi-key-manager-card {
  background:
    radial-gradient(circle at 6% 8%, rgba(20, 128, 82, 0.13), transparent 30%),
    linear-gradient(135deg, #ffffff 0%, #fbfffd 100%);
}

.open-api-manager-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  align-items: start;
}

.open-api-create-card,
.open-api-list-card {
  min-width: 0;
  padding: 18px;
  border: 1px solid rgba(22, 50, 34, 0.08);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 12px 28px rgba(22, 50, 34, 0.055);
}

.open-api-create-card {
  position: static;
}

.open-api-create-card .open-api-form-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.open-api-create-card h3,
.open-api-list-card h3 {
  margin: 0;
  color: #13241b;
  font-size: 18px;
  font-weight: 900;
}

.open-api-create-card p,
.open-api-list-card p {
  margin: 8px 0 14px;
  color: #64756b;
  font-size: 13px;
  line-height: 1.65;
}

.open-api-list-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 14px;
}

.open-api-list-head h3 {
  margin: 0;
}

.open-api-form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.open-api-form-grid.is-compact {
  grid-template-columns: 1.1fr 1.15fr repeat(3, minmax(92px, 0.7fr));
  margin: 14px 0 12px;
}

.open-api-form-grid label {
  display: grid;
  gap: 6px;
  min-width: 0;
  color: #617066;
  font-size: 12px;
  font-weight: 800;
}

.open-api-permission-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 12px 0 14px;
}

.open-api-permission-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid rgba(22, 50, 34, 0.08);
  border-radius: 13px;
  background: #f7fbf8;
  color: #31453a;
  font-size: 12px;
  font-weight: 780;
  cursor: pointer;
  transition: border-color .18s ease, background .18s ease, transform .18s ease;
}

.open-api-permission-item:hover {
  transform: translateY(-1px);
  border-color: rgba(14, 140, 75, 0.24);
  background: #f0faf3;
}

.open-api-permission-item input {
  width: 15px;
  height: 15px;
  accent-color: #0e8c4b;
}

.open-api-permission-item span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.open-api-key-list {
  display: grid;
  gap: 12px;
}

.open-api-table-wrap {
  overflow-x: auto;
  border: 1px solid rgba(22, 50, 34, 0.08);
  border-radius: 18px;
  background: #fff;
}

.open-api-key-table {
  width: 100%;
  min-width: 900px;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
}

.open-api-key-table th:nth-child(1),
.open-api-key-table td:nth-child(1) {
  width: 22%;
}

.open-api-key-table th:nth-child(2),
.open-api-key-table td:nth-child(2) {
  width: 10%;
}

.open-api-key-table th:nth-child(3),
.open-api-key-table td:nth-child(3) {
  width: 28%;
}

.open-api-key-table th:nth-child(4),
.open-api-key-table td:nth-child(4) {
  width: 14%;
}

.open-api-key-table th:nth-child(5),
.open-api-key-table td:nth-child(5) {
  width: 14%;
}

.open-api-key-table th:nth-child(6),
.open-api-key-table td:nth-child(6) {
  width: 12%;
}

.open-api-key-table th,
.open-api-key-table td {
  padding: 12px;
  border-bottom: 1px solid rgba(22, 50, 34, 0.08);
  text-align: left;
  vertical-align: top;
}

.open-api-key-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f5faf7;
  color: #52655a;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.open-api-key-table tr:last-child td {
  border-bottom: 0;
}

.open-api-key-row:hover td {
  background: #fbfefc;
}

.open-api-edit-only {
  display: none !important;
}

.open-api-key-row.is-editing .open-api-view-only {
  display: none !important;
}

.open-api-key-row.is-editing .open-api-edit-only {
  display: initial !important;
}

.open-api-key-row.is-editing input.open-api-edit-only,
.open-api-key-row.is-editing select.open-api-edit-only {
  display: block !important;
}

.open-api-key-row.is-editing label.open-api-edit-only,
.open-api-key-row.is-editing .open-api-edit-only .open-api-permission-grid {
  display: grid !important;
}

.open-api-key-row.is-editing div.open-api-edit-only {
  display: block !important;
}

.open-api-key-meta {
  display: grid;
  gap: 7px;
  min-width: 180px;
}

.open-api-key-meta strong {
  color: #13241b;
  font-size: 14px;
  font-weight: 900;
  line-height: 1.35;
}

.open-api-key-meta code {
  display: inline-flex;
  width: fit-content;
  max-width: 210px;
  padding: 5px 9px;
  border-radius: 999px;
  background: #edf5ef;
  color: #17442f;
  font-size: 12px;
  line-height: 1.35;
  word-break: break-all;
}

.open-api-key-meta span {
  color: #7a887f;
  font-size: 12px;
}

.open-api-remark-text {
  display: inline-flex;
  max-width: 100%;
  color: #35483e;
  font-size: 13px;
  line-height: 1.5;
  word-break: break-word;
}

.open-api-permission-cell {
  min-width: 260px;
}

.open-api-permission-cell .open-api-permission-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin: 0;
}

.open-api-permission-cell .open-api-permission-item {
  padding: 7px 8px;
  font-size: 11px;
}

.open-api-permission-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-height: 96px;
  overflow: auto;
}

.open-api-permission-summary.is-compact {
  max-height: 36px;
  overflow: hidden;
}

.open-api-permission-summary span {
  display: inline-flex;
  align-items: center;
  padding: 5px 8px;
  border-radius: 999px;
  background: #edf8f1;
  color: #17613e;
  font-size: 11px;
  font-weight: 850;
}

.open-api-permission-summary em {
  color: #8b978f;
  font-size: 12px;
  font-style: normal;
}

.open-api-muted {
  color: #8b978f;
  font-size: 12px;
}

.open-api-usage-list {
  display: grid;
  gap: 6px;
  min-width: 150px;
  color: #64756b;
  font-size: 12px;
  line-height: 1.35;
}

.open-api-usage-list strong {
  color: #173d2d;
  font-weight: 900;
}

.open-api-limit-cell {
  display: grid;
  gap: 8px;
  min-width: 118px;
}

.open-api-limit-view {
  display: grid;
  gap: 5px;
  color: #64756b;
  font-size: 12px;
  line-height: 1.4;
}

.open-api-limit-cell label {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 6px;
  align-items: center;
  color: #64756b;
  font-size: 12px;
  font-weight: 800;
}

.open-api-key-card {
  padding: 16px;
  border: 1px solid rgba(22, 50, 34, 0.08);
  border-radius: 18px;
  background: linear-gradient(180deg, #ffffff 0%, #f9fcfa 100%);
}

.open-api-key-card-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.open-api-key-card-head strong {
  display: block;
  margin-bottom: 6px;
  color: #13241b;
  font-size: 16px;
  font-weight: 900;
}

.open-api-key-card-head code {
  display: inline-flex;
  max-width: 100%;
  padding: 5px 9px;
  border-radius: 999px;
  background: #edf5ef;
  color: #17442f;
  font-size: 12px;
  line-height: 1.35;
  word-break: break-all;
}

.open-api-owner {
  display: block;
  margin-top: 7px;
  color: #7a887f;
  font-size: 12px;
}

.open-api-status {
  flex: 0 0 auto;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
}

.open-api-status.is-active {
  background: #e8f9ef;
  color: #0e8c4b;
}

.open-api-status.is-paused {
  background: #fff1ef;
  color: #c2412d;
}

.open-api-usage-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 14px;
}

.open-api-usage-grid div {
  display: grid;
  gap: 5px;
  min-width: 0;
  padding: 10px;
  border-radius: 14px;
  background: #f5faf7;
}

.open-api-usage-grid span {
  color: #7a887f;
  font-size: 11px;
  font-weight: 800;
}

.open-api-usage-grid strong {
  overflow: hidden;
  color: #20342a;
  font-size: 13px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.open-api-key-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 12px;
}

.open-api-key-actions.is-table {
  display: grid;
  justify-content: stretch;
  min-width: 96px;
  margin-top: 0;
}

.open-api-generated-key {
  display: grid;
  gap: 8px;
  margin-top: 14px;
  padding: 13px;
  border: 1px solid rgba(14, 140, 75, 0.2);
  border-radius: 16px;
  background: #effaf2;
  color: #2d5440;
  font-size: 12px;
  line-height: 1.6;
}

.open-api-generated-key code {
  display: block;
  padding: 10px;
  border-radius: 12px;
  background: #13241b;
  color: #e7fff0;
  font-size: 12px;
  word-break: break-all;
}

.open-api-modal-form {
  display: grid;
  gap: 16px;
}

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

.open-api-modal-permissions {
  padding: 14px;
  border: 1px solid rgba(22, 50, 34, 0.08);
  border-radius: 18px;
  background: #f8fcfa;
}

.open-api-modal-permissions h4 {
  margin: 0;
  color: #13241b;
  font-size: 16px;
  font-weight: 900;
}

.open-api-modal-permissions p {
  margin: 6px 0 12px;
  color: #64756b;
  font-size: 12px;
  line-height: 1.6;
}

.open-api-modal-permissions .open-api-permission-grid {
  max-height: 320px;
  overflow: auto;
}

.openapi-docs-cta-card {
  background:
    radial-gradient(circle at 92% 18%, rgba(14, 140, 75, 0.1), transparent 28%),
    #fff;
}

.openapi-mini-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.openapi-docs-panel {
  display: grid;
  gap: 16px;
  scroll-margin-top: 16px;
}

.openapi-docs-panel.is-hidden {
  display: none;
}

.model-config-shell {
  gap: 20px;
}

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

.model-config-guide-card {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 16px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 18px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfdfc 100%);
  box-shadow: 0 10px 28px rgba(22, 50, 34, 0.06);
}

.model-config-guide-card strong {
  display: block;
  margin-bottom: 4px;
  color: var(--text-main);
}

.model-config-guide-card span {
  display: block;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.55;
}

.guide-number {
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: #173d2d;
  color: white;
  font-weight: 800;
}

.model-config-section {
  box-shadow: 0 14px 38px rgba(22, 50, 34, 0.07);
}

.model-config-section-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 10px;
}

.model-config-actions {
  justify-content: flex-end;
  margin-top: 14px;
}

@media (max-width: 900px) {
  .list-pagination {
    align-items: flex-start;
    flex-direction: column;
  }

  .pagination-controls {
    justify-content: flex-start;
  }

  .platform-settings-grid,
  .platform-settings-layout,
  .dy-interface-grid,
  .docs-grid,
  .docs-overview,
  .docs-flow,
  .docs-summary-grid,
  .doc-info-grid,
  .doc-two-column,
  .doc-step-grid,
  .open-api-manager-grid,
  .open-api-form-grid,
  .open-api-form-grid.is-compact,
  .open-api-permission-grid,
  .open-api-usage-grid {
    grid-template-columns: 1fr;
  }

  .open-api-create-card {
    position: static;
  }

  .open-api-key-card-head {
    flex-direction: column;
  }

  .open-api-key-actions {
    justify-content: flex-start;
  }

  .docs-card-wide {
    grid-column: auto;
  }

  .doc-api-card {
    padding: 20px;
  }

  .doc-api-head {
    flex-direction: column;
  }

  .doc-endpoint-row {
    grid-template-columns: 1fr;
  }

  .doc-endpoint-table-head {
    display: none;
  }

  .doc-endpoint-table-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .settings-form-grid {
    grid-template-columns: 1fr;
  }

  .settings-grid-compact {
    grid-template-columns: 1fr;
  }

  .settings-grid-compact .settings-section:last-child {
    grid-column: auto;
  }

  .model-config-overview {
    grid-template-columns: 1fr;
  }

  .model-config-section-head {
    flex-direction: column;
  }

  .settings-hero {
    padding: 24px 20px;
  }

  .settings-hero-title {
    font-size: 26px;
  }

  .clean-page-head {
    align-items: flex-start;
    flex-direction: column;
    padding: 22px;
  }

  .docs-head-actions {
    justify-content: flex-start;
  }

  .clean-page-title {
    font-size: 25px;
  }

  .clean-settings-card,
  .brand-preview-panel {
    padding: 20px;
  }

  .clean-note {
    align-items: flex-start;
    flex-direction: column;
  }

  .settings-mini-list div,
  .docs-list div {
    flex-direction: column;
    align-items: flex-start;
  }

  .settings-mini-list strong,
  .docs-list strong {
    text-align: left;
  }
}

.toolbar {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
  align-items: center;
}

.toolbar {
  margin-bottom: 10px;
}

.search-box {
  position: relative;
  width: 230px;
}

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #999;
  z-index: 2;
}

.search-box input {
  width: 100%;
  height: 38px;
  padding: 0 12px 0 36px;
  background: #fff;
  border: 1px solid #d9d9d9;
  border-radius: 6px;
  color: #333;
  transition: all 0.2s;
  font-family: inherit;
}

.search-box input:hover {
  border-color: #bbb;
}

.search-box input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 210, 106, 0.1);
}

.author-toolbar-search {
  width: min(300px, 24vw);
  flex: 0 1 300px;
}

.author-list-toolbar {
  flex-wrap: nowrap;
  justify-content: space-between;
  align-items: center;
}

.author-list-toolbar .author-toolbar-search.is-wide {
  width: auto;
  min-width: 220px;
  flex: 1 1 auto;
  max-width: 420px;
}

.author-list-add-btn {
  margin-left: auto;
  white-space: nowrap;
}

@media (max-width: 768px) {
  .author-list-toolbar {
    flex-wrap: wrap;
  }

  .author-list-toolbar .author-toolbar-search.is-wide {
    max-width: none;
    width: 100%;
  }
}

.author-detail-toolbar {
  gap: 8px;
  flex-wrap: nowrap;
  align-items: center;
  overflow-x: auto;
  padding-bottom: 2px;
}

.author-detail-toolbar .btn {
  height: 36px;
  padding: 0 12px;
}

.author-detail-toolbar .search-box input {
  height: 36px;
}

.empty-state {
  padding: 40px;
  text-align: center;
  color: #999;
}

.empty-icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.5;
}

/* Login Box */
.login-page {
  background: var(--bg-color);
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100vh;
  width: 100vw;
  position: fixed;
  top: 0;
  left: 0;
}

.login-box {
  background: #fff;
  padding: 40px;
  border-radius: 8px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.05);
  border: 1px solid var(--border-color);
  text-align: center;
}

.login-box .logo-icon {
  font-size: 48px;
  margin-bottom: 16px;
  display: inline-block;
}

.login-box h1 {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--primary);
}

.login-box .subtitle {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 30px;
}

.login-box form {
  text-align: left;
}

/* Author Details */
.author-detail-header {
  display: flex;
  gap: 24px;
  background: #fff;
  padding: 24px;
  border-radius: var(--border-radius);
  margin-bottom: 20px;
  box-shadow: var(--shadow);
  align-items: center;
  border: 1px solid var(--border-color);
  flex-wrap: wrap;
}

.big-avatar img {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #eee;
}

.author-meta {
  flex: 1;
  min-width: 250px;
}

.author-meta h2 {
  margin-bottom: 8px;
  display: flex;
  align-items: center;
}

.author-meta .sig {
  color: #666;
  font-size: 14px;
  margin-bottom: 12px;
  line-height: 1.5;
}

.author-detail-stats {
  display: flex;
  gap: 30px;
}

.ds-item {
  text-align: center;
}

.ds-val {
  font-size: 20px;
  font-weight: 700;
  color: #222;
}

.ds-label {
  font-size: 12px;
  color: #888;
  margin-top: 4px;
}

/* Tags & Badges */
.badge {
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 500;
}

.badge-primary {
  background: #e6faef;
  color: var(--primary);
}

.badge-success {
  background: #e6faef;
  color: var(--success);
}

.badge-mcn {
  background: #fff7e6;
  color: #ad4e00;
  border: 1px solid #ffd591;
}

.badge-danger {
  background: #fff1f0;
  color: var(--danger);
}

.inline-tag {
  display: inline-block;
  padding: 2px 8px;
  background: #f0f0f0;
  color: #555;
  border-radius: 4px;
  font-size: 12px;
}

.inline-tag:hover {
  background: #e0e0e0;
}

/* Alert */
.alert {
  padding: 16px;
  border-radius: 8px;
  margin-bottom: 16px;
}

.alert-info {
  background: #e6f7ff;
  border: 1px solid #91d5ff;
  color: #0050b3;
}

.alert-success {
  background: #f6ffed;
  border: 1px solid #b7eb8f;
  color: #389e0d;
}

.alert-warning {
  background: #fffbe6;
  border: 1px solid #ffe58f;
  color: #d46b08;
}

.alert-danger {
  background: #fff1f0;
  border: 1px solid #ffa39e;
  color: #cf1322;
}

.alert strong {
  font-weight: 600;
}

.alert ul {
  list-style: disc;
}


/* Rank List */
.rank-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.rank-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: #f8f9fa;
  border-radius: 6px;
}

.rank-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #ddd;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: bold;
}

.rank-num.top1 {
  background: #ff4d4f;
}

.rank-num.top2 {
  background: #fa8c16;
}

.rank-num.top3 {
  background: #faad14;
}

/* Global Loading Overlay (used by showLoading/hideLoading) */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.75);
  z-index: 10000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(2px);
}

.loading-overlay .spinner {
  width: 44px;
  height: 44px;
  border: 4px solid #e6faef;
  border-top: 4px solid var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 16px;
}

.loading-overlay div {
  color: var(--primary);
  font-weight: 500;
  font-size: 14px;
}

#global-loading {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.7);
  z-index: 10000;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(2px);
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid #f3f3f3;
  border-top: 3px solid var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

.loading-text {
  margin-top: 16px;
  color: var(--primary);
  font-weight: 500;
  font-size: 14px;
}

/* Toast notifications */
#toastContainer {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  min-width: 200px;
}

.toast {
  padding: 10px 20px;
  border-radius: 4px;
  font-size: 14px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: opacity 0.3s;
}

.toast-info {
  background: #555;
}

.toast-success {
  background: #52c41a;
}

.toast-error {
  background: #ff4d4f;
}

.toast-warning {
  background: #faad14;
  color: #333;
}

/* Modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.4);
  z-index: 9000;
  display: none;
  align-items: center;
  justify-content: center;
}

.modal-overlay.active {
  display: flex;
}

.modal {
  background: #fff;
  border-radius: 8px;
  width: 90%;
  max-width: 560px;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.15);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
  font-size: 16px;
  font-weight: 600;
}

.modal-close {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: #999;
}

.modal-close:hover {
  color: #333;
}

.modal-body {
  padding: 24px;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* Copy/Extract result area */
.copy-result {
  background: var(--bg-input);
  border-radius: 6px;
  padding: 16px;
  min-height: 80px;
  font-size: 14px;
  line-height: 1.8;
  color: var(--text-main);
  white-space: pre-wrap;
  word-break: break-all;
  border: 1px solid var(--border-color);
}

/* Category Tags */
.category-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  background: #fff;
  border: 1px solid var(--border-color);
  border-radius: 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.2s;
}

.category-tag:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: #f0fdf4;
}

.category-tag.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.category-tag .count {
  font-size: 12px;
  opacity: 0.8;
}

/* Progress Bar */
.progress-bar {
  width: 100%;
  height: 8px;
  background: #f0f0f0;
  border-radius: 4px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--primary-hover));
  transition: width 0.3s ease;
  border-radius: 4px;
}

/* Responsive */
@media (max-width: 768px) {
  .app-layout {
    flex-direction: column;
  }

  .sidebar {
    position: fixed;
    transform: translateX(-100%);
    height: 100%;
    box-shadow: 4px 0 16px rgba(0, 0, 0, 0.1);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .mobile-header {
    display: flex;
  }

  .author-detail-header {
    flex-direction: column;
    text-align: center;
  }

  .author-detail-stats {
    justify-content: center;
    width: 100%;
  }

  .extract-input-card {
    padding: 18px;
  }

  .extract-input-head,
  .extract-input-footer {
    flex-direction: column;
    align-items: stretch;
  }

  .extract-input-tip,
  .extract-input-actions {
    width: 100%;
  }

  .extract-input-actions .btn {
    flex: 1;
    padding: 0 10px;
  }

  .extract-preview-line {
    white-space: normal;
  }
}

/* Filter Section */
.filter-section {
  background: var(--card-bg);
  padding: 10px 12px;
  border-radius: var(--border-radius);
  margin: 0 8px 8px 0;
  box-shadow: var(--shadow);
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 46px;
  max-width: 100%;
  vertical-align: top;
}

.category-filter-section {
  display: flex;
  width: 100%;
  margin-right: 0;
  align-items: flex-start;
  flex-wrap: wrap;
}

.category-filter-section .category-tags {
  flex: 1 1 760px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}

.sub-category-row {
  width: 100%;
  align-items: center;
  gap: 6px;
  padding-left: 84px;
  margin-top: 8px;
}

.sub-category-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
}

.filter-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 0;
  flex: 0 0 auto;
  min-width: 72px;
}

.time-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.rank-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.time-filter-btn,
.rank-filter-btn {
  padding: 5px 12px;
  border: 1px solid var(--border-color);
  background: white;
  border-radius: 6px;
  font-size: 13px;
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.2s;
}

.time-filter-btn:hover,
.rank-filter-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.time-filter-btn.active,
.rank-filter-btn.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.video-toolbar {
  justify-content: space-between;
  margin-bottom: 10px;
}

.video-grid:not(.batch-select-mode) .select-check {
  display: none;
}

.btn-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  margin-left: 4px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.22);
  font-size: 12px;
  font-weight: 700;
}

.copywriting-toolbar {
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.copywriting-filter-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin: 0 0 12px;
  padding: 12px 14px;
  background: #fff;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  box-shadow: var(--shadow);
}

.copywriting-filter-group {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.copywriting-filter-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
}

.copywriting-date-filters {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.cw-date-btn {
  height: 30px;
  padding: 0 12px;
  border: 1px solid #e1e4e8;
  border-radius: 999px;
  background: #fff;
  color: #333;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  transition: all 0.18s;
}

.cw-date-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.cw-date-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  box-shadow: 0 4px 10px rgba(0, 210, 106, 0.18);
}

.copywriting-custom-range {
  align-items: center;
  gap: 6px;
}

.copywriting-custom-range .form-input {
  width: 142px;
  height: 32px;
}

.copywriting-user-select {
  width: 180px;
  height: 32px;
}

.copywriting-user-badge {
  display: inline-flex;
  align-items: center;
  max-width: 120px;
  height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: #f5f7fb;
  color: #495060;
  font-size: 12px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  max-width: 360px;
  height: 30px;
  padding: 0 10px;
  border-radius: 6px;
  background: #eef8f2;
  color: var(--primary);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
}

.status-processing {
  background: #fff7e6;
  color: #ad6800;
}

.status-done {
  background: #e8f8ef;
  color: var(--primary);
}

.status-failed {
  background: #fff1f0;
  color: var(--danger);
}

.cw-progress {
  width: 96px;
  height: 6px;
  margin-top: 7px;
  overflow: hidden;
  border-radius: 6px;
  background: #eef1f5;
}

.cw-progress-fill {
  height: 100%;
  border-radius: 6px;
  background: var(--primary);
}

.cw-progress-fill.active {
  background: linear-gradient(90deg, var(--primary), #8be0ac, var(--primary));
  background-size: 180% 100%;
  animation: cwProgress 1.2s linear infinite;
}

@keyframes cwProgress {
  from {
    background-position: 180% 0;
  }

  to {
    background-position: 0 0;
  }
}

.copywriting-video-title {
  font-weight: 600;
  color: var(--text-main);
}

.copywriting-task-id {
  margin-top: 4px;
  color: var(--text-muted);
  font-size: 11px;
  word-break: break-all;
}

.copywriting-full-text {
  display: none;
}

.rewrite-connect-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.rewrite-connector-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: #fff;
}

.rewrite-connector-card + .rewrite-connector-card {
  margin-top: 10px;
}

.rewrite-connector-card.installed {
  border-color: #91d5ff;
  background: #f0f8ff;
}

.rewrite-connector-title {
  font-weight: 700;
  color: var(--text-main);
}

.rewrite-connector-desc {
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.45;
}

.table-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.mcn-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 18px;
  margin-bottom: 8px;
}

.mcn-org-card {
  background: #fff;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  transition: box-shadow 0.2s, transform 0.15s;
  display: flex;
  flex-direction: column;
}

.mcn-org-card:hover {
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.09);
  transform: translateY(-2px);
}

.mcn-org-card-accent {
  height: 5px;
  background: linear-gradient(90deg, var(--primary), #0095ff);
}

.mcn-org-card-body {
  padding: 18px 20px 14px;
  flex: 1;
}

.mcn-org-avatar {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--primary), #0095ff);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 800;
  color: #fff;
  margin-bottom: 12px;
}

.mcn-org-name-text {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 4px;
}

.mcn-org-note-text {
  font-size: 12px;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mcn-org-stats {
  display: flex;
  border-top: 1px solid var(--border-color);
  margin-top: 14px;
  padding-top: 12px;
}

.mcn-org-stat {
  flex: 1;
  text-align: center;
}

.mcn-org-stat+.mcn-org-stat {
  border-left: 1px solid var(--border-color);
}

.mcn-stat-num {
  font-size: 19px;
  font-weight: 800;
  line-height: 1.2;
}

.mcn-stat-num.c-green {
  color: var(--primary);
}

.mcn-stat-num.c-blue {
  color: #1890ff;
}

.mcn-stat-num.c-purple {
  color: #722ed1;
}

.mcn-stat-label {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

.mcn-org-card-foot {
  padding: 11px 18px;
  display: flex;
  gap: 8px;
  align-items: center;
  border-top: 1px solid var(--border-color);
  background: #fafbfc;
}

.mcn-org-card-foot-spacer {
  flex: 1;
}

/* MCN Detail */
.mcn-detail-banner {
  background: linear-gradient(135deg, #00d26a 0%, #0095ff 100%);
  border-radius: 12px;
  padding: 24px 28px;
  color: #fff;
  margin-bottom: 20px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 16px;
}

.mcn-detail-banner-name {
  font-size: 22px;
  font-weight: 800;
  margin-bottom: 4px;
}

.mcn-detail-banner-note {
  font-size: 13px;
  opacity: 0.85;
  margin-bottom: 10px;
}

.mcn-detail-banner-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.mcn-detail-banner-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.22);
  font-size: 12px;
  color: #fff;
}

.mcn-detail-banner-stats {
  display: flex;
  gap: 32px;
  text-align: center;
}

.mcn-detail-stat-num {
  font-size: 26px;
  font-weight: 800;
  line-height: 1.1;
}

.mcn-detail-stat-label {
  font-size: 12px;
  opacity: 0.85;
  margin-top: 2px;
}

.mcn-cat-section {
  margin-bottom: 24px;
}

.mcn-cat-heading {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.mcn-cat-heading-bar {
  display: inline-block;
  width: 4px;
  height: 14px;
  background: var(--primary);
  border-radius: 2px;
}

.mcn-cat-heading-count {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
}

.mcn-author-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
}

.mcn-author-card {
  background: #fff;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 14px;
  cursor: pointer;
  transition: box-shadow 0.15s;
}

.mcn-author-card:hover {
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
}

.mcn-author-card-top {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
}

.mcn-author-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #eee;
  flex-shrink: 0;
}

.mcn-author-avatar-placeholder {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), #0095ff);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.mcn-author-nick {
  font-weight: 600;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mcn-author-tag {
  font-size: 11px;
  color: var(--primary);
  background: #e6faef;
  padding: 1px 6px;
  border-radius: 4px;
  display: inline-block;
  margin-top: 2px;
}

.mcn-author-stats {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-muted);
  padding-top: 8px;
  border-top: 1px solid var(--border-color);
}

.mcn-author-stats strong {
  color: var(--text-main);
}

.empty-inline {
  color: var(--text-muted);
  font-size: 13px;
}

.video-result-meta {
  color: var(--text-muted);
  font-size: 13px;
  margin: 0 0 8px;
}

.form-select {
  padding: 8px 12px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  background: white;
  font-size: 14px;
  color: var(--text-main);
  cursor: pointer;
  outline: none;
  transition: border-color 0.2s;
}

.form-select:focus {
  border-color: var(--primary);
}

/* Tag Item */
.tag-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-radius: 16px;
  font-size: 13px;
  font-weight: 500;
}

.tag-delete {
  background: rgba(255, 255, 255, 0.3);
  border: none;
  color: white;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.tag-delete:hover {
  background: rgba(255, 255, 255, 0.5);
}

/* Model Provider Cards */
.model-provider-card {
  padding: 18px;
  border: 1px solid rgba(0, 0, 0, 0.07);
  border-radius: 18px;
  background:
    linear-gradient(180deg, #ffffff 0%, #fbfdfc 100%);
  margin-bottom: 16px;
  position: relative;
  box-shadow: 0 10px 24px rgba(22, 50, 34, 0.06);
}

.model-provider-card .form-group {
  margin-bottom: 12px;
}

.model-provider-card .form-group:last-of-type {
  margin-bottom: 16px;
}

.model-provider-card .provider-enabled {
  margin-right: 8px;
  cursor: pointer;
}

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

.provider-form-grid {
  display: grid;
  grid-template-columns: minmax(180px, 0.8fr) minmax(260px, 1.2fr);
  gap: 12px 14px;
}

.provider-card-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-main);
}

.provider-card-desc {
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-muted);
}

.provider-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
}

.provider-toggle input:disabled + span {
  color: var(--text-muted);
}

.provider-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 4px;
}

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

.provider-test-status {
  flex: 1;
  min-width: 280px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: white;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.6;
}

.provider-test-status.is-success {
  background: #f6ffed;
  border-color: #b7eb8f;
  color: #389e0d;
}

.provider-test-status.is-failed {
  background: #fff1f0;
  border-color: #ffa39e;
  color: #cf1322;
}

.provider-test-status.is-testing {
  background: #e6f7ff;
  border-color: #91d5ff;
  color: #0050b3;
}

.provider-test-message {
  margin-top: 4px;
  word-break: break-word;
}

#modelProvidersContainer {
  margin-top: 16px;
}

@media (max-width: 900px) {
  .provider-card-header,
  .provider-card-footer {
    flex-direction: column;
  }

  .provider-form-grid {
    grid-template-columns: 1fr;
  }

  .provider-test-status {
    min-width: 0;
    width: 100%;
  }
}

/* Prompt Card Styles */
.prompt-card {
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 16px;
  background: white;
  transition: box-shadow 0.2s;
}

.prompt-card:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.prompt-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
}

.prompt-card-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-main);
}

.prompt-card-actions {
  display: flex;
  gap: 8px;
}

.prompt-card-content {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-secondary);
  white-space: pre-wrap;
  word-break: break-word;
}
