/* 网盘搜索 - 本地化版本样式 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --bg: #f8fafc;
  --card-bg: #ffffff;
  --text: #1e293b;
  --text-secondary: #64748b;
  --border: #e2e8f0;
  --quark: #00a4ff;
  --baidu: #2932e1;
  --aliyun: #ff6a00;
  --success: #10b981;
  --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-hover: 0 4px 12px rgba(0,0,0,0.1), 0 2px 4px rgba(0,0,0,0.06);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

/* 顶部导航 */
.navbar {
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow);
}

.navbar-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  height: 60px;
  gap: 32px;
}

.logo {
  font-size: 20px;
  font-weight: 700;
  color: var(--primary);
  text-decoration: none;
  white-space: nowrap;
}

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

.nav-links {
  display: flex;
  gap: 20px;
  list-style: none;
}

.nav-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
  transition: color 0.2s;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--primary);
}

/* 搜索框 */
.search-box {
  flex: 1;
  max-width: 500px;
  display: flex;
  gap: 0;
}

.search-box input {
  flex: 1;
  padding: 10px 16px;
  border: 2px solid var(--border);
  border-right: none;
  border-radius: 8px 0 0 8px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}

.search-box input:focus {
  border-color: var(--primary);
}

.search-box button {
  padding: 10px 24px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 0 8px 8px 0;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.2s;
}

.search-box button:hover {
  background: var(--primary-hover);
}

/* 主容器 */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px;
}

/* 首页样式 */
.home-hero {
  text-align: center;
  padding: 80px 20px 40px;
}

.home-hero h1 {
  font-size: 42px;
  font-weight: 700;
  margin-bottom: 12px;
  background: linear-gradient(135deg, var(--primary), #7c3aed);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.home-hero p {
  color: var(--text-secondary);
  font-size: 16px;
  margin-bottom: 40px;
}

.home-search {
  max-width: 600px;
  margin: 0 auto 40px;
  display: flex;
  gap: 0;
}

.home-search input {
  flex: 1;
  padding: 16px 20px;
  border: 2px solid var(--border);
  border-right: none;
  border-radius: 12px 0 0 12px;
  font-size: 16px;
  outline: none;
  transition: border-color 0.2s;
}

.home-search input:focus {
  border-color: var(--primary);
}

.home-search button {
  padding: 16px 32px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 0 12px 12px 0;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
}

.home-search button:hover {
  background: var(--primary-hover);
}

/* 热门搜索 */
.hot-searches {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-bottom: 60px;
}

.hot-searches .label {
  color: var(--text-secondary);
  font-size: 14px;
  margin-right: 4px;
}

.hot-searches a {
  padding: 6px 14px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--text);
  text-decoration: none;
  font-size: 13px;
  transition: all 0.2s;
}

.hot-searches a:hover {
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-1px);
}

/* 网盘类型卡片 */
.pan-types {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  max-width: 800px;
  margin: 0 auto;
}

.pan-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  text-align: center;
  transition: all 0.2s;
  cursor: pointer;
  text-decoration: none;
  color: var(--text);
}

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

.pan-card .icon {
  font-size: 32px;
  margin-bottom: 12px;
}

.pan-card h3 {
  font-size: 18px;
  margin-bottom: 6px;
}

.pan-card p {
  color: var(--text-secondary);
  font-size: 13px;
}

.pan-card.quark .icon { color: var(--quark); }
.pan-card.baidu .icon { color: var(--baidu); }
.pan-card.aliyun .icon { color: var(--aliyun); }

/* 搜索结果页 */
.search-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 24px;
}

/* 侧边栏 */
.sidebar {
  position: sticky;
  top: 84px;
  align-self: start;
}

.sidebar-section {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 16px;
}

.sidebar-section > summary {
  list-style: none;
  cursor: default;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sidebar-section > summary::-webkit-details-marker {
  display: none;
}

.sidebar-section > summary .arrow {
  display: none !important;
}

/* 桌面端：强制展开 details，隐藏箭头，和原来一样 */
@media (min-width: 769px) {
  .sidebar-section {
    display: block;
  }
  .sidebar-section > summary {
    display: block !important;
    margin-bottom: 12px;
    cursor: default;
  }
  .sidebar-section > summary .arrow {
    display: none !important;
  }
  .sidebar-section > *:not(summary) {
    display: block !important;
  }
}

.sidebar-list {
  list-style: none;
}

.sidebar-list li {
  margin-bottom: 6px;
}

.sidebar-list a {
  display: block;
  padding: 8px 12px;
  border-radius: 6px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 13px;
  transition: all 0.2s;
}

.sidebar-list a:hover,
.sidebar-list a.active {
  background: #eff6ff;
  color: var(--primary);
}

.sidebar-list .count {
  float: right;
  color: var(--text-secondary);
  font-size: 12px;
}

/* 搜索结果列表 */
.results-header {
  margin-bottom: 16px;
  font-size: 14px;
  color: var(--text-secondary);
}

.results-header strong {
  color: var(--primary);
}

.result-list {
  list-style: none;
}

.result-item {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 20px;
  margin-bottom: 12px;
  transition: all 0.2s;
}

.result-item:hover {
  box-shadow: var(--shadow-hover);
  border-color: #cbd5e1;
}

.result-title {
  font-size: 16px;
  font-weight: 500;
  margin-bottom: 8px;
}

.result-title a {
  color: var(--text);
  text-decoration: none;
  transition: color 0.2s;
}

.result-title a:hover {
  color: var(--primary);
}

.result-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: var(--text-secondary);
}

.pan-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
  color: white;
}

.pan-badge.quark { background: var(--quark); }
.pan-badge.baidu { background: var(--baidu); }
.pan-badge.aliyun { background: var(--aliyun); }

.result-right {
  float: right;
  font-size: 13px;
  color: var(--text-secondary);
}

.result-right .size {
  margin-left: 12px;
  color: var(--success);
}

/* 分页 */
.pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 32px;
  flex-wrap: wrap;
}

.pagination a,
.pagination span {
  display: inline-block;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 6px;
  text-decoration: none;
  color: var(--text);
  font-size: 14px;
  transition: all 0.2s;
  background: var(--card-bg);
}

.pagination a:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.pagination .current {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

.pagination .disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* 资源详情页 */
.detail-container {
  max-width: 800px;
  margin: 0 auto;
}

.breadcrumb {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.breadcrumb a {
  color: var(--text-secondary);
  text-decoration: none;
}

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

.breadcrumb .sep {
  margin: 0 8px;
}

.detail-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 32px;
  margin-bottom: 24px;
}

.detail-title {
  font-size: 24px;
  font-weight: 600;
  margin-bottom: 16px;
  word-break: break-all;
}

.detail-sub {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
  font-size: 14px;
  color: var(--text-secondary);
  flex-wrap: wrap;
}

.detail-action {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 20px;
  background: #f1f5f9;
  border-radius: 10px;
  margin-bottom: 24px;
}

.pwd-area {
  flex: 1;
}

.pwd-label {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.pwd-val {
  font-size: 20px;
  font-weight: 600;
  font-family: monospace;
  color: var(--text);
  letter-spacing: 2px;
}

.pwd-val.empty {
  color: var(--success);
  font-size: 14px;
  font-weight: normal;
  letter-spacing: normal;
}

.open-btn {
  display: inline-block;
  padding: 12px 28px;
  background: var(--primary);
  color: white;
  text-decoration: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 500;
  transition: background 0.2s;
  white-space: nowrap;
}

.open-btn:hover {
  background: var(--primary-hover);
}

/* 资源信息表 */
.detail-section {
  margin-bottom: 24px;
}

.detail-section h2 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.detail-meta-table {
  width: 100%;
  border-collapse: collapse;
}

.detail-meta-table th,
.detail-meta-table td {
  padding: 10px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}

.detail-meta-table th {
  width: 100px;
  color: var(--text-secondary);
  font-weight: 500;
  background: #f8fafc;
}

.detail-meta-table tr:last-child th,
.detail-meta-table tr:last-child td {
  border-bottom: none;
}

/* 相关推荐 */
.related-list {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.related-list .result-item {
  margin-bottom: 0;
  padding: 12px 16px;
}

.related-list .result-title {
  font-size: 14px;
  margin-bottom: 6px;
}

.related-list .result-meta {
  font-size: 12px;
}

/* 加载状态 */
.loading {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-secondary);
}

.loading-spinner {
  display: inline-block;
  width: 32px;
  height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 16px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.error {
  text-align: center;
  padding: 60px 20px;
  color: #ef4444;
}

.empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-secondary);
}

.empty-icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.5;
}

/* 页脚 */
.footer {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-secondary);
  font-size: 13px;
  border-top: 1px solid var(--border);
  margin-top: 60px;
}

/* 响应式 */
@media (max-width: 768px) {
  .navbar-inner {
    flex-wrap: wrap;
    height: auto;
    padding: 10px 0;
    gap: 12px;
  }
  
  .search-box {
    order: 3;
    max-width: 100%;
    width: 100%;
  }
  
  .nav-links {
    display: none;
  }
  
  .home-hero h1 {
    font-size: 28px;
  }
  
  .home-hero {
    padding: 40px 20px 30px;
  }
  
  .pan-types {
    grid-template-columns: 1fr;
  }
  
  .search-layout {
    grid-template-columns: 1fr;
  }
  
  .sidebar {
    position: static;
  }

  .sidebar-section > summary {
    cursor: pointer;
    padding: 4px 0;
    margin-bottom: 0;
  }

  .sidebar-section > summary .arrow {
    display: inline-block;
    font-size: 12px;
    color: var(--text-secondary);
    transition: transform 0.2s;
  }

  .sidebar-section[open] > summary .arrow {
    transform: rotate(180deg);
  }

  .sidebar-section .sidebar-list {
    padding-top: 8px;
  }
  
  .detail-action {
    flex-direction: column;
    align-items: stretch;
  }
  
  .related-list {
    grid-template-columns: 1fr;
  }
  
  .detail-card {
    padding: 20px;
  }
  
  .detail-title {
    font-size: 20px;
  }
}
