/* ========================================
   tpl/default 模板专用样式
   MDUI 商业化风格
   ======================================== */

/* 全局重置 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  color: #333;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ========================================
   顶部导航
   ======================================== */
.tpl-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 64px;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(10px);
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.08);
  z-index: 1000;
}

.tpl-header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.tpl-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: #333;
}

.tpl-logo .mdui-icon {
  font-size: 28px;
  color: #667eea;
}

.tpl-logo span {
  font-size: 20px;
  font-weight: 700;
  background: linear-gradient(135deg, #667eea, #764ba2);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.tpl-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tpl-nav-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 8px;
  text-decoration: none;
  color: #606266;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.3s ease;
}

.tpl-nav-item:hover {
  background: rgba(102, 126, 234, 0.1);
  color: #667eea;
}

.tpl-nav-item.active {
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: #fff;
}

.tpl-nav-item .mdui-icon {
  font-size: 18px;
}

/* ========================================
   英雄区域
   ======================================== */
.tpl-hero {
  position: relative;
  padding: 140px 24px 80px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  overflow: hidden;
}

.tpl-hero-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.hero-shape {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
}

.hero-shape-1 {
  width: 400px;
  height: 400px;
  top: -100px;
  right: -50px;
  animation: float 8s ease-in-out infinite;
}

.hero-shape-2 {
  width: 300px;
  height: 300px;
  bottom: -50px;
  left: -50px;
  animation: float 10s ease-in-out infinite reverse;
}

.hero-shape-3 {
  width: 200px;
  height: 200px;
  top: 50%;
  left: 30%;
  animation: float 6s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-20px) rotate(5deg); }
}

.tpl-hero-content {
  position: relative;
  z-index: 1;
  max-width: 700px;
  margin: 0 auto;
  text-align: center;
}

.hero-title {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-size: 48px;
  font-weight: 800;
  color: #fff;
  margin-bottom: 16px;
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.hero-title .mdui-icon {
  font-size: 48px;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

.hero-subtitle {
  font-size: 20px;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 20px;
}

.hero-stats {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}

.stat-item {
  display: flex;
  align-items: center;
  gap: 8px;
  color: rgba(255, 255, 255, 0.9);
  font-size: 15px;
}

.stat-item .mdui-icon {
  font-size: 18px;
}

.stat-item strong {
  color: #fff;
  font-weight: 700;
}

.stat-divider {
  color: rgba(255, 255, 255, 0.5);
}

/* 搜索框 */
.tpl-search-wraper {
  max-width: 500px;
  margin: 0 auto;
}

.tpl-search-box {
  display: flex;
  align-items: center;
  background: #fff;
  border-radius: 50px;
  padding: 8px 24px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  transition: all 0.3s ease;
}

.tpl-search-box:focus-within {
  box-shadow: 0 15px 50px rgba(0, 0, 0, 0.3);
  transform: translateY(-2px);
}

.tpl-search-box .search-icon {
  font-size: 24px;
  color: #909399;
  margin-right: 12px;
}

.tpl-search-input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 16px;
  background: transparent;
  color: #333;
}

.tpl-search-input::placeholder {
  color: #c0c4cc;
}

.tpl-search-box .clear-icon {
  font-size: 20px;
  color: #c0c4cc;
  cursor: pointer;
  transition: color 0.2s;
}

.tpl-search-box .clear-icon:hover {
  color: #909399;
}

/* ========================================
   内容区域
   ======================================== */
.tpl-content {
  padding: 40px 24px 80px;
  background: #f5f7fa;
  min-height: 60vh;
}

.tpl-content .container {
  max-width: 1200px;
  margin: 0 auto;
}

.security-tip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 24px;
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.1), rgba(118, 75, 162, 0.1));
  border-radius: 12px;
  margin-bottom: 30px;
  color: #667eea;
  font-size: 14px;
  font-weight: 500;
}

.security-tip .mdui-icon {
  font-size: 18px;
}

/* ========================================
   API卡片网格
   ======================================== */
.api-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
}

.api-card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
  text-decoration: none;
  transition: all 0.3s ease;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
  border: 1px solid transparent;
}

.api-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 40px rgba(102, 126, 234, 0.15);
  border-color: rgba(102, 126, 234, 0.3);
}

.api-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: linear-gradient(135deg, #667eea, #764ba2);
}

.api-method {
  padding: 4px 12px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  color: #fff;
}

.api-calls {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.9);
}

.api-calls .mdui-icon {
  font-size: 16px;
}

.api-card-body {
  padding: 20px;
  flex: 1;
}

.api-title {
  font-size: 18px;
  font-weight: 700;
  color: #303133;
  margin-bottom: 10px;
}

.api-desc {
  font-size: 14px;
  color: #909399;
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.api-card-footer {
  padding: 14px 20px;
  border-top: 1px solid #f0f2f5;
}

.api-link {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: #667eea;
  font-weight: 500;
}

.api-link .mdui-icon {
  font-size: 16px;
  transition: transform 0.2s;
}

.api-card:hover .api-link .mdui-icon {
  transform: translateX(4px);
}

/* ========================================
   页脚
   ======================================== */
.tpl-footer {
  background: #1a1a2e;
  color: #fff;
}

.tpl-footer-main {
  padding: 60px 24px;
}

.tpl-footer-main .container {
  max-width: 1200px;
  margin: 0 auto;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 40px;
}

.footer-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 20px;
  color: #fff;
}

.footer-title .mdui-icon {
  font-size: 20px;
  color: #667eea;
}

.footer-about-content {
  color: rgba(255, 255, 255, 0.7);
  font-size: 14px;
  line-height: 1.8;
  margin-bottom: 20px;
}

.footer-stats {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.stat-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: rgba(102, 126, 234, 0.2);
  border-radius: 20px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.9);
}

.stat-badge .mdui-icon {
  font-size: 16px;
  color: #667eea;
}

.stat-badge strong {
  color: #fff;
}

.footer-link-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-link-list li {
  margin-bottom: 12px;
}

.footer-link-list li a {
  display: flex;
  align-items: center;
  gap: 8px;
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  font-size: 14px;
  transition: color 0.2s;
}

.footer-link-list li a:hover {
  color: #667eea;
}

.footer-link-list li a .mdui-icon {
  font-size: 16px;
}

.sponsor-qrcode {
  display: flex;
  gap: 16px;
}

.qrcode-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.qrcode-item img {
  width: 100px;
  height: 100px;
  border-radius: 8px;
  background: #fff;
  padding: 8px;
}

.qrcode-item span {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.7);
}

.tpl-footer-bottom {
  padding: 20px 24px;
  background: #16162a;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.tpl-footer-bottom .container {
  max-width: 1200px;
  margin: 0 auto;
}

.copyright {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.5);
}

.copyright .mdui-icon {
  font-size: 16px;
}

/* ========================================
   404错误页面
   ======================================== */
.tpl-error-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.error-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  pointer-events: none;
}

.error-shape {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
}

.error-shape-1 {
  width: 400px;
  height: 400px;
  top: -100px;
  right: -100px;
  animation: float 6s ease-in-out infinite;
}

.error-shape-2 {
  width: 300px;
  height: 300px;
  bottom: -50px;
  left: -50px;
  animation: float 8s ease-in-out infinite reverse;
}

.error-shape-3 {
  width: 200px;
  height: 200px;
  top: 50%;
  left: 50%;
  animation: float 10s ease-in-out infinite;
}

.error-container {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 40px;
}

.error-icon {
  width: 120px;
  height: 120px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 30px;
  animation: bounce 2s ease-in-out infinite;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-15px); }
}

.error-icon .mdui-icon {
  font-size: 60px;
  color: #fff;
}

.error-code {
  font-size: 120px;
  font-weight: 800;
  color: #fff;
  line-height: 1;
  margin-bottom: 16px;
  text-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.error-title {
  font-size: 28px;
  font-weight: 600;
  color: #fff;
  margin-bottom: 12px;
}

.error-desc {
  font-size: 16px;
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: 40px;
}

.error-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

.error-btn-primary {
  background: #fff !important;
  color: #667eea !important;
}

.error-btn-secondary {
  border-color: rgba(255, 255, 255, 0.5) !important;
  color: #fff !important;
}

/* ========================================
   API文档页面
   ======================================== */
.doc-content {
  padding-top: 100px;
}

.doc-header {
  margin-bottom: 30px;
}

.doc-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  font-size: 14px;
  color: #909399;
}

.doc-breadcrumb a {
  display: flex;
  align-items: center;
  gap: 4px;
  color: #667eea;
  text-decoration: none;
}

.doc-breadcrumb a:hover {
  text-decoration: underline;
}

.doc-breadcrumb .mdui-icon {
  font-size: 16px;
}

.doc-title {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 28px;
  font-weight: 700;
  color: #303133;
  margin-bottom: 12px;
}

.doc-title .mdui-icon {
  font-size: 32px;
  color: #667eea;
}

.doc-desc {
  font-size: 16px;
  color: #909399;
}

/* MDUI标签页定制 */
.doc-tabs {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
  overflow: hidden;
  margin-bottom: 24px;
}

.doc-tabs .mdui-tab-item {
  padding: 0 24px;
  height: 56px;
}

.doc-tabs .mdui-tab-item a {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #606266;
  font-weight: 500;
}

.doc-tabs .mdui-tab-item.mdui-tab-item-active a {
  color: #667eea;
}

.doc-tabs .mdui-tab-item .mdui-icon {
  font-size: 20px;
}

/* 文档面板 */
.tab-content-wrapper {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
  overflow: hidden;
}

.doc-panel {
  padding: 30px !important;
}

/* 信息列表 */
.info-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 30px;
}

.info-item {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 16px 20px;
  background: #f8f9fc;
  border-radius: 12px;
}

.info-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  background: #e8e8e8;
  color: #606266;
  white-space: nowrap;
  min-width: 100px;
}

.info-badge .mdui-icon {
  font-size: 16px;
}

.info-badge-primary { background: rgba(102, 126, 234, 0.15); color: #667eea; }
.info-badge-success { background: rgba(82, 196, 26, 0.15); color: #52c41a; }
.info-badge-warning { background: rgba(250, 173, 20, 0.15); color: #faad14; }
.info-badge-info { background: rgba(24, 144, 255, 0.15); color: #1890ff; }

.info-value {
  flex: 1;
  font-size: 14px;
  color: #333;
  line-height: 1.6;
  word-break: break-all;
  cursor: pointer;
  border-bottom: 2px solid #667eea;
  padding-bottom: 2px;
}

/* 参数区块 */
.param-section {
  margin-bottom: 30px;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  font-weight: 600;
  color: #303133;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid #f0f2f5;
}

.section-title .mdui-icon {
  font-size: 20px;
  color: #667eea;
}

/* 表格 */
.mdui-table-container {
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #ebeef5;
}

.mdui-table {
  width: 100%;
  border-collapse: collapse;
}

.mdui-table th {
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: #fff;
  font-weight: 600;
  padding: 14px 16px;
  text-align: left;
}

.mdui-table td {
  padding: 12px 16px;
  border-bottom: 1px solid #ebeef5;
  color: #606266;
  font-size: 14px;
}

.mdui-table tbody tr:hover {
  background: #f8f9fc;
}

.mdui-table-hoverable tbody tr:hover {
  background: rgba(102, 126, 234, 0.05);
}

/* 代码块 */
.code-block {
  background: #1e1e1e;
  border-radius: 12px;
  padding: 20px;
  overflow-x: auto;
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  font-size: 13px;
  line-height: 1.6;
  color: #d4d4d4;
}

.code-block code {
  white-space: pre;
}

/* 在线测试 */
.test-header {
  margin-bottom: 24px;
}

.test-tip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: rgba(102, 126, 234, 0.1);
  border-radius: 8px;
  font-size: 13px;
  color: #667eea;
}

.test-tip .mdui-icon {
  font-size: 18px;
}

.test-url-section {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
}

.method-select {
  width: 120px !important;
}

.test-url-input {
  flex: 1;
}

.test-btn {
  background: linear-gradient(135deg, #667eea, #764ba2) !important;
  color: #fff !important;
  white-space: nowrap;
}

.param-table .mdui-textfield {
  padding: 0;
}

.param-table .mdui-textfield-input {
  border: 1px solid #e8e8e8;
  border-radius: 6px;
  padding: 8px 12px;
}

.param-value-cell {
  display: flex;
  align-items: center;
  gap: 8px;
}

.param-value-cell .mdui-textfield {
  flex: 1;
}

.del-btn {
  color: #ff4d4f !important;
}

.add-btn {
  border-color: #667eea !important;
  color: #667eea !important;
}

.result-block {
  min-height: 200px;
}

/* ========================================
   响应式
   ======================================== */
@media (max-width: 992px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
  
  .footer-about {
    grid-column: span 2;
  }
}

@media (max-width: 768px) {
  .tpl-header-inner {
    padding: 0 16px;
  }
  
  .tpl-logo span {
    display: none;
  }
  
  .tpl-nav-item span {
    display: none;
  }
  
  .tpl-hero {
    padding: 120px 16px 60px;
  }
  
  .hero-title {
    font-size: 32px;
  }
  
  .hero-title .mdui-icon {
    font-size: 32px;
  }
  
  .hero-subtitle {
    font-size: 16px;
  }
  
  .api-grid {
    grid-template-columns: 1fr;
  }
  
  .footer-grid {
    grid-template-columns: 1fr;
  }
  
  .footer-about {
    grid-column: span 1;
  }
  
  .error-code {
    font-size: 80px;
  }
  
  .error-title {
    font-size: 22px;
  }
  
  .error-actions {
    flex-direction: column;
  }
  
  .doc-tabs .mdui-tab-item .mdui-tab-label {
    display: none;
  }
  
  .test-url-section {
    flex-direction: column;
  }
  
  .method-select {
    width: 100% !important;
  }
  
  .info-item {
    flex-direction: column;
    gap: 10px;
  }
}
