/* ========== 全站公共样式 ========== */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --primary: #1a6b3c;
  --primary-dark: #124d2c;
  --primary-light: #2e9e5a;
  --accent: #f0a500;
  --accent-dark: #c88200;
  --bg: #f5f7f5;
  --bg2: #eaf2ec;
  --text: #1e2a1e;
  --text2: #4a5a4a;
  --white: #fff;
  --border: #c8dbc8;
  --red: #d32f2f;
  --green: #1a8a3c;
  --shadow: 0 2px 12px rgba(26,107,60,0.10);
}

body { font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif; background: var(--bg); color: var(--text); font-size: 14px; }

a { text-decoration: none; color: inherit; }
ul { list-style: none; }
img { max-width: 100%; display: block; }
button { cursor: pointer; font-family: inherit; }

/* ---- 顶部栏 ---- */
.top-bar {
  background: var(--primary-dark);
  color: #c8ecd4;
  font-size: 12px;
  padding: 5px 0;
}
.top-bar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.top-bar a { color: #c8ecd4; margin-left: 14px; }
.top-bar a:hover { color: var(--accent); }

/* ---- Header ---- */
header {
  background: var(--primary);
  box-shadow: 0 2px 8px rgba(0,0,0,0.18);
  position: sticky;
  top: 0;
  z-index: 999;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 0;
  height: 68px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 12px;
}
.logo-icon {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, var(--accent), #fff8e1);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  font-weight: 900;
  color: var(--primary-dark);
  letter-spacing: -1px;
  box-shadow: 0 2px 8px rgba(240,165,0,0.25);
}
.logo-text h1 { color: #fff; font-size: 22px; font-weight: 700; letter-spacing: 1px; }
.logo-text span { color: #c8ecd4; font-size: 11px; letter-spacing: 2px; }

nav ul { display: flex; gap: 2px; }
nav ul li a {
  display: block;
  padding: 8px 16px;
  color: #d8f0e0;
  font-size: 14px;
  border-radius: 6px;
  transition: all .2s;
}
nav ul li a:hover, nav ul li a.active {
  background: rgba(255,255,255,0.15);
  color: #fff;
}

.header-btns { display: flex; gap: 10px; }
.btn-login {
  padding: 7px 18px;
  border: 1.5px solid rgba(255,255,255,0.5);
  color: #fff;
  border-radius: 5px;
  background: transparent;
  font-size: 13px;
  transition: all .2s;
}
.btn-login:hover { background: rgba(255,255,255,0.15); }
.btn-reg {
  padding: 7px 18px;
  background: var(--accent);
  color: var(--primary-dark);
  border-radius: 5px;
  border: none;
  font-size: 13px;
  font-weight: 700;
  transition: all .2s;
}
.btn-reg:hover { background: var(--accent-dark); color: #fff; }

/* ---- 容器 ---- */
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* ---- 通用section标题 ---- */
.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}
.section-title h2 {
  font-size: 19px;
  color: var(--primary-dark);
  font-weight: 700;
  border-left: 4px solid var(--accent);
  padding-left: 10px;
}
.section-title a { font-size: 13px; color: var(--primary); }
.section-title a:hover { color: var(--accent); }

/* ---- 标签 ---- */
.tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 3px;
  font-size: 11px;
  font-weight: 600;
  margin-right: 4px;
}
.tag-buy { background: #e3f6ea; color: #1a8a3c; }
.tag-sell { background: #fff3e0; color: #e65100; }
.tag-mg { background: #e8f5e9; color: var(--primary); }
.tag-hot { background: #ffebee; color: #c62828; }
.tag-new { background: #e3f2fd; color: #1565c0; }

/* ---- 卡片 ---- */
.card {
  background: #fff;
  border-radius: 10px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

/* ---- 按钮通用 ---- */
.btn {
  display: inline-block;
  padding: 8px 20px;
  border-radius: 5px;
  font-size: 13px;
  border: none;
  transition: all .2s;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-accent { background: var(--accent); color: var(--primary-dark); font-weight: 700; }
.btn-accent:hover { background: var(--accent-dark); color: #fff; }
.btn-outline { border: 1.5px solid var(--primary); color: var(--primary); background: transparent; }
.btn-outline:hover { background: var(--primary); color: #fff; }

/* ---- 涨跌颜色 ---- */
.up { color: var(--red); }
.down { color: var(--green); }
.flat { color: #888; }

/* ---- 表格 ---- */
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th {
  background: var(--bg2);
  color: var(--primary-dark);
  padding: 9px 12px;
  text-align: left;
  font-weight: 600;
  border-bottom: 1px solid var(--border);
}
.data-table td {
  padding: 9px 12px;
  border-bottom: 1px solid #f0f0f0;
  vertical-align: middle;
}
.data-table tr:hover td { background: #f9fff9; }

/* ---- 表单 ---- */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; margin-bottom: 5px; color: var(--text2); font-size: 13px; font-weight: 600; }
.form-control {
  width: 100%;
  padding: 9px 12px;
  border: 1.5px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
  outline: none;
  transition: border .2s;
  background: #fff;
  color: var(--text);
  font-family: inherit;
}
.form-control:focus { border-color: var(--primary); }
select.form-control { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%234a5a4a' d='M6 8L0 0h12z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; }
textarea.form-control { resize: vertical; min-height: 90px; }

/* ---- 分页 ---- */
.pagination { display: flex; gap: 6px; justify-content: center; margin-top: 24px; }
.pagination a {
  display: inline-block;
  padding: 6px 13px;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text2);
  font-size: 13px;
}
.pagination a.active, .pagination a:hover { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ---- Footer ---- */
footer {
  background: var(--primary-dark);
  color: #9fccaf;
  margin-top: 48px;
  padding: 40px 0 0;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  padding-bottom: 32px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.footer-brand h3 { color: #fff; font-size: 18px; margin-bottom: 10px; }
.footer-brand p { font-size: 13px; line-height: 1.8; }
.footer-col h4 { color: #d0ecd8; font-size: 14px; margin-bottom: 14px; font-weight: 600; }
.footer-col ul li { margin-bottom: 8px; }
.footer-col ul li a { color: #9fccaf; font-size: 13px; transition: color .2s; }
.footer-col ul li a:hover { color: var(--accent); }
.footer-bottom {
  text-align: center;
  padding: 16px 0;
  font-size: 12px;
  color: #6a9a7a;
}

/* ---- 价格行情小组件 ---- */
.price-ticker {
  background: var(--primary-dark);
  color: #c8ecd4;
  font-size: 12px;
  padding: 5px 0;
  overflow: hidden;
}
.price-ticker-inner {
  display: flex;
  gap: 32px;
  white-space: nowrap;
  animation: ticker 30s linear infinite;
}
.price-ticker-inner span { margin-right: 8px; }
.price-ticker-inner .name { color: #fff; font-weight: 600; }
.price-ticker-inner .val { color: var(--accent); }
@keyframes ticker {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ---- 响应式 ---- */
@media(max-width: 900px) {
  nav ul { gap: 0; }
  nav ul li a { padding: 8px 10px; font-size: 13px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media(max-width: 600px) {
  .header-inner { flex-wrap: wrap; height: auto; padding: 10px 0; }
  nav { width: 100%; }
  nav ul { flex-wrap: wrap; }
  .footer-grid { grid-template-columns: 1fr; }
}

/* ---- 返回顶部按钮 ---- */
.back-to-top {
  position: fixed;
  right: 30px;
  bottom: 30px;
  width: 48px;
  height: 48px;
  background: var(--primary);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  opacity: 0;
  visibility: hidden;
  transition: all .3s;
  z-index: 1000;
}
.back-to-top:hover {
  background: var(--primary-dark);
  transform: translateY(-3px);
}

/* ---- 搜索功能 ---- */
.header-search {
  display: flex;
  align-items: center;
  margin-left: 40px;
}
.header-search input {
  width: 260px;
  padding: 8px 14px;
  border: none;
  border-radius: 20px 0 0 20px;
  font-size: 13px;
  outline: none;
}
.header-search button {
  padding: 8px 16px;
  background: var(--accent);
  border: none;
  border-radius: 0 20px 20px 0;
  cursor: pointer;
  font-size: 16px;
}
