/**
 * 统一样式文件 - styles-clean.css
 * 全新简洁版本，解决所有布局和对齐问题
 */

/* ============================================
   1. 全局样式
   ============================================ */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 
               'Microsoft YaHei', sans-serif;
  line-height: 1.6;
  color: #111827;
  background: linear-gradient(180deg, #f8fafc 0%, #e0e7ff 100%);
  min-height: 100vh;
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
  text-decoration: none;
  transition: all 0.2s;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: 0;
  outline: 0;
}

.container {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 16px;
}

/* ============================================
   2. 顶部导航
   ============================================ */
.site-header {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(20px);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  position: sticky;
  top: 0;
  z-index: 1020;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.header-inner {
  display: flex;
  align-items: center;
  height: 70px;
  gap: 24px;
}

.brand {
  font-size: 24px;
  font-weight: 800;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  letter-spacing: -0.5px;
}

.top-tabs {
  display: flex;
  gap: 8px;
  margin-left: auto;
  overflow-x: auto;
  scrollbar-width: none;
}

.top-tabs::-webkit-scrollbar {
  display: none;
}

.tab {
  height: 42px;
  padding: 0 20px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: transparent;
  color: #6b7280;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  transition: all 0.2s;
}

.tab:hover {
  color: #6366f1;
  background: rgba(99, 102, 241, 0.1);
}

.tab.active {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: white;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

/* ============================================
   3. Hero 卡片区
   ============================================ */
.hero-cards {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
  margin: 24px 0;
}

.card {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 12px;
  padding: 20px 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  transition: all 0.25s;
  text-align: center;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.card-title {
  font-size: 13px;
  color: #6b7280;
  margin-bottom: 8px;
  font-weight: 600;
}

.card-value {
  font-size: 24px;
  font-weight: 700;
  color: #111827;
  line-height: 1.2;
}

.cta {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: white;
  border-radius: 12px;
  padding: 20px 16px;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
  transition: all 0.25s;
}

.cta:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(99, 102, 241, 0.4);
}

/* ============================================
   4. 子导航
   ============================================ */
.sub-tabs {
  display: flex;
  gap: 8px;
  padding: 16px 0;
  overflow-x: auto;
  scrollbar-width: none;
  margin-bottom: 24px;
  border-bottom: 2px solid #e5e7eb;
}

.sub-tabs::-webkit-scrollbar {
  display: none;
}

.sub-tab {
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  color: #6b7280;
  background: transparent;
  transition: all 0.2s;
  white-space: nowrap;
}

.sub-tab:hover {
  background: #f3f4f6;
  color: #111827;
}

.sub-tab.active {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: white;
  box-shadow: 0 2px 4px rgba(99, 102, 241, 0.3);
}

/* ============================================
   面包屑导航
   ============================================ */
.breadcrumb {
  padding: 12px 0;
  font-size: 13px;
}

.breadcrumb ol {
  display: flex;
  list-style: none;
  gap: 8px;
  flex-wrap: wrap;
  margin: 0;
}

.breadcrumb li {
  color: #6b7280;
}

.breadcrumb li::after {
  content: '›';
  margin-left: 8px;
  color: #d1d5db;
}

.breadcrumb li:last-child::after {
  display: none;
}

.breadcrumb a {
  color: #6366f1;
  transition: color 0.2s;
}

.breadcrumb a:hover {
  color: #4f46e5;
}

.breadcrumb li[aria-current] {
  color: #111827;
  font-weight: 600;
}

@media (max-width: 768px) {
  .breadcrumb {
    font-size: 12px;
    padding: 8px 0;
  }
}

/* ============================================
   SEO内容样式优化
   ============================================ */

/* SEO内容：搜索引擎可见，用户不可见 */
#app > article {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* 或者使用视觉隐藏（可选方案） */
.seo-content {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ============================================
   5. 表格样式 - 完美对齐
   ============================================ */
.table-wrap {
  background: white;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  margin-bottom: 24px;
}

.table-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid #e5e7eb;
}

.table-title {
  font-size: 18px;
  font-weight: 700;
  color: #111827;
  margin: 0;
}

.table-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.table {
  width: 100%;
  border-collapse: collapse;
  background: white;
}

.table thead {
  background: #f9fafb;
}

.table th {
  padding: 12px 16px;
  text-align: center;
  font-weight: 600;
  color: #6b7280;
  border-bottom: 2px solid #e5e7eb;
  font-size: 13px;
  vertical-align: middle;
}

.table td {
  padding: 12px 16px;
  border-bottom: 1px solid #f3f4f6;
  color: #374151;
  font-weight: 500;
  text-align: center;
  vertical-align: middle;
}

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

.table tbody tr:last-child td {
  border-bottom: none;
}

.k-right {
  text-align: right !important;
}

.table td.digit {
  font-weight: 600;
}

/* ============================================
   6. 徽章组件
   ============================================ */
.badge, .chip {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  min-width: 48px;
  text-align: center;
}

.badge.success, .chip.success {
  background: #10b981;
  color: white;
}

.badge.warning, .chip.warning {
  background: #f59e0b;
  color: white;
}

.badge.danger, .chip.danger {
  background: #ef4444;
  color: white;
}

.badge.info, .chip.info {
  background: #3b82f6;
  color: white;
}

.badge.special, .chip.special {
  background: #8b5cf6;
  color: white;
}

.badge.extreme, .chip.extreme {
  background: linear-gradient(135deg, #ec4899, #f43f5e);
  color: white;
  box-shadow: 0 2px 4px rgba(236, 72, 153, 0.3);
}

.chips {
  display: inline-flex;
  gap: 6px;
  flex-wrap: wrap;
}

/* ============================================
   7. 按钮
   ============================================ */
.btn-primary {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: white;
  padding: 10px 24px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
  box-shadow: 0 2px 4px rgba(99, 102, 241, 0.3);
  transition: all 0.2s;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.btn-secondary {
  background: #f3f4f6;
  color: #374151;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  transition: all 0.2s;
  border: 1px solid #e5e7eb;
}

.btn-secondary:hover {
  background: #e5e7eb;
}

.btn-secondary.active {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: white;
  border-color: transparent;
}

.button-group {
  display: inline-flex;
  gap: 8px;
}

/* ============================================
   8. 表单
   ============================================ */
.toolbar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  padding: 16px;
  background: #f9fafb;
  border-bottom: 1px solid #e5e7eb;
}

.toolbar label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
}

input[type="date"],
input[type="search"],
input[type="text"],
select {
  padding: 8px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  font-size: 14px;
  color: #374151;
  background: white;
  transition: all 0.2s;
}

input:focus,
select:focus {
  outline: none;
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.toolbar .info {
  color: #6b7280;
  font-size: 13px;
  margin-left: auto;
}

/* ============================================
   9. 分页器
   ============================================ */
#pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 20px;
  background: #f9fafb;
}

#pager button {
  padding: 8px 16px;
  border-radius: 8px;
  font-weight: 600;
  background: white;
  border: 1px solid #e5e7eb;
  transition: all 0.2s;
}

#pager button:hover:not(:disabled) {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: white;
  border-color: transparent;
}

#pager button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

#pageInfo {
  font-size: 14px;
  color: #6b7280;
  font-weight: 500;
}

/* ============================================
   10. Toast通知
   ============================================ */
.toast {
  position: fixed;
  top: 90px;
  right: 24px;
  z-index: 9999;
  padding: 14px 20px;
  border-radius: 8px;
  color: white;
  font-weight: 600;
  font-size: 14px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  animation: slideIn 0.3s ease;
}

.toast.success {
  background: #10b981;
}

.toast.error {
  background: #ef4444;
}

.toast.info {
  background: #3b82f6;
}

@keyframes slideIn {
  from {
    transform: translateX(100px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* ============================================
   11. 页脚
   ============================================ */
.site-footer {
  background: #111827;
  color: rgba(255, 255, 255, 0.7);
  padding: 32px 0;
  margin-top: 48px;
  text-align: center;
  font-size: 13px;
}

.site-footer p {
  margin: 8px 0;
}

.site-footer a {
  color: #6366f1;
}

.credits {
  color: rgba(255, 255, 255, 0.5);
  font-size: 12px;
}

/* ============================================
   12. 响应式 - 平板
   ============================================ */
@media (max-width: 1024px) {
  .hero-cards {
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
  }
  
  .hero-cards > .cta {
    grid-column: 1 / -1;
  }
}

/* ============================================
   13. 响应式 - 手机
   ============================================ */
@media (max-width: 768px) {
  .container {
    padding: 0 12px;
  }
  
  .header-inner {
    height: 56px;
    gap: 8px;
  }
  
  .brand {
    font-size: 16px;
    flex-shrink: 0;
    max-width: 90px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  
  .top-tabs {
    flex: 1;
    gap: 4px;
    padding: 2px;
  }
  
  .tab {
    height: 32px;
    padding: 0 10px;
    font-size: 11px;
    min-width: 50px;
  }
  
  .hero-cards {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin: 16px 0;
  }
  
  .hero-cards > .cta {
    grid-column: 1 / -1;
  }
  
  .card {
    padding: 14px 12px;
  }
  
  .card-title {
    font-size: 11px;
  }
  
  .card-value {
    font-size: 18px;
  }
  
  .sub-tab {
    padding: 8px 14px;
    font-size: 13px;
  }
  
  .table-header {
    padding: 16px;
  }
  
  .table-title {
    font-size: 16px;
  }
  
  .table th {
    padding: 10px 12px;
    font-size: 12px;
  }
  
  .table td {
    padding: 10px 12px;
    font-size: 13px;
  }
  
  .badge, .chip {
    padding: 2px 8px;
    font-size: 11px;
  }
  
  .toolbar {
    flex-direction: column;
    gap: 10px;
    padding: 12px;
  }
  
  .toolbar input,
  .toolbar select,
  .toolbar button {
    width: 100%;
  }
  
  .toolbar .info {
    margin-left: 0;
  }
}

@media (max-width: 480px) {
  .hero-cards {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  
  .table th {
    padding: 8px;
    font-size: 11px;
  }
  
  .table td {
    padding: 8px;
    font-size: 12px;
  }
}

