/* ============ 黑龙江粮食交易网（自建版）样式 ============ */
:root {
  --green: #1e6b2a;
  --green-dark: #14521f;
  --green-darker: #0b3a13;
  --gold: #c49a10;
  --gold-light: #eccf6a;
  --bg: #f3f6ee;
  --text: #333;
  --muted: #888;
  --border: #e3e8dc;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: "Microsoft YaHei", "PingFang SC", "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.7;
}
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
img { max-width: 100%; display: block; }
.wrap { width: 1200px; margin: 0 auto; }

/* ---------- 顶部 ---------- */
.topbar {
  background: linear-gradient(180deg, #fffdf5 0%, #fdf6e0 100%);
  border-bottom: 1px solid var(--border);
}
.topbar .wrap { display: flex; align-items: center; justify-content: space-between; height: 96px; }
.logo { display: flex; align-items: center; gap: 12px; }
.logo-icon { height: 60px; width: auto; display: block; }
.logo-text h1 { font-size: 24px; color: var(--green-dark); letter-spacing: 2px; }
.logo-text p { font-size: 12px; color: #9a8f6a; letter-spacing: 4px; }
.search-box { display: flex; width: 340px; height: 40px; border: 2px solid var(--green); border-radius: 20px; overflow: hidden; background: #fff; }
.search-box input { flex: 1; border: none; outline: none; padding: 0 18px; font-size: 14px; }
.search-box button { width: 80px; border: none; background: var(--green); color: #fff; font-size: 15px; cursor: pointer; letter-spacing: 4px; }
.search-box button:hover { background: var(--green-dark); }

/* ---------- 导航 ---------- */
.nav {
  background: linear-gradient(180deg, var(--green) 0%, var(--green-dark) 100%);
  box-shadow: 0 2px 6px rgba(0,0,0,.15);
  position: sticky; top: 0; z-index: 100;
}
.nav .wrap { display: flex; }
.nav-item { position: relative; }
.nav-item > a {
  display: block; padding: 0 34px; height: 52px; line-height: 52px;
  color: #fff; font-size: 16px; letter-spacing: 1px;
}
.nav-item:hover > a, .nav-item.active > a { background: rgba(255,255,255,.14); }
.nav-item.active > a { box-shadow: inset 0 -4px 0 var(--gold); }
.nav-dropdown {
  display: none; position: absolute; left: 0; top: 52px; min-width: 140px;
  background: #fff; box-shadow: 0 6px 16px rgba(0,0,0,.12); border-radius: 0 0 6px 6px; overflow: hidden;
}
.nav-item:hover .nav-dropdown { display: block; }
.nav-dropdown a { display: block; padding: 10px 20px; font-size: 14px; color: var(--text); white-space: nowrap; }
.nav-dropdown a:hover { background: #f0f7f1; color: var(--green); }

/* ---------- 首页主体 ---------- */
.main { padding: 18px 0 30px; }
.card { background: #fff; border-radius: 8px; box-shadow: 0 1px 6px rgba(0,0,0,.06); }
.section-title {
  display: flex; align-items: center; gap: 8px;
  font-size: 17px; font-weight: 700; color: var(--green-dark);
  padding: 12px 16px; border-bottom: 2px solid var(--border);
}
.section-title .bar { width: 4px; height: 18px; background: var(--gold); border-radius: 2px; }
.section-title .more { margin-left: auto; font-size: 12px; font-weight: 400; color: var(--muted); }
.section-title .more:hover { color: var(--green); }

/* 轮播 + 公告栏 */
.hero { display: grid; grid-template-columns: 7fr 5fr; gap: 18px; }
.carousel { position: relative; height: 320px; border-radius: 8px; overflow: hidden; }
.carousel img { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; opacity: 0; transition: opacity .8s; }
.carousel img.on { opacity: 1; }
.carousel-caption {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 30px 20px 12px;
  background: linear-gradient(180deg, transparent, rgba(0,0,0,.65));
  color: #fff; font-size: 15px;
}
.carousel-dots { position: absolute; right: 14px; bottom: 12px; display: flex; gap: 6px; }
.carousel-dots i { width: 8px; height: 8px; border-radius: 50%; background: rgba(255,255,255,.45); cursor: pointer; }
.carousel-dots i.on { background: var(--gold); }

.tabs-card { display: flex; flex-direction: column; }
/* 锁定版块高度，避免内容多少/标题长短造成版面跳动 */
.hero .tabs-card { height: 320px; }
.duo .tabs-card { height: 300px; }
.tabs-card, .news-list { overflow: hidden; }
.chart-price .card { height: 360px; overflow: hidden; }
.price-scroll { height: 262px; overflow-y: auto; margin: 8px 0 4px; }
.price-table thead th { position: sticky; top: 0; }
.tabs-head { display: flex; border-bottom: 2px solid var(--green); padding: 0 8px; }
.tabs-head span {
  padding: 12px 18px 8px; font-size: 16px; font-weight: 700; color: var(--muted); cursor: pointer; position: relative;
}
.tabs-head span.on { color: var(--green-dark); }
.tabs-head span.on::after { content: ""; position: absolute; left: 14px; right: 14px; bottom: -2px; height: 3px; background: var(--gold); }
.tabs-head .more-link { margin-left: auto; align-self: center; font-size: 12px; color: var(--muted); }
.tabs-head .more-link:hover { color: var(--green); }
.news-list { padding: 6px 16px 12px; flex: 1; }
.news-list li { display: flex; align-items: center; gap: 8px; padding: 7px 0; border-bottom: 1px dashed var(--border); }
.news-list li:last-child { border-bottom: none; }
.news-list li::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--gold); flex: none; }
.news-list li a { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.news-list li a:hover { color: var(--green); }
.news-list li time { color: var(--muted); font-size: 12px; flex: none; }

/* 快捷入口 + 交易服务卡 */
.quick-row { display: grid; grid-template-columns: 8fr 4fr; gap: 18px; margin-top: 18px; }
.quick-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; padding: 16px; }
.quick-tile {
  border-radius: 8px; padding: 16px 12px 12px; text-align: center; cursor: pointer;
  color: #fff; transition: transform .2s, box-shadow .2s; position: relative;
}
.quick-tile:hover { transform: translateY(-3px); box-shadow: 0 6px 14px rgba(0,0,0,.15); }
.quick-tile .ico { font-size: 26px; }
.quick-tile .t { font-size: 15px; font-weight: 700; margin-top: 6px; }
.quick-tile .subs { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 8px; margin-top: 8px; }
.quick-tile .subs a { font-size: 12px; opacity: .92; border-bottom: 1px dashed rgba(255,255,255,.5); }
.quick-tile .subs a:hover { opacity: 1; }
.q-green { background: linear-gradient(135deg, #35a06b, #187a4b); }
.q-orange { background: linear-gradient(135deg, #f7b733, #e08e0b); }
.q-blue { background: linear-gradient(135deg, #4aa3df, #2273b2); }
.q-teal { background: linear-gradient(135deg, #3bb3a9, #1b8a80); }
.q-red { background: linear-gradient(135deg, #e2695c, #bf4437); }
.q-purple { background: linear-gradient(135deg, #9b7ed9, #7451c0); }
.q-cyan { background: linear-gradient(135deg, #45bcd8, #2193b0); }
.q-gold { background: linear-gradient(135deg, #e6c25a, #c39a2b); }

.service-card { padding-bottom: 8px; }
.service-card .row { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px dashed var(--border); }
.service-card .row:last-child { border-bottom: none; }
.service-card .row h4 { width: 92px; font-size: 15px; color: var(--green-dark); }
.service-card .row a { font-size: 13px; color: #555; border: 1px solid var(--border); border-radius: 14px; padding: 3px 12px; }
.service-card .row a:hover { color: var(--green); border-color: var(--green); }

/* 双栏资讯 */
.duo { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 18px; }

/* 指数图表 + 价格行情 */
.chart-price { display: grid; grid-template-columns: 7fr 5fr; gap: 18px; margin-top: 18px; }
.chart-box { padding: 10px 12px 14px; }
.chart-tabs { display: flex; gap: 10px; margin: 6px 4px 10px; }
.chart-tabs span { font-size: 13px; padding: 2px 14px; border-radius: 12px; background: #f0f2ec; color: #666; cursor: pointer; }
.chart-tabs span.on { background: var(--green); color: #fff; }
.chart-tabs .unit { margin-left: auto; font-size: 12px; color: var(--muted); align-self: center; }
canvas#lineChart { width: 100%; height: 260px; }
.price-table { width: 100%; border-collapse: collapse; margin: 8px 0 4px; }
.price-table th { background: #f0f7f1; color: var(--green-dark); font-weight: 600; }
.price-table th, .price-table td { border: 1px solid var(--border); padding: 8px 6px; text-align: center; font-size: 13px; }
.price-table .up { color: #d43f3a; }
.price-table .down { color: #1a9e57; }
.week-tag { font-size: 12px; color: var(--muted); padding: 4px 16px 0; }

/* 友情链接 */
.links { margin-top: 18px; padding-bottom: 8px; }
.links-body { display: flex; flex-wrap: wrap; gap: 12px; padding: 14px 16px; }
.links-body a {
  padding: 6px 18px; border: 1px solid var(--border); border-radius: 18px; font-size: 13px; color: #555; background: #fbfdf9;
}
.links-body a:hover { color: var(--green); border-color: var(--green); }

/* ---------- 页脚 ---------- */
.footer { background: linear-gradient(180deg, var(--green-dark), var(--green-darker)); color: #cfe6d6; margin-top: 10px; }
.footer .wrap { display: flex; justify-content: space-between; padding: 26px 0; gap: 30px; }
.footer h4 { color: #fff; font-size: 16px; margin-bottom: 10px; }
.footer p { font-size: 13px; line-height: 2; }
.footer a:hover { color: var(--gold-light); }
.qr-box { width: 96px; height: 96px; background: #fff; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 12px; color: #999; text-align: center; }
.copyright { border-top: 1px solid rgba(255,255,255,.12); text-align: center; font-size: 12px; padding: 12px 0; color: #9dc4aa; }

/* ---------- 列表页 ---------- */
.page-banner {
  height: 160px; border-radius: 8px; margin: 18px auto 0;
  background: linear-gradient(120deg, var(--green-dark) 0%, var(--green) 55%, var(--gold) 130%);
  display: flex; align-items: center; padding: 0 40px; color: #fff;
}
.page-banner h2 { font-size: 26px; letter-spacing: 2px; }
.page-banner p { font-size: 13px; opacity: .85; margin-top: 4px; }
.crumbs { font-size: 13px; color: var(--muted); padding: 14px 4px; }
.crumbs a:hover { color: var(--green); }
.list-card { padding: 8px 20px 20px; }
.list-item { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-bottom: 1px dashed var(--border); height: 92px; overflow: hidden; }
.list-item .date {
  flex: none; width: 66px; height: 60px; border-radius: 6px; background: #f0f7f1; text-align: center; padding-top: 6px;
}
.list-item .date b { display: block; font-size: 20px; color: var(--green-dark); }
.list-item .date span { font-size: 12px; color: var(--muted); }
.list-item .txt { flex: 1; min-width: 0; }
.list-item .txt a { display: block; font-size: 15px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-item .txt a:hover { color: var(--green); }
.list-item .txt p { font-size: 13px; color: var(--muted); margin-top: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pager { display: flex; justify-content: center; gap: 8px; padding: 20px 0 4px; }
.pager button {
  min-width: 34px; height: 34px; border: 1px solid var(--border); background: #fff; border-radius: 4px; cursor: pointer; font-size: 13px;
}
.pager button.on { background: var(--green); color: #fff; border-color: var(--green); }
.pager button:disabled { opacity: .4; cursor: default; }
.empty { text-align: center; color: var(--muted); padding: 50px 0; }

/* ---------- 文章详情页 ---------- */
.article { padding: 26px 40px 36px; }
.article h1 { font-size: 22px; text-align: center; color: #222; line-height: 1.5; }
.article-meta { text-align: center; color: var(--muted); font-size: 13px; margin: 12px 0 20px; padding-bottom: 16px; border-bottom: 1px solid var(--border); }
.article-body { font-size: 15px; line-height: 2; color: #333; }
.article-body p { margin: 10px 0; }
.article-nav { margin-top: 30px; padding-top: 16px; border-top: 1px dashed var(--border); font-size: 14px; }
.article-nav p { margin: 6px 0; }
.article-nav a { color: var(--green); }

/* ---------- 通用页 ---------- */
.plain-card { padding: 26px 36px 36px; }
.plain-card h2 { color: var(--green-dark); font-size: 20px; margin-bottom: 14px; }
.plain-card p { margin: 10px 0; font-size: 15px; line-height: 2; }
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-top: 16px; }
.contact-grid .block { background: #f7faf4; border-radius: 8px; padding: 20px 24px; }
.contact-grid .block h3 { color: var(--green-dark); margin-bottom: 8px; font-size: 16px; }
.org-list li { padding: 10px 0; border-bottom: 1px dashed var(--border); font-size: 15px; }
.org-list li b { color: var(--green-dark); display: inline-block; width: 110px; }

/* ---------- 响应式：平板与手机 ---------- */
.nav-toggle {
  display: none; position: absolute; right: 10px; top: 8px; z-index: 20;
  height: 36px; padding: 0 14px; border: none; border-radius: 6px;
  background: rgba(255,255,255,.18); color: #fff; font-size: 14px; cursor: pointer;
  white-space: nowrap;
}

@media (max-width: 1240px) { .wrap { width: 96%; } }

@media (max-width: 900px) {
  /* 顶部 */
  .topbar .wrap { height: 68px; }
  .logo-icon { height: 44px; width: auto; }
  .logo-text h1 { font-size: 17px; letter-spacing: 1px; }
  .logo-text p { font-size: 9px; letter-spacing: 2px; }
  .search-box { display: none; }

  /* 导航：汉堡菜单 */
  .nav .wrap { flex-direction: column; align-items: stretch; display: none; }
  body.nav-open .nav .wrap { display: flex; }
  .nav { position: sticky; top: 0; min-height: 52px; }
  .nav-toggle { display: block; }
  .nav-bar { position: relative; }
  .nav-item > a { height: 46px; line-height: 46px; padding: 0 18px; font-size: 15px; border-bottom: 1px solid rgba(255,255,255,.08); }
  .nav-item.active > a { box-shadow: inset 3px 0 0 var(--gold); }
  .nav-item.has-sub > a::after { content: "▾"; float: right; font-size: 12px; opacity: .8; }
  .nav-dropdown { position: static; display: none; box-shadow: none; border-radius: 0; background: rgba(0,0,0,.15); }
  .nav-item.open .nav-dropdown { display: block; }
  .nav-dropdown a { color: #d9ead9; padding: 9px 18px 9px 34px; font-size: 14px; }
  .nav-dropdown a:hover { background: rgba(255,255,255,.08); color: #fff; }

  /* 首页版块纵向排列 */
  .main { padding-top: 12px; }
  .hero, .quick-row, .duo, .chart-price, .contact-grid { grid-template-columns: 1fr; }
  .carousel { height: 210px; }
  .carousel-caption { font-size: 13px; padding: 20px 14px 10px; }
  .quick-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; padding: 12px; }
  .quick-tile { padding: 12px 8px 10px; }
  .quick-tile .ico { font-size: 22px; }
  .quick-tile .t { font-size: 14px; }
  .quick-tile .subs a { font-size: 11px; }
  .duo { margin-top: 14px; }
  .chart-price { margin-top: 14px; }
  .hero .tabs-card, .duo .tabs-card, .chart-price .card { height: auto; }
  .price-scroll { height: auto; max-height: 320px; }
  .links { margin-top: 14px; }
  canvas#lineChart { height: 200px; }
  .chart-tabs { flex-wrap: wrap; }
  .price-table th, .price-table td { padding: 6px 4px; font-size: 12px; }

  /* 列表页 */
  .page-banner { height: 110px; padding: 0 20px; }
  .page-banner h2 { font-size: 20px; }
  .list-card { padding: 6px 12px 14px; }
  .list-item { gap: 10px; padding: 12px 0; height: 76px; }
  .list-item .date { width: 54px; height: 50px; padding-top: 4px; }
  .list-item .date b { font-size: 16px; }
  .list-item .txt a { font-size: 14px; }
  .list-item .txt p { font-size: 12px; }

  /* 详情页 */
  .article { padding: 18px 16px 26px; }
  .article h1 { font-size: 18px; }
  .article-body { font-size: 15px; }

  /* 通用页 */
  .plain-card { padding: 18px 16px 24px; }
  .org-list li b { width: 80px; }

  /* 页脚 */
  .footer .wrap { flex-direction: column; gap: 14px; padding: 20px 0; }
}

@media (max-width: 480px) {
  body { font-size: 13px; }
  .quick-grid { grid-template-columns: repeat(2, 1fr); }
  .news-list li a { font-size: 13px; }
  .news-list li time { font-size: 11px; }
  .section-title { font-size: 15px; padding: 10px 12px; }
  .tabs-head span { padding: 10px 12px 7px; font-size: 14px; }
  .crumbs { padding: 10px 2px; font-size: 12px; }
  .pager button { min-width: 30px; height: 30px; }
}
