@import './portal-base.css';

/* ================= 头部导航 ================= */
.yy-header {
  background: #ffffff;
  border-bottom: 1px solid var(--yy-slate-200);
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 1px 3px rgba(0,0,0,0.02);
  width: 100%;
}

.yy-header-inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.yy-logo-area {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  flex-shrink: 0;
}

.yy-logo-img {
  width: 36px;
  height: 36px;
  object-fit: contain;
  border-radius: var(--yy-radius-sm);
}

.yy-brand-title-wrap {
  display: flex;
  flex-direction: column;
}

.yy-brand-text {
  font-size: 16px;
  font-weight: 800;
  color: var(--yy-slate-900);
  letter-spacing: -0.2px;
  white-space: nowrap;
}

.yy-domain-tag {
  font-size: 11px;
  color: var(--yy-primary);
  font-family: var(--yy-font-mono);
  font-weight: 600;
  white-space: nowrap;
}

.yy-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  overflow-x: auto;
}

.yy-nav-link {
  font-size: 13px;
  font-weight: 500;
  color: var(--yy-slate-600);
  padding: 6px 12px;
  border-radius: var(--yy-radius-sm);
  transition: all 0.15s ease;
  white-space: nowrap;
}

.yy-nav-link:hover {
  color: var(--yy-slate-900);
  background: var(--yy-slate-100);
}

.yy-nav-link.active {
  color: var(--yy-primary);
  background: var(--yy-primary-light);
  font-weight: 600;
}

.yy-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
  flex-shrink: 0;
}

.yy-lang-select {
  font-size: 12px;
  font-weight: 500;
  color: var(--yy-slate-700);
  background: #ffffff;
  border: 1px solid var(--yy-slate-200);
  border-radius: var(--yy-radius-full);
  padding: 4px 10px;
  outline: none;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.yy-lang-select:hover {
  border-color: var(--yy-primary);
  color: var(--yy-primary);
}

.yy-status-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--yy-slate-600);
  background: #ffffff;
  border: 1px solid var(--yy-slate-200);
  padding: 4px 10px;
  border-radius: var(--yy-radius-full);
  white-space: nowrap;
  flex-shrink: 0;
}

.yy-status-dot {
  width: 7px;
  height: 7px;
  background-color: var(--yy-success);
  border-radius: 50%;
  box-shadow: 0 0 0 2px var(--yy-success-border);
  animation: yy-pulse 2s infinite;
  flex-shrink: 0;
}

@keyframes yy-pulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* ================= 顶部公告栏 ================= */
.yy-top-banner {
  background: linear-gradient(90deg, #1e293b 0%, #0f172a 100%);
  color: #e2e8f0;
  padding: 10px 24px;
  font-size: 13px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  width: 100%;
  box-sizing: border-box;
}

.yy-top-banner-inner {
  max-width: 1440px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
}

.yy-top-banner-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.yy-banner-tag {
  background: var(--yy-primary);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 3px;
  white-space: nowrap;
  flex-shrink: 0;
}

/* ================= Hero 区域与实时指标 ================= */
.yy-hero {
  background: radial-gradient(circle at 80% 20%, rgba(230, 0, 18, 0.04) 0%, transparent 60%), #ffffff;
  border-bottom: 1px solid var(--yy-slate-200);
  padding: 40px 24px 36px;
  width: 100%;
  box-sizing: border-box;
}

.yy-hero-inner {
  max-width: 1440px;
  margin: 0 auto;
  width: 100%;
}

.yy-hero-title {
  font-size: 28px;
  font-weight: 800;
  color: var(--yy-slate-900);
  letter-spacing: -0.5px;
  margin-bottom: 10px;
}

.yy-hero-desc {
  font-size: 14px;
  color: var(--yy-slate-600);
  max-width: 780px;
  line-height: 1.6;
  margin-bottom: 22px;
}

.yy-search-box {
  display: flex;
  align-items: center;
  background: #ffffff;
  border: 2px solid var(--yy-slate-200);
  border-radius: var(--yy-radius-md);
  padding: 6px 12px;
  max-width: 720px;
  position: relative;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.yy-search-box:focus-within {
  border-color: var(--yy-primary);
  box-shadow: 0 0 0 3px rgba(230, 0, 18, 0.12);
}

.yy-search-box input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 15px;
  padding: 6px 10px;
  color: var(--yy-slate-800);
  background: transparent;
  min-width: 0;
}

.yy-search-box svg {
  color: var(--yy-slate-400);
  flex-shrink: 0;
}

.yy-search-clear {
  background: none;
  border: none;
  color: var(--yy-slate-400);
  cursor: pointer;
  padding: 4px;
  display: none;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  flex-shrink: 0;
}

.yy-search-clear:hover {
  color: var(--yy-slate-700);
  background: var(--yy-slate-100);
}

.yy-search-kbd {
  font-family: var(--yy-font-mono);
  font-size: 11px;
  background: var(--yy-slate-100);
  color: var(--yy-slate-500);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid var(--yy-slate-200);
  pointer-events: none;
  white-space: nowrap;
  flex-shrink: 0;
}

.yy-hero-tags {
  margin-top: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--yy-slate-500);
}

.yy-quick-tag {
  background: var(--yy-slate-100);
  color: var(--yy-slate-700);
  padding: 3px 10px;
  border-radius: var(--yy-radius-full);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  flex-shrink: 0;
}

.yy-quick-tag:hover {
  background: var(--yy-primary-light);
  color: var(--yy-primary);
}

/* 实时指标看板 */
.yy-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-top: 24px;
  max-width: 100%;
}

.yy-stat-card {
  background: #ffffff;
  border: 1px solid var(--yy-slate-200);
  border-radius: var(--yy-radius-md);
  padding: 14px 18px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.02);
  display: flex;
  align-items: center;
  gap: 14px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.yy-stat-card:hover {
  transform: translateY(-1px);
  box-shadow: var(--yy-shadow-sm);
  border-color: var(--yy-slate-300);
}

.yy-stat-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--yy-radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.yy-stat-content {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.yy-stat-label {
  font-size: 12px;
  color: var(--yy-slate-500);
  font-weight: 500;
  white-space: nowrap;
}

.yy-stat-number {
  font-size: 20px;
  font-weight: 800;
  font-family: var(--yy-font-mono);
  color: var(--yy-slate-900);
  line-height: 1.2;
  margin-top: 2px;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.yy-stat-badge {
  font-size: 10px;
  padding: 1px 5px;
  border-radius: var(--yy-radius-full);
  font-weight: 700;
  font-family: var(--yy-font-sans);
}

/* ================= 主内容容器 ================= */
.yy-container {
  max-width: 1440px;
  margin: 28px auto;
  padding: 0 24px;
  flex: 1;
  width: 100%;
  box-sizing: border-box;
  min-width: 0;
}

.yy-main-grid {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 28px;
  min-width: 0;
  width: 100%;
}

.yy-breadcrumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--yy-slate-500);
  margin-bottom: 20px;
  white-space: nowrap;
  overflow-x: auto;
}

.yy-breadcrumbs a {
  white-space: nowrap;
}

.yy-breadcrumbs a:hover {
  color: var(--yy-primary);
}

/* ================= 侧边栏分类 ================= */
.yy-sidebar {
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-width: 0;
}

.yy-sidebar-card {
  background: #ffffff;
  border: 1px solid var(--yy-slate-200);
  border-radius: var(--yy-radius-md);
  padding: 16px;
}

.yy-sidebar-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--yy-slate-400);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
  padding-left: 4px;
  white-space: nowrap;
}

.yy-category-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.yy-category-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 12px;
  border-radius: var(--yy-radius-sm);
  font-size: 14px;
  font-weight: 500;
  color: var(--yy-slate-700);
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.yy-category-item:hover {
  background: var(--yy-slate-100);
  color: var(--yy-slate-900);
}

.yy-category-item.active {
  background: var(--yy-primary-light);
  color: var(--yy-primary);
  font-weight: 600;
}

.yy-category-count {
  font-size: 11px;
  background: var(--yy-slate-100);
  color: var(--yy-slate-500);
  padding: 2px 6px;
  border-radius: var(--yy-radius-full);
  white-space: nowrap;
  flex-shrink: 0;
}

.yy-category-item.active .yy-category-count {
  background: #ffffff;
  color: var(--yy-primary);
}

.yy-mirror-box {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.yy-mirror-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  padding: 6px 0;
  border-bottom: 1px dashed var(--yy-slate-200);
  white-space: nowrap;
  gap: 8px;
}

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

.yy-mirror-name {
  color: var(--yy-slate-700);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.yy-mirror-speed {
  font-family: var(--yy-font-mono);
  color: var(--yy-success);
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}

/* ================= 资源主体区域与工具栏 ================= */
.yy-content-area {
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-width: 0;
  width: 100%;
}

.yy-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #ffffff;
  border: 1px solid var(--yy-slate-200);
  border-radius: var(--yy-radius-md);
  padding: 14px 20px;
  flex-wrap: wrap;
  gap: 12px;
  width: 100%;
  box-sizing: border-box;
}

.yy-toolbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
  white-space: nowrap;
}

.yy-current-cat-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--yy-slate-900);
  white-space: nowrap;
}

.yy-toolbar-meta {
  font-size: 13px;
  color: var(--yy-slate-500);
  white-space: nowrap;
}

.yy-toolbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
  white-space: nowrap;
}

.yy-sort-select {
  font-size: 13px;
  color: var(--yy-slate-700);
  background: var(--yy-slate-50);
  border: 1px solid var(--yy-slate-200);
  padding: 6px 10px;
  border-radius: var(--yy-radius-sm);
  outline: none;
  cursor: pointer;
  white-space: nowrap;
}

.yy-view-btn-group {
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.yy-view-btn {
  background: var(--yy-slate-100);
  border: 1px solid var(--yy-slate-200);
  padding: 6px 12px;
  border-radius: var(--yy-radius-sm);
  color: var(--yy-slate-600);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  transition: all 0.15s ease;
  white-space: nowrap;
  flex-shrink: 0;
}

.yy-view-btn:hover {
  background: #ffffff;
  color: var(--yy-slate-900);
}

.yy-view-btn.active {
  background: #ffffff;
  border-color: var(--yy-primary);
  color: var(--yy-primary);
  font-weight: 600;
}
