/* ============================================
   fuinsight.com - 综合信息服务平台
   样式表
   ============================================ */

/* === CSS Variables === */
:root {
  --primary: #1677ff;
  --primary-dark: #0958d9;
  --primary-light: #e6f4ff;
  --orange: #ff6b00;
  --orange-dark: #e05200;
  --orange-light: #fff2e8;
  --green: #52c41a;
  --red: #ff4d4f;
  --gold: #faad14;
  --bg: #f5f5f5;
  --bg-white: #ffffff;
  --text: #1a1a1a;
  --text-secondary: #666666;
  --text-muted: #999999;
  --border: #e8e8e8;
  --border-light: #f0f0f0;
  --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;
  --header-height: 56px;
  --nav-height: 44px;
}

/* === Reset & Base === */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

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

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

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

ul, ol {
  list-style: none;
}

img {
  max-width: 100%;
  vertical-align: middle;
}

input, button, select, textarea {
  font-family: inherit;
  font-size: inherit;
  outline: none;
}

button {
  cursor: pointer;
  border: none;
  background: none;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 16px;
}

/* === Top Bar === */
.top-bar {
  background: #1a1a1a;
  color: #ccc;
  font-size: 12px;
  height: 32px;
  line-height: 32px;
}

.top-bar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 100%;
}

.top-bar a {
  color: #ccc;
  padding: 0 8px;
}

.top-bar a:hover {
  color: #fff;
}

.top-bar .city-picker {
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  color: #ccc;
}

.top-bar .city-picker:hover {
  color: #fff;
}

.top-bar .city-picker .icon {
  font-size: 14px;
}

.top-bar-right {
  display: flex;
  align-items: center;
  gap: 4px;
}

.top-bar-right .sep {
  color: #555;
}

/* === Header === */
.header {
  background: var(--bg-white);
  height: var(--header-height);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header .container {
  display: flex;
  align-items: center;
  height: 100%;
  gap: 24px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 22px;
  font-weight: 700;
  color: var(--primary);
  white-space: nowrap;
}

.logo .logo-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 20px;
}

.header-search {
  flex: 1;
  max-width: 480px;
  display: flex;
  height: 36px;
  border: 2px solid var(--primary);
  border-radius: 20px;
  overflow: hidden;
}

.header-search input {
  flex: 1;
  border: none;
  padding: 0 16px;
  font-size: 14px;
}

.header-search button {
  width: 72px;
  background: var(--primary);
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  flex-shrink: 0;
}

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

.header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-left: auto;
}

.header-actions .btn {
  padding: 6px 16px;
  border-radius: 16px;
  font-size: 13px;
  transition: all 0.2s;
}

.btn-publish {
  background: var(--orange);
  color: #fff;
  font-weight: 500;
}

.btn-publish:hover {
  background: var(--orange-dark);
  color: #fff;
}

.btn-login {
  color: var(--text-secondary);
  border: 1px solid var(--border);
  background: #fff;
}

.btn-login:hover {
  color: var(--primary);
  border-color: var(--primary);
}

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

.btn-register:hover {
  background: var(--primary-dark);
  color: #fff;
}

/* === Nav === */
.nav {
  background: var(--bg-white);
  height: var(--nav-height);
  border-bottom: 1px solid var(--border-light);
}

.nav .container {
  display: flex;
  align-items: center;
  height: 100%;
  gap: 4px;
}

.nav a {
  display: flex;
  align-items: center;
  padding: 0 16px;
  height: 100%;
  font-size: 14px;
  color: var(--text-secondary);
  position: relative;
  transition: color 0.2s;
}

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

.nav a.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 16px;
  right: 16px;
  height: 2px;
  background: var(--primary);
  border-radius: 1px 1px 0 0;
}

/* === Main Content Area === */
.main {
  min-height: calc(100vh - var(--header-height) - var(--nav-height) - 32px - 200px);
  padding: 20px 0;
}

/* === Category Grid (58 Style) === */
.category-section {
  background: var(--bg-white);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
}

.section-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-title::before {
  content: '';
  width: 3px;
  height: 18px;
  background: var(--primary);
  border-radius: 2px;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 12px;
}

.category-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 12px 8px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.2s;
}

.category-item:hover {
  background: var(--primary-light);
  color: var(--primary);
}

.category-item .cat-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}

.cat-icon.blue { background: #e6f4ff; color: #1677ff; }
.cat-icon.green { background: #f6ffed; color: #52c41a; }
.cat-icon.orange { background: #fff2e8; color: #ff6b00; }
.cat-icon.purple { background: #f9f0ff; color: #722ed1; }
.cat-icon.red { background: #fff1f0; color: #ff4d4f; }
.cat-icon.cyan { background: #e6fffb; color: #13c2c2; }
.cat-icon.gold { background: #fffbe6; color: #faad14; }
.cat-icon.pink { background: #fff0f6; color: #eb2f96; }
.cat-icon.geek { background: #f5f5f5; color: #595959; }
.cat-icon.teal { background: #e6fffb; color: #08979c; }

.category-item span {
  font-size: 12px;
  text-align: center;
  color: var(--text-secondary);
}

/* === Info List (58 Style Listings) === */
.info-list-section {
  background: var(--bg-white);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
}

.info-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border-light);
  margin-bottom: 16px;
}

.info-tab {
  padding: 8px 20px;
  font-size: 14px;
  color: var(--text-secondary);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
}

.info-tab:hover,
.info-tab.active {
  color: var(--primary);
}

.info-tab.active {
  border-bottom-color: var(--primary);
  font-weight: 500;
}

.info-list {
  display: grid;
  gap: 0;
}

.info-item {
  display: flex;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid var(--border-light);
  gap: 16px;
  transition: background 0.2s;
  cursor: pointer;
}

.info-item:hover {
  background: #fafafa;
  margin: 0 -20px;
  padding-left: 20px;
  padding-right: 20px;
}

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

.info-item .info-thumb {
  width: 120px;
  height: 90px;
  border-radius: 4px;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--bg);
}

.info-item .info-body {
  flex: 1;
  min-width: 0;
}

.info-item .info-title {
  font-size: 15px;
  font-weight: 500;
  margin-bottom: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

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

.info-item .info-meta {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.info-item .info-tags {
  display: flex;
  gap: 6px;
  margin-top: 6px;
}

.info-tag {
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 2px;
  background: #f0f0f0;
  color: var(--text-muted);
}

.info-tag.hot {
  background: #fff1f0;
  color: var(--red);
}

.info-tag.new {
  background: #e6f4ff;
  color: var(--primary);
}

.info-item .info-price {
  font-size: 18px;
  font-weight: 600;
  color: var(--red);
  white-space: nowrap;
  margin-left: auto;
}

.info-item .info-price.free {
  color: var(--green);
  font-size: 14px;
}

/* === Pagination === */
.pagination {
  display: flex;
  justify-content: center;
  gap: 4px;
  margin-top: 20px;
}

.pagination a,
.pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  padding: 0 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  transition: all 0.2s;
}

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

.pagination a.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.pagination .ellipsis {
  border-color: transparent;
}

/* === Sidebar (for detail & shop pages) === */
.content-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 16px;
}

.sidebar .side-card {
  background: var(--bg-white);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 16px;
}

.side-card h4 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-light);
}

/* === Footer === */
.footer {
  background: #1a1a1a;
  color: #999;
  padding: 30px 0 20px;
  font-size: 12px;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  margin-bottom: 24px;
}

.footer-col h5 {
  color: #ccc;
  font-size: 14px;
  margin-bottom: 12px;
  font-weight: 500;
}

.footer-col a {
  display: block;
  color: #888;
  padding: 4px 0;
  font-size: 12px;
  transition: color 0.2s;
}

.footer-col a:hover {
  color: #ccc;
}

.footer-bottom {
  border-top: 1px solid #333;
  padding-top: 16px;
  text-align: center;
  line-height: 2;
}

.footer-bottom .icp {
  margin-top: 4px;
}

.footer-bottom .icp a {
  color: #888;
}

/* === Buttons === */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 8px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s;
  border: 1px solid transparent;
}

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

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

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

.btn-orange:hover {
  background: var(--orange-dark);
  color: #fff;
}

.btn-outline {
  border-color: var(--border);
  background: #fff;
  color: var(--text);
}

.btn-outline:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.btn-sm {
  padding: 4px 12px;
  font-size: 12px;
}

.btn-lg {
  padding: 12px 32px;
  font-size: 16px;
}

.btn-block {
  display: flex;
  width: 100%;
}

/* === Form Elements === */
.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 6px;
  color: var(--text);
}

.form-group label .required {
  color: var(--red);
  margin-left: 2px;
}

.form-input,
.form-textarea,
.form-select {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  transition: border-color 0.2s;
  background: #fff;
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(22, 119, 255, 0.1);
}

.form-textarea {
  min-height: 120px;
  resize: vertical;
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: #ccc;
}

/* === Auth Pages === */
.auth-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - var(--header-height) - 32px - 200px);
  padding: 40px 16px;
}

.auth-card {
  width: 400px;
  background: var(--bg-white);
  border-radius: var(--radius);
  padding: 40px;
  box-shadow: var(--shadow);
}

.auth-card h2 {
  font-size: 24px;
  text-align: center;
  margin-bottom: 8px;
}

.auth-card .auth-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 32px;
}

.auth-card .form-group {
  margin-bottom: 20px;
}

.auth-card .btn {
  margin-top: 8px;
}

.auth-card .auth-footer {
  text-align: center;
  margin-top: 20px;
  font-size: 13px;
  color: var(--text-muted);
}

.auth-card .auth-footer a {
  color: var(--primary);
}

.auth-card .agreement {
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 16px;
}

.auth-card .agreement a {
  color: var(--primary);
}

/* === Shop Page === */
.shop-header {
  background: var(--bg-white);
  padding: 16px 0;
  margin-bottom: 16px;
}

.shop-categories {
  display: flex;
  gap: 0;
  flex-wrap: wrap;
}

.shop-cat {
  padding: 6px 16px;
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
  border-radius: 16px;
  transition: all 0.2s;
}

.shop-cat:hover,
.shop-cat.active {
  color: var(--orange);
  background: var(--orange-light);
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
}

.product-card {
  background: var(--bg-white);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: all 0.2s;
  border: 1px solid transparent;
}

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

.product-card .product-img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  background: var(--bg);
}

.product-card .product-info {
  padding: 10px 12px;
}

.product-card .product-name {
  font-size: 13px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 6px;
  min-height: 36px;
}

.product-card .product-price {
  font-size: 16px;
  font-weight: 600;
  color: var(--red);
}

.product-card .product-price .unit {
  font-size: 12px;
  font-weight: 400;
}

.product-card .product-sold {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}

.product-card .product-shop {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* === Cart === */
.cart-icon-wrap {
  position: relative;
  cursor: pointer;
  font-size: 22px;
  color: var(--orange);
}

.cart-badge {
  position: absolute;
  top: -6px;
  right: -8px;
  min-width: 16px;
  height: 16px;
  background: var(--red);
  color: #fff;
  font-size: 10px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  font-weight: 600;
}

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

.cart-table th {
  background: #fafafa;
  padding: 12px;
  text-align: left;
  font-size: 13px;
  font-weight: 500;
  border-bottom: 1px solid var(--border);
}

.cart-table td {
  padding: 16px 12px;
  border-bottom: 1px solid var(--border-light);
  vertical-align: middle;
}

.cart-table .product-cell {
  display: flex;
  align-items: center;
  gap: 12px;
}

.cart-table .product-cell img {
  width: 80px;
  height: 80px;
  border-radius: 4px;
  object-fit: cover;
  background: var(--bg);
}

.cart-qty {
  display: flex;
  align-items: center;
  gap: 0;
}

.cart-qty button {
  width: 28px;
  height: 28px;
  border: 1px solid var(--border);
  background: #fff;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cart-qty button:first-child {
  border-radius: 4px 0 0 4px;
}

.cart-qty button:last-child {
  border-radius: 0 4px 4px 0;
}

.cart-qty .qty-num {
  width: 40px;
  height: 28px;
  border: 1px solid var(--border);
  border-left: none;
  border-right: none;
  text-align: center;
  font-size: 13px;
  line-height: 28px;
}

.cart-summary {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 20px;
  padding: 20px 0;
  border-top: 1px solid var(--border);
  margin-top: 16px;
}

.cart-summary .total-price {
  font-size: 24px;
  font-weight: 600;
  color: var(--red);
}

.cart-summary .total-price .unit {
  font-size: 14px;
}

/* === Detail Page === */
.detail-main {
  background: var(--bg-white);
  border-radius: var(--radius);
  padding: 24px;
}

.detail-main h1 {
  font-size: 22px;
  font-weight: 600;
  margin-bottom: 12px;
}

.detail-meta {
  display: flex;
  gap: 20px;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-light);
}

.detail-price {
  font-size: 28px;
  font-weight: 700;
  color: var(--red);
  margin-bottom: 20px;
  padding: 16px;
  background: #fff1f0;
  border-radius: var(--radius);
}

.detail-content {
  font-size: 14px;
  line-height: 1.8;
  color: var(--text-secondary);
}

.detail-content p {
  margin-bottom: 12px;
}

/* === Publish Page === */
.publish-form {
  background: var(--bg-white);
  border-radius: var(--radius);
  padding: 32px;
  max-width: 800px;
}

.publish-form h2 {
  font-size: 20px;
  margin-bottom: 24px;
}

.publish-form .form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* === Home Sidebar === */
.home-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 16px;
}

.home-sidebar .side-card {
  background: var(--bg-white);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 16px;
}

.side-card h4 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-light);
}

.hot-list li {
  padding: 8px 0;
  border-bottom: 1px solid var(--border-light);
  font-size: 13px;
}

.hot-list li:last-child {
  border-bottom: none;
}

.hot-list li a {
  display: flex;
  align-items: center;
  gap: 8px;
}

.hot-list .rank {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 3px;
  background: #f0f0f0;
  color: var(--text-muted);
  flex-shrink: 0;
}

.hot-list .rank.top {
  background: var(--red);
  color: #fff;
}

.hot-list .hot-title {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* === Responsive === */
@media (max-width: 1024px) {
  .category-grid {
    grid-template-columns: repeat(5, 1fr);
  }
  .product-grid {
    grid-template-columns: repeat(4, 1fr);
  }
  .content-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .category-grid {
    grid-template-columns: repeat(4, 1fr);
  }
  .product-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .home-layout {
    grid-template-columns: 1fr;
  }
  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .header-search {
    display: none;
  }
}

@media (max-width: 480px) {
  .category-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .product-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* === Utility === */
.text-red { color: var(--red); }
.text-green { color: var(--green); }
.text-muted { color: var(--text-muted); }
.text-sm { font-size: 12px; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.text-center { text-align: center; }
