/* ================================================
   今日油价查询 - 资讯站风格
   ================================================ */

/* 基础重置 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --color-primary: #2196F3;
  --color-primary-dark: #1976D2;
  --color-text: #333;
  --color-text-secondary: #666;
  --color-text-light: #999;
  --color-border: #e0e0e0;
  --color-bg: #f5f5f5;
  --color-bg-white: #fff;
  --color-down: #e53935;
  --color-up: #43a047;
  --color-orange: #ff6600;
  --font-size-base: 14px;
  --font-size-large: 16px;
  --font-size-title: 18px;
  --font-size-h1: 22px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: var(--font-size-base);
  line-height: 1.6;
  color: var(--color-text);
  background: var(--color-bg);
}

.container {
  max-width: 800px;
  margin: 0 auto;
  padding: 16px;
}

/* ---------- 顶部标题区 ---------- */
.page-header {
  background: var(--color-bg-white);
  padding: 16px 20px;
  border-radius: 4px;
  border-bottom: 2px solid var(--color-primary);
  margin-bottom: 16px;
}

.main-title {
  font-size: var(--font-size-h1);
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 8px;
}

.meta-info {
  display: flex;
  gap: 16px;
  color: var(--color-text-light);
  font-size: 12px;
}

.update-time::before {
  content: "更新时间：";
}

.source::before {
  content: "来源：";
}

/* ---------- 导航栏 ---------- */
.page-nav {
  background: var(--color-primary);
  border-radius: 4px;
  padding: 0;
  margin-bottom: 16px;
}

.nav-list {
  display: flex;
  list-style: none;
  gap: 0;
  overflow-x: auto;
}

.nav-list::-webkit-scrollbar {
  display: none;
}

.nav-list li {
  flex: 1;
  min-width: 80px;
}

.nav-list a {
  display: block;
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  text-decoration: none;
  text-align: center;
  transition: background 0.2s ease;
}

.nav-list a:hover {
  background: var(--color-primary-dark);
}

.nav-list li:not(:last-child) a {
  border-right: 1px solid rgba(255,255,255,0.2);
}

/* ---------- 通用区块 ---------- */
.section {
  background: var(--color-bg-white);
  padding: 16px 20px;
  border-radius: 4px;
  margin-bottom: 16px;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: var(--font-size-title);
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 14px;
}

.title-bar {
  display: block;
  width: 4px;
  height: 18px;
  background: var(--color-orange);
  border-radius: 2px;
}

/* ---------- 数据表格 ---------- */
.table-container {
  border: 1px solid var(--color-border);
  border-radius: 4px;
  overflow: hidden;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--font-size-base);
}

.data-table thead {
  background: var(--color-primary);
  color: #fff;
}

.data-table th {
  padding: 10px 12px;
  text-align: center;
  font-weight: 600;
  white-space: nowrap;
}

.data-table th:first-child {
  text-align: left;
}

.data-table tbody tr {
  border-bottom: 1px solid #f0f0f0;
  transition: background 0.15s ease;
}

.data-table tbody tr:last-child {
  border-bottom: none;
}

.data-table tbody tr:hover {
  background: #f8f9fa;
}

.data-table td {
  padding: 10px 12px;
  text-align: center;
  color: var(--color-text);
}

.data-table td:first-child {
  text-align: left;
  font-weight: 500;
}

.data-table td:nth-child(2) {
  font-weight: 600;
  color: var(--color-primary-dark);
}

/* 涨跌颜色 */
.price-up {
  color: var(--color-up);
  font-weight: 600;
}

.price-down {
  color: var(--color-down);
  font-weight: 600;
}

/* 表尾说明 */
.table-footer {
  padding: 8px 12px;
  background: #f8f9fa;
  color: var(--color-text-light);
  font-size: 12px;
  text-align: center;
  border-top: 1px solid var(--color-border);
}

/* ---------- 调价时间表网格 ---------- */
.schedule-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
}

.schedule-item {
  background: var(--color-primary);
  border-radius: 4px;
  padding: 12px 8px;
  text-align: center;
}

.schedule-item .date {
  color: #fff;
  font-weight: 600;
  font-size: 14px;
}

/* ---------- 新闻内容 ---------- */
.news-content {
  color: var(--color-text);
  line-height: 1.8;
  font-size: var(--font-size-base);
}

.news-content p {
  text-indent: 2em;
}

/* ---------- 走势图 ---------- */
.chart-wrapper {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.chart-box {
  background: #f8f9fa;
  border-radius: 4px;
  padding: 12px;
}

.chart-box h4 {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 10px;
  text-align: center;
}

.chart-box img {
  width: 100%;
  max-width: 500px;
  height: auto;
  display: block;
  margin: 0 auto;
  border-radius: 4px;
}

/* 当前价格高亮 */
.price-current {
  font-weight: 700;
  color: var(--color-primary-dark) !important;
}

/* ---------- 侧边栏 ---------- */
.sidebar {
  background: var(--color-bg-white);
  padding: 16px 20px;
  border-radius: 4px;
}

/* ---------- 刷新按钮 ---------- */
.refresh-btn {
  background: var(--color-primary);
  color: #fff;
  border: none;
  padding: 6px 14px;
  border-radius: 4px;
  font-size: 12px;
  cursor: pointer;
  margin-left: 10px;
  transition: background 0.2s;
}

.refresh-btn:hover {
  background: var(--color-primary-dark);
}

/* ---------- 更新状态 ---------- */
.update-status {
  display: none;
  background: #e3f2fd;
  color: var(--color-primary);
  padding: 8px 12px;
  border-radius: 4px;
  font-size: 13px;
  margin-top: 10px;
  text-align: center;
}

.sidebar-title {
  font-size: var(--font-size-large);
  font-weight: 700;
  color: var(--color-text);
  padding-bottom: 10px;
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 10px;
}

.news-list {
  list-style: none;
}

.news-list li {
  padding: 8px 0;
  border-bottom: 1px dashed var(--color-border);
  display: flex;
  align-items: flex-start;
  gap: 6px;
}

.news-list li:last-child {
  border-bottom: none;
}

.news-list li::before {
  content: "●";
  color: var(--color-primary);
  font-size: 8px;
  margin-top: 6px;
  flex-shrink: 0;
}

.news-list a {
  color: var(--color-text);
  text-decoration: none;
  line-height: 1.5;
  font-size: 13px;
  transition: color 0.2s;
}

.news-list a:hover {
  color: var(--color-primary);
}

.tag-new {
  display: inline-block;
  background: var(--color-down);
  color: #fff;
  font-size: 10px;
  padding: 1px 5px;
  border-radius: 2px;
  margin-right: 4px;
  flex-shrink: 0;
}

/* ---------- 说明信息框 ---------- */
.info-box {
  background: #f8f9fa;
  border-radius: 4px;
  padding: 14px 16px;
  font-size: 13px;
  line-height: 1.8;
  color: var(--color-text-secondary);
}

.info-box p {
  margin: 4px 0;
}

/* ---------- 当前行高亮 ---------- */
tr.current {
  background: #fff8e1;
}

tr.current td {
  font-weight: 600;
  color: var(--color-orange);
}

.badge-new {
  display: inline-block;
  background: var(--color-down);
  color: #fff;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 3px;
  margin-left: 8px;
  font-weight: normal;
}

/* ---------- 页脚 ---------- */
.page-footer {
  background: var(--color-bg-white);
  padding: 16px;
  text-align: center;
  color: var(--color-text-light);
  font-size: 12px;
  border-radius: 4px;
  margin-top: 16px;
}

.page-footer p {
  margin: 4px 0;
}

/* ---------- 骨架屏 ---------- */
.skeleton {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--color-bg);
  z-index: 9999;
  padding: 40px;
}

.skeleton-title {
  height: 28px;
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 4px;
  margin-bottom: 16px;
}

.skeleton-line {
  height: 14px;
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 4px;
  margin-bottom: 10px;
  width: 60%;
}

.skeleton-table {
  height: 180px;
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 4px;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ---------- 响应式 ---------- */
@media (max-width: 600px) {
  .container {
    padding: 10px;
  }

  .page-header,
  .section,
  .sidebar,
  .page-footer {
    padding: 14px;
  }

  .main-title {
    font-size: 18px;
  }

  .section-title {
    font-size: 15px;
  }

  .meta-info {
    flex-direction: column;
    gap: 2px;
  }

  .schedule-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .schedule-item .date {
    font-size: 12px;
  }

  /* 表格横向滚动 */
  .table-container {
    overflow-x: auto;
  }

  .data-table {
    min-width: 420px;
  }
}

@media (max-width: 400px) {
  .schedule-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .nav-list a {
    padding: 10px 8px;
    font-size: 13px;
  }
}

@media (max-width: 600px) {
  .chart-wrapper {
    grid-template-columns: 1fr;
  }

  .chart-box img {
    max-width: 100%;
  }
}
