/* 汽车音响 - 全局样式 */
:root {
  --accent-color: #00bcd4;
  --primary-color: #1a1a2e;
  --secondary-color: #16213e;
  --text-color: #333;
  --text-light: #666;
  --text-muted: #999;
  --bg-color: #f5f7fa;
  --bg-white: #fff;
  --border-color: #e8ecf1;
  --success-color: #28a745;
  --warning-color: #ffc107;
  --error-color: #dc3545;
  --shadow: 0 2px 8px rgba(0,0,0,0.08);
  --shadow-hover: 0 4px 16px rgba(0,0,0,0.12);
  --radius: 8px;
  --radius-sm: 4px;
  --max-width: 1200px;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-color);
  background: var(--bg-color);
}

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

a:hover {
  text-decoration: underline;
}

/* 头部 */
.header {
  background: var(--primary-color);
  color: #fff;
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-logo {
  font-size: 20px;
  font-weight: 600;
  color: #fff;
}

.header-logo span {
  color: var(--accent-color);
}

.header-nav {
  display: flex;
  gap: 32px;
}

.header-nav a {
  color: rgba(255,255,255,0.8);
  font-size: 14px;
  transition: color 0.2s;
}

.header-nav a:hover {
  color: #fff;
  text-decoration: none;
}

.header-search {
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-search input {
  padding: 8px 16px;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.1);
  color: #fff;
  width: 240px;
  font-size: 14px;
}

.header-search input::placeholder {
  color: rgba(255,255,255,0.5);
}

.header-search button {
  padding: 8px 16px;
  background: var(--accent-color);
  border: none;
  border-radius: var(--radius-sm);
  color: #fff;
  cursor: pointer;
  font-size: 14px;
}

/* 主体容器 */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 32px 24px;
}

/* Hero 区域 */
.hero {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
  color: #fff;
  padding: 64px 24px;
  text-align: center;
  border-radius: var(--radius);
  margin-bottom: 32px;
}

.hero h1 {
  font-size: 36px;
  font-weight: 600;
  margin-bottom: 16px;
}

.hero p {
  font-size: 18px;
  color: rgba(255,255,255,0.8);
  margin-bottom: 24px;
}

.hero-meta {
  display: inline-flex;
  gap: 24px;
  padding: 12px 24px;
  background: rgba(255,255,255,0.1);
  border-radius: var(--radius);
  font-size: 14px;
}

.hero-meta span {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* 快速开始 */
.quick-start {
  background: var(--bg-white);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 32px;
  box-shadow: var(--shadow);
}

.quick-start h2 {
  font-size: 18px;
  margin-bottom: 16px;
  color: var(--primary-color);
}

.code-block {
  background: #1e1e2e;
  color: #a6accd;
  padding: 16px;
  border-radius: var(--radius-sm);
  font-family: 'Consolas', 'Monaco', monospace;
  font-size: 13px;
  overflow-x: auto;
}

.code-block .comment {
  color: #676e95;
}

/* 卡片网格 */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  margin-bottom: 32px;
}

.card {
  background: var(--bg-white);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  transition: box-shadow 0.2s, transform 0.2s;
}

.card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}

.card h3 {
  font-size: 16px;
  color: var(--primary-color);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.card p {
  color: var(--text-light);
  font-size: 14px;
  line-height: 1.6;
}

/* 端点列表 */
.endpoint-list {
  background: var(--bg-white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 32px;
}

.endpoint-item {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: flex-start;
  gap: 16px;
  transition: background 0.2s;
}

.endpoint-item:last-child {
  border-bottom: none;
}

.endpoint-item:hover {
  background: var(--bg-color);
}

.endpoint-method {
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  min-width: 64px;
  text-align: center;
}

.endpoint-method.get {
  background: #e3f2fd;
  color: #1976d2;
}

.endpoint-method.post {
  background: #e8f5e9;
  color: #388e3c;
}

.endpoint-method.put {
  background: #fff3e0;
  color: #f57c00;
}

.endpoint-method.delete {
  background: #ffebee;
  color: #d32f2f;
}

.endpoint-info {
  flex: 1;
}

.endpoint-path {
  font-family: 'Consolas', monospace;
  font-size: 14px;
  color: var(--primary-color);
  font-weight: 500;
  margin-bottom: 4px;
}

.endpoint-desc {
  font-size: 13px;
  color: var(--text-light);
}

.endpoint-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.endpoint-tag {
  padding: 4px 10px;
  background: var(--bg-color);
  border-radius: var(--radius-sm);
  font-size: 12px;
  color: var(--text-muted);
}

/* 面包屑 */
.breadcrumb {
  background: var(--bg-white);
  padding: 16px 24px;
  border-radius: var(--radius);
  margin-bottom: 24px;
  box-shadow: var(--shadow);
  font-size: 14px;
}

.breadcrumb a {
  color: var(--text-light);
}

.breadcrumb a:hover {
  color: var(--accent-color);
}

.breadcrumb span {
  color: var(--text-muted);
  margin: 0 8px;
}

.breadcrumb strong {
  color: var(--text-color);
  font-weight: 500;
}

/* 页面标题 */
.page-header {
  margin-bottom: 32px;
}

.page-header h1 {
  font-size: 28px;
  color: var(--primary-color);
  margin-bottom: 8px;
}

.page-header p {
  color: var(--text-light);
  font-size: 16px;
}

/* 参数表格 */
.params-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 24px;
}

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

.params-table th {
  background: var(--bg-color);
  font-weight: 600;
  color: var(--primary-color);
  font-size: 13px;
  text-transform: uppercase;
}

.params-table td {
  font-size: 14px;
}

.params-table code {
  background: #f0f4f8;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  font-family: 'Consolas', monospace;
  font-size: 13px;
}

.params-table .required {
  color: var(--error-color);
  font-size: 12px;
}

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

/* 响应区域 */
.response-section {
  background: var(--bg-white);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow);
}

.response-section h3 {
  font-size: 16px;
  color: var(--primary-color);
  margin-bottom: 16px;
}

.response-status {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.status-code {
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
}

.status-code.success {
  background: #e8f5e9;
  color: var(--success-color);
}

.status-code.error {
  background: #ffebee;
  color: var(--error-color);
}

/* 文章列表 */
.article-list {
  background: var(--bg-white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 32px;
}

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

.article-item:last-child {
  border-bottom: none;
}

.article-title {
  font-size: 16px;
  color: var(--primary-color);
  margin-bottom: 4px;
}

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

.article-tag {
  display: inline-block;
  padding: 4px 12px;
  background: var(--bg-color);
  border-radius: var(--radius-sm);
  font-size: 12px;
  color: var(--accent-color);
}

/* 三栏文章区 */
.articles-section {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-bottom: 32px;
}

.articles-column {
  background: var(--bg-white);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}

.articles-column h3 {
  font-size: 16px;
  color: var(--primary-color);
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--accent-color);
}

.articles-column ul {
  list-style: none;
}

.articles-column li {
  padding: 10px 0;
  border-bottom: 1px solid var(--border-color);
}

.articles-column li:last-child {
  border-bottom: none;
}

.articles-column a {
  color: var(--text-color);
  display: block;
}

.articles-column a:hover {
  color: var(--accent-color);
}

/* 推荐文章 */
.recommended-section {
  background: var(--bg-white);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 32px;
  box-shadow: var(--shadow);
}

.recommended-section h3 {
  font-size: 16px;
  color: var(--primary-color);
  margin-bottom: 16px;
}

.recommended-list {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
}

.recommended-list a {
  color: var(--text-color);
  padding: 8px 16px;
  background: var(--bg-color);
  border-radius: var(--radius-sm);
  font-size: 14px;
}

.recommended-list a:hover {
  background: var(--accent-color);
  color: #fff;
  text-decoration: none;
}

/* 两栏布局 */
.two-column {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 32px;
}

/* 文章内容 */
.article-content {
  background: var(--bg-white);
  border-radius: var(--radius);
  padding: 40px;
  box-shadow: var(--shadow);
  margin-bottom: 32px;
}

.article-content h1 {
  font-size: 28px;
  color: var(--primary-color);
  margin-bottom: 16px;
}

.article-content h2 {
  font-size: 22px;
  color: var(--primary-color);
  margin: 32px 0 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-color);
}

.article-content h3 {
  font-size: 18px;
  color: var(--primary-color);
  margin: 24px 0 12px;
}

.article-content p {
  margin-bottom: 16px;
  line-height: 1.8;
  color: var(--text-color);
}

.article-content ul,
.article-content ol {
  margin-bottom: 16px;
  padding-left: 24px;
}

.article-content li {
  margin-bottom: 8px;
}

.article-content code {
  background: #f0f4f8;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  font-family: 'Consolas', monospace;
  font-size: 14px;
}

.article-content pre {
  background: #1e1e2e;
  color: #a6accd;
  padding: 20px;
  border-radius: var(--radius);
  overflow-x: auto;
  margin-bottom: 16px;
}

.article-content pre code {
  background: none;
  padding: 0;
}

/* 404 页面 */
.error-page {
  text-align: center;
  padding: 80px 24px;
}

.error-code {
  font-size: 120px;
  font-weight: 700;
  color: var(--accent-color);
  line-height: 1;
  margin-bottom: 24px;
}

.error-title {
  font-size: 28px;
  color: var(--primary-color);
  margin-bottom: 16px;
}

.error-desc {
  font-size: 16px;
  color: var(--text-light);
  margin-bottom: 32px;
}

.error-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
}

.btn {
  display: inline-block;
  padding: 12px 24px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
}

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

.btn-primary:hover {
  background: #00acc1;
  text-decoration: none;
}

.btn-secondary {
  background: var(--bg-white);
  color: var(--text-color);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background: var(--bg-color);
  text-decoration: none;
}

/* 页脚 */
.footer {
  background: var(--primary-color);
  color: rgba(255,255,255,0.8);
  padding: 40px 24px;
  text-align: center;
}

.footer-content {
  max-width: var(--max-width);
  margin: 0 auto;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 32px;
  margin-bottom: 24px;
}

.footer-links a {
  color: rgba(255,255,255,0.8);
  font-size: 14px;
}

.footer-links a:hover {
  color: #fff;
  text-decoration: none;
}

.footer-copyright {
  font-size: 13px;
  color: rgba(255,255,255,0.5);
}

/* 响应式设计 */
@media (max-width: 1024px) {
  .articles-section {
    grid-template-columns: 1fr;
  }

  .two-column {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .header {
    flex-wrap: wrap;
    height: auto;
    padding: 16px;
    gap: 16px;
  }

  .header-nav {
    order: 3;
    width: 100%;
    justify-content: center;
    gap: 20px;
  }

  .header-search {
    flex: 1;
  }

  .header-search input {
    width: 100%;
  }

  .hero h1 {
    font-size: 24px;
  }

  .hero-meta {
    flex-direction: column;
    gap: 8px;
  }

  .container {
    padding: 16px;
  }

  .card-grid {
    grid-template-columns: 1fr;
  }

  .endpoint-item {
    flex-direction: column;
    gap: 12px;
  }

  .article-content {
    padding: 24px;
  }

  .error-code {
    font-size: 80px;
  }

  .footer-links {
    flex-direction: column;
    gap: 16px;
  }
}
