/* ============================================================
   FreeAPI 开放平台 — 马卡龙企业风主题 v2
   配色：柔粉 #FFB5C2 / 薰衣草紫 #C5B4E3 / 天空蓝 #A8D8EA / 薄荷绿 #B5EAD7 / 珊瑚橙 #FFD3B6
   底色：#FFF8F9 (暖白)
   ============================================================ */

:root {
  --primary: #B388EB;
  --primary-dark: #9B6FD4;
  --primary-light: #D4C4F5;
  --accent: #FFB5C2;
  --accent-dark: #FF8FA0;
  --success: #7DCEA0;
  --warning: #F7DC6F;
  --danger: #FF8A80;
  --info: #81C4E8;
  --surface: #FFFFFF;
  --bg: #FFF8F9;
  --bg-alt: #FFF0F2;
  --text: #4A4A6A;
  --text-secondary: #7C7C9A;
  --text-muted: #B5B5CC;
  --border: #F0E6ED;
  --border-light: #F5EDF2;
  --shadow-sm: 0 1px 3px rgba(179, 136, 235, 0.06);
  --shadow: 0 2px 12px rgba(179, 136, 235, 0.10);
  --shadow-lg: 0 8px 32px rgba(179, 136, 235, 0.12);
  --shadow-xl: 0 16px 48px rgba(179, 136, 235, 0.18);
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 22px;
  --sidebar-width: 250px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

body.no-scroll { overflow: hidden; }

a { text-decoration: none; color: var(--primary); transition: color 0.2s; }
a:hover { color: var(--primary-dark); }

img { max-width: 100%; height: auto; }

/* ===== Landing Page Nav ===== */
.landing-nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 2002;
  background: rgba(255, 248, 249, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}
.landing-nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 clamp(16px, 4vw, 32px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.landing-nav .logo {
  display: flex; align-items: center; gap: 10px;
  font-weight: 700; font-size: clamp(16px, 2vw, 18px); color: var(--text);
}
.landing-nav .logo .logo-box {
  width: 32px; height: 32px;
  background: linear-gradient(135deg, #C5B4E3, #FFB5C2);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 14px; font-weight: 700;
}
.nav-links-desktop {
  display: flex; align-items: center; gap: clamp(12px, 2vw, 24px);
}
.nav-links-desktop a {
  font-size: clamp(12px, 1.2vw, 13px);
  font-weight: 500;
  color: var(--text-secondary);
  transition: color 0.2s;
}
.nav-links-desktop a:hover { color: var(--text); }

/* ===== Announcement Bar (导航栏下方头部条) ===== */
.announcement-bar {
  background: linear-gradient(135deg, #C5B4E3, #B388EB);
  position: fixed;
  top: 64px;
  left: 0;
  right: 0;
  z-index: 2001;
}
.announcement-bar-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: #fff;
}
.announcement-bar-icon {
  flex-shrink: 0;
  font-size: 14px;
  opacity: 0.9;
}
.announcement-bar-scroll-wrap {
  flex: 1;
  overflow: hidden;
  position: relative;
  height: 20px;
  line-height: 20px;
}
.announcement-bar-text {
  display: inline-block;
  white-space: nowrap;
  animation: announce-scroll 20s linear infinite;
  padding-right: 60px;
}
.announcement-bar-text:hover {
  animation-play-state: paused;
}
@keyframes announce-scroll {
  0% { transform: translateX(100%); }
  8% { transform: translateX(0); }
  92% { transform: translateX(0); }
  100% { transform: translateX(-100%); }
}
.announcement-bar-close {
  flex-shrink: 0;
  background: rgba(255,255,255,0.15);
  border: none;
  color: #fff;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  line-height: 1;
}
.announcement-bar-close:hover { background: rgba(255,255,255,0.3); }

/* ===== Hero ===== */
.hero-section {
  padding: clamp(148px, 16vw, 188px) clamp(16px, 4vw, 32px) clamp(70px, 8vw, 100px);
  text-align: center;
  background: linear-gradient(165deg, #FFF8F9 0%, #FFF0F2 30%, #F5EAF8 60%, #E8F0FA 100%);
  position: relative; overflow: hidden;
}
.hero-section::before {
  content: '';
  position: absolute;
  top: -200px; left: -150px;
  width: 500px; height: 500px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(197, 180, 227, 0.15) 0%, transparent 70%);
}
.hero-section::after {
  content: '';
  position: absolute;
  bottom: -150px; right: -100px;
  width: 400px; height: 400px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 181, 194, 0.10) 0%, transparent 70%);
}
.hero-content {
  max-width: clamp(600px, 60vw, 720px);
  margin: 0 auto;
  position: relative; z-index: 1;
}
.hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: clamp(4px, 0.8vw, 6px) clamp(12px, 2vw, 18px);
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(197, 180, 227, 0.15), rgba(255, 181, 194, 0.12));
  border: 1px solid rgba(197, 180, 227, 0.20);
  color: var(--primary-dark);
  font-size: clamp(11px, 1.1vw, 13px);
  font-weight: 600;
  margin-bottom: clamp(20px, 3vw, 28px);
}
.hero-badge .dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #7DCEA0;
  animation: pulse-dot 2s ease-in-out infinite;
}
@keyframes pulse-dot { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }
.hero-section h1 {
  font-size: clamp(30px, 5.5vw, 52px);
  font-weight: 800;
  color: var(--text);
  margin-bottom: clamp(12px, 2vw, 18px);
  letter-spacing: -0.02em;
  line-height: 1.15;
}
.hero-section h1 .gradient {
  background: linear-gradient(135deg, #C5B4E3, #FFB5C2);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-section p {
  font-size: clamp(14px, 1.8vw, 17px);
  color: var(--text-secondary);
  line-height: 1.7;
  max-width: 520px;
  margin: 0 auto clamp(24px, 4vw, 36px);
}
.hero-actions {
  display: flex; gap: clamp(8px, 1.5vw, 14px);
  justify-content: center; flex-wrap: wrap;
}
.hero-actions .btn {
  padding: clamp(12px, 1.5vw, 14px) clamp(24px, 4vw, 36px);
  font-size: clamp(14px, 1.3vw, 15px);
  font-weight: 600;
}
.hero-stats {
  display: flex; justify-content: center;
  gap: clamp(24px, 5vw, 48px);
  margin-top: clamp(36px, 6vw, 56px);
  flex-wrap: wrap;
}
.hero-stats .stat { text-align: center; }
.hero-stats .stat .num {
  font-size: clamp(24px, 3.5vw, 30px);
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}
.hero-stats .stat .label {
  font-size: clamp(11px, 1vw, 13px);
  color: var(--text-muted);
  margin-top: 2px;
}

/* ===== Search ===== */
.search-section {
  max-width: 800px;
  margin: -30px auto 0;
  padding: 0 clamp(16px, 4vw, 24px);
  position: relative; z-index: 2;
}
.search-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 6px;
  display: flex; align-items: center; gap: 8px;
  box-shadow: 0 4px 24px rgba(179, 136, 235, 0.08);
}
.search-box input {
  flex: 1; border: none; outline: none;
  padding: clamp(10px, 1.2vw, 14px) clamp(12px, 2vw, 18px);
  font-size: clamp(14px, 1.3vw, 15px);
  color: var(--text);
  background: transparent;
}
.search-box input::placeholder { color: var(--text-muted); }
.search-box .search-btn {
  padding: clamp(8px, 1vw, 12px) clamp(16px, 3vw, 28px);
  background: linear-gradient(135deg, #C5B4E3, #FFB5C2);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: clamp(13px, 1.2vw, 14px);
  font-weight: 500;
  cursor: pointer;
  transition: opacity 0.2s;
  white-space: nowrap;
}
.search-box .search-btn:hover { opacity: 0.85; }
.search-tags {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin-top: 14px;
  align-items: center;
}
.search-tags .label {
  font-size: clamp(11px, 1vw, 12px);
  color: var(--text-secondary);
  margin-right: 4px;
}
.search-tags .tag {
  padding: clamp(3px, 0.5vw, 5px) clamp(10px, 1.5vw, 14px);
  border-radius: 16px;
  font-size: clamp(11px, 1vw, 12px);
  background: var(--surface);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
  border: 1px solid var(--border);
}
.search-tags .tag:hover { border-color: var(--primary); color: var(--primary); }
.search-tags .tag.active { background: linear-gradient(135deg, #C5B4E3, #D4C4F5); color: #fff; border-color: transparent; }

/* ===== API Grid ===== */
.api-list-section {
  max-width: 900px;
  margin: clamp(24px, 5vw, 40px) auto clamp(40px, 8vw, 60px);
  padding: 0 clamp(16px, 4vw, 24px);
}
.api-list-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: clamp(14px, 2vw, 20px);
  flex-wrap: wrap; gap: 12px;
}
.api-list-header h2 {
  font-size: clamp(18px, 2.5vw, 22px);
  font-weight: 700;
  color: var(--text);
}
.api-list-header .count {
  font-size: clamp(12px, 1.2vw, 14px);
  color: var(--text-secondary);
}
.api-grid { display: grid; gap: 12px; }
.api-item {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: clamp(16px, 2vw, 22px) clamp(16px, 2.5vw, 24px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  cursor: pointer;
  transition: all 0.25s ease;
}
.api-item:hover {
  border-color: var(--primary);
  box-shadow: 0 4px 20px rgba(179, 136, 235, 0.08);
  transform: translateY(-1px);
}
.api-item .api-left { display: flex; align-items: center; gap: clamp(12px, 2vw, 16px); flex: 1; min-width: 0; }
.api-item .api-method {
  width: clamp(40px, 5vw, 48px);
  height: clamp(28px, 3.5vw, 32px);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: clamp(10px, 1.1vw, 11px);
  font-weight: 700;
  flex-shrink: 0;
}
.api-item .api-method.get { background: #E6F9F2; color: #6BBF8A; }
.api-item .api-method.post { background: #E8F4FD; color: #6BB5D9; }
.api-item .api-info { flex: 1; min-width: 0; }
.api-item .api-info .name {
  font-size: clamp(13px, 1.3vw, 14px);
  font-weight: 600;
  color: var(--text);
}
.api-item .api-info .path {
  font-size: clamp(11px, 1.1vw, 12px);
  color: var(--text-muted);
  font-family: 'SF Mono', 'Fira Code', monospace;
  margin-top: 2px;
}
.api-item .api-right {
  display: flex; align-items: center; gap: clamp(8px, 1.5vw, 14px);
  flex-shrink: 0;
}
.api-item .api-quota {
  font-size: clamp(11px, 1vw, 12px);
  color: var(--text-secondary);
  white-space: nowrap;
}
.api-type-tag {
  padding: clamp(2px, 0.4vw, 4px) clamp(8px, 1vw, 12px);
  border-radius: 16px;
  font-size: clamp(10px, 1vw, 11px);
  font-weight: 600;
}
.api-type-tag.local { background: #E8F4FD; color: #81C4E8; }
.api-type-tag.proxy { background: #EDE8FA; color: #B388EB; }

/* ===== Features ===== */
.features-section {
  max-width: 1000px;
  margin: 0 auto clamp(40px, 8vw, 80px);
  padding: 0 clamp(16px, 4vw, 24px);
}
.features-section h2 {
  text-align: center;
  font-size: clamp(20px, 3vw, 26px);
  font-weight: 700;
  margin-bottom: clamp(24px, 5vw, 40px);
  color: var(--text);
}
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(clamp(230px, 28vw, 280px), 1fr));
  gap: clamp(14px, 2vw, 20px);
}
.feature-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: clamp(22px, 3vw, 28px) clamp(20px, 2.5vw, 24px);
  border: 1px solid var(--border-light);
  text-align: center;
  transition: all 0.25s ease;
}
.feature-card:hover {
  border-color: rgba(197, 180, 227, 0.25);
  box-shadow: 0 6px 24px rgba(179, 136, 235, 0.06);
  transform: translateY(-2px);
}
.feature-card .icon-box {
  width: clamp(40px, 5vw, 48px);
  height: clamp(40px, 5vw, 48px);
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: clamp(16px, 2vw, 18px);
  margin: 0 auto clamp(12px, 2vw, 16px);
}
.feature-card .icon-box.lavender { background: linear-gradient(135deg, #F0EAF8, #EDE8FA); color: var(--primary); }
.feature-card .icon-box.pink { background: linear-gradient(135deg, #FFF0F2, #FFE8EC); color: #FFB5C2; }
.feature-card .icon-box.sky { background: linear-gradient(135deg, #E8F4FD, #F0F8FF); color: #81C4E8; }
.feature-card .icon-box.mint { background: linear-gradient(135deg, #E6F9F2, #F0FCF8); color: #7DCEA0; }
.feature-card .icon-box.peach { background: linear-gradient(135deg, #FFF5F0, #FFF0F2); color: #FFD3B6; }
.feature-card h3 {
  font-size: clamp(14px, 1.5vw, 16px);
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}
.feature-card p {
  font-size: clamp(12px, 1.2vw, 13px);
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ===== Steps ===== */
.steps-section {
  max-width: 700px;
  margin: 0 auto clamp(40px, 8vw, 80px);
  padding: 0 clamp(16px, 4vw, 24px);
}
.steps-section h2 {
  text-align: center;
  font-size: clamp(20px, 3vw, 26px);
  font-weight: 700;
  margin-bottom: clamp(24px, 5vw, 40px);
  color: var(--text);
}
.steps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(16px, 3vw, 32px);
  position: relative;
}
.steps-grid::before {
  content: '';
  position: absolute; top: 28px; left: 15%; right: 15%;
  height: 2px;
  background: linear-gradient(90deg, #C5B4E3, #FFB5C2, #FFD3B6);
  opacity: 0.3;
}
.step-card { text-align: center; position: relative; }
.step-card .step-num {
  width: 56px; height: 56px;
  line-height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, #C5B4E3, #FFB5C2);
  color: #fff;
  font-size: 20px;
  font-weight: 700;
  margin: 0 auto 16px;
  position: relative; z-index: 1;
}
.step-card h4 {
  font-size: clamp(14px, 1.5vw, 15px);
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}
.step-card p {
  font-size: clamp(12px, 1.2vw, 13px);
  color: var(--text-secondary);
}

/* ===== Docs ===== */
.docs-section {
  max-width: 800px;
  margin: 0 auto clamp(40px, 8vw, 80px);
  padding: 0 clamp(16px, 4vw, 24px);
}
.docs-section h2 {
  text-align: center;
  font-size: clamp(20px, 3vw, 26px);
  font-weight: 700;
  margin-bottom: clamp(20px, 4vw, 32px);
  color: var(--text);
}
.docs-card {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  padding: clamp(24px, 4vw, 36px);
}
.docs-card h3 {
  font-size: clamp(16px, 1.8vw, 18px);
  font-weight: 600;
  margin-bottom: 20px;
  color: var(--text);
}
.docs-block { margin-bottom: 20px; }
.docs-block:last-child { margin-bottom: 0; }
.docs-block .label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
}
.docs-block .code-block {
  background: #3A3A5C;
  color: #D4C4F5;
  padding: clamp(12px, 2vw, 16px) clamp(14px, 2.5vw, 20px);
  border-radius: var(--radius);
  font-size: clamp(12px, 1.2vw, 13px);
  font-family: 'SF Mono', 'Fira Code', monospace;
  line-height: 1.7;
  overflow-x: auto;
}
.docs-block .code-block .highlight { color: #FFB5C2; }
.docs-block .code-block .comment { color: rgba(255,255,255,0.3); }
.docs-table {
  width: 100%;
  font-size: clamp(12px, 1.2vw, 13px);
  border-collapse: collapse;
}
.docs-table th {
  text-align: left;
  padding: 10px 14px;
  background: var(--bg);
  font-weight: 600;
  font-size: clamp(11px, 1vw, 12px);
  color: var(--text-secondary);
  border-bottom: 2px solid var(--border);
}
.docs-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-light);
}
.docs-table code {
  background: rgba(179, 136, 235, 0.06);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: clamp(11px, 1.1vw, 12px);
  font-family: 'SF Mono', 'Fira Code', monospace;
  color: var(--primary-dark);
}

/* ===== CTA ===== */
.cta-section {
  max-width: 800px;
  margin: 0 auto clamp(40px, 8vw, 80px);
  padding: 0 clamp(16px, 4vw, 24px);
}
.cta-card {
  background: linear-gradient(135deg, #C5B4E3 0%, #FFB5C2 50%, #FFD3B6 100%);
  border-radius: var(--radius-xl);
  padding: clamp(36px, 8vw, 60px) clamp(24px, 4vw, 40px);
  text-align: center;
  color: #fff;
  position: relative;
  overflow: hidden;
}
.cta-card::before {
  content: '';
  position: absolute; top: -100px; right: -100px;
  width: 300px; height: 300px;
  border-radius: 50%;
  background: rgba(255,255,255,0.06);
}
.cta-card h2 {
  font-size: clamp(22px, 3.5vw, 28px);
  font-weight: 700;
  margin-bottom: clamp(8px, 1.5vw, 12px);
  position: relative; z-index: 1;
}
.cta-card p {
  font-size: clamp(14px, 1.5vw, 16px);
  opacity: 0.85;
  margin-bottom: clamp(20px, 4vw, 28px);
  position: relative; z-index: 1;
}
.cta-card .btn-cta {
  display: inline-flex; align-items: center; gap: 8px;
  padding: clamp(12px, 1.8vw, 14px) clamp(28px, 5vw, 36px);
  background: #fff;
  color: var(--primary-dark);
  border-radius: var(--radius);
  font-weight: 600;
  font-size: clamp(14px, 1.3vw, 15px);
  transition: all 0.25s ease;
  position: relative; z-index: 1;
}
.cta-card .btn-cta:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,0.10); }

/* ===== Footer（精简化，只保留版权 + 备案号） ===== */
.landing-footer {
  background: #3A3A5C;
  color: rgba(255,255,255,0.55);
  padding: 28px 24px;
  margin-top: 60px;
}
.landing-footer-inner { max-width: 1000px; margin: 0 auto; }
.landing-footer-bottom {
  text-align: center;
  font-size: 13px;
  color: rgba(255,255,255,0.35);
}
.landing-footer-bottom a {
  color: rgba(255,255,255,0.5);
  transition: color 0.2s;
}
.landing-footer-bottom a:hover { color: #fff; }

/* ===== Detail Page（独立详情页，替代弹窗） ===== */
.detail-page {
  padding-top: 124px;
  min-height: 80vh;
}
.detail-container {
  max-width: 840px;
  margin: 0 auto;
  padding: 0 clamp(16px, 4vw, 32px) 60px;
}
.detail-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 28px;
  padding-top: 20px;
}
.detail-breadcrumb a {
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.detail-breadcrumb a:hover { color: var(--primary); }
.detail-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}
.detail-header-left { flex: 1; min-width: 260px; }
.detail-method-tags {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}
.detail-method-badge {
  display: inline-flex;
  padding: 3px 12px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.3px;
}
.detail-type-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 12px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
}
.detail-type-badge.local { background: #E8F4FD; color: #81C4E8; }
.detail-type-badge.proxy { background: #EDE8FA; color: var(--primary); }
.detail-title {
  font-size: clamp(24px, 3vw, 30px);
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.03em;
  margin-bottom: 8px;
}
.detail-desc {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 14px;
  line-height: 1.6;
}
.detail-path {
  display: inline-block;
}
.detail-path code {
  background: var(--bg-alt);
  padding: 6px 14px;
  border-radius: 8px;
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 13px;
  color: var(--primary-dark);
  border: 1px solid var(--border);
}
.detail-quota-card {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px 24px;
  box-shadow: var(--shadow-sm);
  flex-shrink: 0;
}
.detail-quota-item {
  text-align: center;
  min-width: 70px;
}
.detail-quota-num {
  display: block;
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}
.detail-quota-label {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}
.detail-quota-divider {
  width: 1px;
  height: 36px;
  background: var(--border);
}
.detail-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: clamp(20px, 3vw, 28px);
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}
.detail-card-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.detail-code-block {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: #3A3A5C;
  color: #D4C4F5;
  padding: 14px 18px;
  border-radius: var(--radius);
  font-size: 13px;
  font-family: 'SF Mono', 'Fira Code', monospace;
  line-height: 1.7;
  overflow-x: auto;
}
.detail-code-block code { color: #D4C4F5; font-size: 13px; }
.detail-code-block pre { color: #D4C4F5; }
.detail-copy-btn {
  flex-shrink: 0;
  background: rgba(255,255,255,0.08);
  border: none;
  color: rgba(255,255,255,0.5);
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  transition: all 0.2s;
}
.detail-copy-btn:hover { background: rgba(255,255,255,0.15); color: #fff; }
.detail-table-wrap {
  overflow-x: auto;
}
.detail-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.detail-table th {
  text-align: left;
  padding: 10px 14px;
  background: var(--bg);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 12px;
  border-bottom: 2px solid var(--border);
}
.detail-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-light);
  color: var(--text);
}
.detail-table tr:last-child td { border-bottom: none; }
.detail-table code {
  background: var(--bg);
  padding: 2px 8px;
  border-radius: 4px;
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 12px;
  color: var(--primary-dark);
}
.code-sm { font-size: 12px !important; }
.auth-badge {
  display: inline-flex;
  padding: 3px 12px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
}
.auth-badge.header { background: #EDE8FA; color: var(--primary); }
.auth-badge.url { background: #E6F9F2; color: #6BBF8A; }
.detail-badge {
  display: inline-flex;
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
}
.detail-badge.type { background: var(--bg); color: var(--text-secondary); }
.detail-badge.required { background: #FDECEC; color: #FF8A80; }
.detail-badge.optional { background: #E6F9F2; color: #6BBF8A; }
.detail-cta {
  display: flex;
  gap: 12px;
  margin-top: 36px;
  flex-wrap: wrap;
}
.detail-footer { margin-top: 0 !important; }

/* ===== Buttons ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 6px;
  padding: 10px 22px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  line-height: 1.4;
}
.btn-primary { background: linear-gradient(135deg, #C5B4E3, #B388EB); color: #fff; }
.btn-primary:hover { opacity: 0.9; color: #fff; }
.btn-outline { background: transparent; color: var(--primary); border: 1.5px solid var(--primary); }
.btn-outline:hover { background: rgba(179, 136, 235, 0.06); }
.btn-success { background: linear-gradient(135deg, #7DCEA0, #B5EAD7); color: #fff; }
.btn-success:hover { opacity: 0.9; color: #fff; }
.btn-danger { background: linear-gradient(135deg, #FF8A80, #FFB5C2); color: #fff; }
.btn-danger:hover { opacity: 0.9; color: #fff; }
.btn-ghost { background: transparent; color: var(--text-secondary); border: 1.5px solid var(--border); }
.btn-ghost:hover { background: var(--bg); color: var(--text); }
.btn-sm { padding: 6px 14px; font-size: 12px; border-radius: 8px; }
.btn-block { width: 100%; }

/* ===== Badge ===== */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 11px; font-weight: 600;
}
.badge-success { background: #E6F9F2; color: #6BBF8A; }
.badge-danger { background: #FDECEC; color: #FF8A80; }
.badge-warning { background: #FEF5E0; color: #D4A84B; }
.badge-info { background: #E8F4FD; color: #81C4E8; }
.badge-primary { background: #EDE8FA; color: var(--primary); }

/* ===== Alert ===== */
.alert {
  padding: 14px 18px; border-radius: var(--radius);
  font-size: 13px; margin-bottom: 20px;
  display: flex; align-items: center; gap: 10px;
}
.alert-success { background: #E6F9F2; color: #5A9E7A; border: 1px solid #C4F0DE; }
.alert-error { background: #FDECEC; color: #C0392B; border: 1px solid #F5D0D0; }

/* ===== Layout (admin/user) ===== */
.layout { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-width);
  background: linear-gradient(180deg, #3A3A5C 0%, #2D2D4A 100%);
  color: #fff;
  position: fixed; top: 0; left: 0; bottom: 0;
  z-index: 40;
  transition: transform 0.3s ease;
  overflow-y: auto;
}
.sidebar-header { padding: 28px 24px 20px; border-bottom: 1px solid rgba(255,255,255,0.06); }
.sidebar-header .brand { display: flex; align-items: center; gap: 10px; }
.sidebar-header .brand-icon {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, #C5B4E3, #FFB5C2);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 16px; color: #fff;
}
.sidebar-header .brand-text { font-size: 18px; font-weight: 700; letter-spacing: -0.3px; }
.sidebar-header .subtitle {
  font-size: 11px; opacity: 0.5; margin-top: 4px; margin-left: 46px;
  letter-spacing: 0.5px; text-transform: uppercase;
}
.sidebar .nav { list-style: none; padding: 16px 12px; }
.sidebar .nav li { margin-bottom: 2px; }
.sidebar .nav a {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px; border-radius: 10px;
  color: rgba(255,255,255,0.50);
  font-size: 14px; font-weight: 500;
  transition: all 0.2s;
}
.sidebar .nav a:hover { background: rgba(255,255,255,0.05); color: rgba(255,255,255,0.80); }
.sidebar .nav a.active { background: rgba(179, 136, 235, 0.25); color: #fff; font-weight: 600; }
.sidebar .nav a .icon { width: 20px; text-align: center; font-size: 15px; opacity: 0.7; }
.sidebar .nav a.active .icon { opacity: 1; }
.sidebar-footer {
  position: absolute; bottom: 0; left: 0; right: 0;
  padding: 16px 20px; border-top: 1px solid rgba(255,255,255,0.06);
}
.sidebar-footer a { color: rgba(255,255,255,0.35); font-size: 13px; display: flex; align-items: center; gap: 8px; }
.sidebar-footer a:hover { color: rgba(255,255,255,0.70); }

.main { margin-left: var(--sidebar-width); flex: 1; min-height: 100vh; }
.main-header {
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(12px);
  padding: 18px 32px;
  border-bottom: 1px solid var(--border-light);
  display: flex; justify-content: space-between; align-items: center;
  position: sticky; top: 0; z-index: 30;
}
.main-header h3 { font-size: 18px; font-weight: 600; color: var(--text); }
.main-header .user-badge {
  display: flex; align-items: center; gap: 10px;
  font-size: 13px; color: var(--text-secondary);
  position: relative;
}
.main-header .user-badge .avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: linear-gradient(135deg, #C5B4E3, #FFB5C2);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 600; font-size: 13px;
  cursor: pointer;
}
.main-body { padding: 28px 32px; }
.main-footer {
  text-align: center; padding: 20px;
  color: var(--text-muted); font-size: 12px;
  border-top: 1px solid var(--border-light);
}

/* ===== Cards (internal) ===== */
.card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 20px;
  border: 1px solid var(--border-light);
}
.card-title {
  font-size: 15px; font-weight: 600; color: var(--text);
  margin-bottom: 16px; display: flex; align-items: center; gap: 8px;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px; margin-bottom: 24px;
}
.stat-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 22px;
  border: 1px solid var(--border-light);
  position: relative;
}
.stat-card .stat-label { font-size: 12px; color: var(--text-secondary); margin-bottom: 4px; }
.stat-card .stat-value { font-size: 26px; font-weight: 700; color: var(--text); letter-spacing: -0.5px; }
.stat-card .stat-icon {
  position: absolute; right: 18px; top: 18px;
  width: 36px; height: 36px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
}
.stat-card .stat-icon.purple { background: rgba(179, 136, 235, 0.10); color: var(--primary); }
.stat-card .stat-icon.green { background: rgba(125, 206, 160, 0.10); color: var(--success); }
.stat-card .stat-icon.blue { background: rgba(129, 196, 232, 0.10); color: var(--info); }
.stat-card .stat-icon.orange { background: rgba(255, 211, 182, 0.20); color: #E8A87C; }
.stat-card .stat-icon.pink { background: rgba(255, 181, 194, 0.15); color: var(--danger); }

/* ===== Tables ===== */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
table th {
  background: var(--bg); padding: 10px 14px;
  text-align: left; font-weight: 600;
  font-size: 11px; letter-spacing: 0.5px;
  color: var(--text-secondary);
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
}
table td { padding: 10px 14px; border-bottom: 1px solid var(--border-light); color: var(--text); }
table tr:hover td { background: var(--bg); }
table code {
  background: var(--bg); padding: 2px 8px; border-radius: 4px;
  font-size: 12px;
  font-family: 'SF Mono', 'Fira Code', monospace;
  color: var(--primary-dark);
}

/* ===== Forms ===== */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; font-weight: 500; color: var(--text); margin-bottom: 6px; }
.form-group input, .form-group select, .form-group textarea {
  width: 100%; padding: 10px 14px;
  border: 1.5px solid var(--border); border-radius: 10px;
  font-size: 14px; color: var(--text); background: var(--surface); outline: none;
  transition: all 0.2s;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  border-color: var(--primary); box-shadow: 0 0 0 3px rgba(179, 136, 235, 0.08);
}

/* ===== Auth ===== */
.auth-page {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #FFF8F9 0%, #FFF0F2 100%);
  padding: 20px; position: relative; overflow: hidden;
}
.auth-page::before {
  content: '';
  position: absolute;
  top: -200px; right: -200px;
  width: 500px; height: 500px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(197, 180, 227, 0.08) 0%, transparent 70%);
}
.auth-card {
  background: rgba(255,255,255,0.90);
  backdrop-filter: blur(20px);
  border-radius: var(--radius-xl);
  padding: 44px 40px;
  width: 100%; max-width: 420px;
  border: 1px solid rgba(255,255,255,0.5);
  box-shadow: var(--shadow-xl);
  position: relative; z-index: 1;
}
.auth-card .logo { text-align: center; margin-bottom: 32px; }
.auth-card .logo .brand-box {
  width: 56px; height: 56px;
  background: linear-gradient(135deg, #C5B4E3, #FFB5C2);
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; font-weight: 700; color: #fff;
  margin: 0 auto 16px;
}
.auth-card .logo h1 { font-size: 22px; font-weight: 700; color: var(--text); }
.auth-card .logo p { font-size: 13px; color: var(--text-secondary); margin-top: 4px; }
.auth-card .form-group { margin-bottom: 20px; }
.auth-card .form-group input {
  padding: 12px 16px; border-radius: var(--radius);
  border: 1.5px solid var(--border); font-size: 14px; background: #fff;
}
.auth-card .form-group input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(179, 136, 235, 0.08); }
.auth-card .auth-footer { text-align: center; margin-top: 24px; font-size: 14px; color: var(--text-secondary); }
.auth-card .auth-footer a { font-weight: 600; }

/* ===== Mobile Toggle ===== */
.mobile-toggle {
  display: none;
  background: none; border: none;
  font-size: 22px; cursor: pointer;
  color: var(--text); padding: 4px; line-height: 1;
}
.sidebar-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.4); z-index: 35;
}
.sidebar-overlay.show { display: block; }

/* ===== Dropdown menu ===== */
.dropdown-menu {
  display: none;
  position: absolute; top: 100%; right: 0;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  min-width: 160px; padding: 4px;
  z-index: 100; margin-top: 6px;
}
.dropdown-menu.show { display: block; }
.dropdown-menu a {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px; font-size: 13px; color: var(--text);
  border-radius: 8px; transition: background 0.2s;
}
.dropdown-menu a:hover { background: var(--bg); }

/* ===== Responsive ===== */
@media (max-width: 768px) {
  html, body { overflow-x: hidden; }
  .main { overflow-x: hidden; }
  .main-body { overflow-x: hidden; }
  .main-body > * { max-width: 100% !important; }
  .mobile-toggle { display: block; }
  .hamburger-btn { display: flex; }
  .sidebar { transform: translateX(-100%); width: 280px; }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0; }
  .main-body { padding: 20px 16px; }
  .main-header { padding: 14px 20px; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .stat-card { padding: 18px; }
  .stat-card .stat-value { font-size: 22px; }
  .auth-card { padding: 32px 24px; }
  .search-box { flex-direction: column; align-items: stretch; }
  .search-box .search-btn { width: 100%; justify-content: center; }
  .api-item { flex-direction: column; align-items: flex-start; gap: 10px; }
  .api-item .api-left { width: 100%; min-width: unset; }
  .api-item .api-right { width: 100%; justify-content: flex-start; flex-wrap: wrap; gap: 8px; }
  .api-item .api-method { min-width: unset; }
  .steps-grid::before { display: none; }
  .steps-grid { grid-template-columns: 1fr; gap: 24px; }
  .hero-stats .divider { display: none; }
  .search-tags { overflow-x: auto; flex-wrap: nowrap; padding-bottom: 6px; }
  .table-wrap { margin: 0 -16px; padding: 0 16px; }
  .table-wrap table { font-size: 12px; }
  .table-wrap table th, .table-wrap table td { white-space: nowrap; padding: 8px 10px; }
  .detail-header { flex-direction: column; gap: 20px; }
  .detail-quota-card { width: 100%; justify-content: space-around; }
  .detail-path code { font-size: 12px; word-break: break-all; }
}

@media (max-width: 480px) {
  .stat-grid { grid-template-columns: 1fr; }
  .hero-section { padding: 100px 16px 60px; }
  .hero-stats { gap: 16px; }
  .hero-stats .stat .num { font-size: 20px; }
  .features-grid { grid-template-columns: 1fr; }
  .landing-nav-inner { padding: 0 12px; }
  .card { padding: 16px; }
  .main-body { padding: 14px 12px; }
  .sidebar { width: 260px; }
  .main-header h3 { font-size: 15px; }
  .docs-card { padding: 16px; }
  .api-item .api-left { gap: 10px; }
  .detail-breadcrumb { font-size: 12px; }
  .detail-title { font-size: 22px; }
  .detail-quota-card { padding: 14px 20px; }
}

/* ===== Responsive global overflow fix ===== */
html, body { overflow-x: hidden; }

@media (max-width: 768px) {
  .mobile-toggle { display: block; }
  .hamburger-btn { display: flex; }
  .sidebar { transform: translateX(-100%); width: 280px; }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0; overflow-x: hidden; }
  .main-body { padding: 20px 16px; overflow-x: hidden; }
  .main-body > * { max-width: 100% !important; }
  .main-header { padding: 14px 20px; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .stat-card { padding: 18px; }
  .stat-card .stat-value { font-size: 22px; }
  .auth-card { padding: 32px 24px; }
  .search-box { flex-direction: column; align-items: stretch; }
  .search-box .search-btn { width: 100%; justify-content: center; }
  .api-item { flex-direction: column; align-items: flex-start; }
  .api-item .api-right { width: 100%; justify-content: space-between; }
  .steps-grid::before { display: none; }
  .steps-grid { grid-template-columns: 1fr; gap: 24px; }
  .hero-stats .divider { display: none; }
  .search-tags { overflow-x: auto; flex-wrap: nowrap; padding-bottom: 6px; -webkit-overflow-scrolling: touch; }
  .table-wrap { margin: 0 -16px; padding: 0 16px; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .table-wrap table { font-size: 12px; min-width: 500px; }
  .table-wrap table th, .table-wrap table td { white-space: nowrap; padding: 8px 10px; }
  .form-inline { flex-direction: column !important; }
  .form-inline .form-group { min-width: 100% !important; flex: 1 0 100% !important; }
  .user-badge span { font-size: 12px; }
  .card { padding: 16px; overflow-x: hidden; }
  .card .table-wrap { margin: 0 -16px; padding: 0 16px; }
  .docs-block .code-block { word-break: break-all; white-space: pre-wrap; }
  .detail-header { flex-direction: column; gap: 20px; }
  .detail-quota-card { width: 100%; justify-content: space-around; }
  .detail-path code { font-size: 12px; word-break: break-all; }
}

@media (max-width: 480px) {
  .stat-grid { grid-template-columns: 1fr; }
  .hero-section { padding: 100px 16px 60px; }
  .hero-stats { gap: 16px; }
  .hero-stats .stat .num { font-size: 20px; }
  .features-grid { grid-template-columns: 1fr; }
  .landing-nav-inner { padding: 0 12px; }
  .card { padding: 16px; }
  .main-body { padding: 14px 12px; }
  .sidebar { width: 260px; }
  .main-header h3 { font-size: 15px; }
  .docs-card { padding: 16px; }
  .api-item .api-left { gap: 10px; }
}

/* ===== Utility ===== */
.flex, .flex-between { display: flex; align-items: center; }
.flex-between { justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 16px; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.text-center { text-align: center; }
.text-muted { color: var(--text-secondary); font-size: 13px; }