/* ===== Price Page CSS ===== */

/* ===== CSS Variables ===== */
:root {
  --color-primary-dark: #1B5E20;
  --color-primary: #2E7D32;
  --color-primary-light: #43A047;
  --color-primary-lighter: #66BB6A;
  --color-primary-lightest: #E8F5E9;
  --color-white: #FFFFFF;
  --color-gray-50: #FAFAFA;
  --color-gray-100: #F5F5F5;
  --color-gray-200: #EEEEEE;
  --color-gray-300: #E0E0E0;
  --color-gray-400: #BDBDBD;
  --color-gray-500: #9E9E9E;
  --color-gray-600: #757575;
  --color-gray-700: #616161;
  --color-gray-800: #424242;
  --color-gray-900: #212121;
  --color-success: #4CAF50;
  --color-warning: #FF9800;
  --color-error: #EF5350;
  --color-info: #2196F3;
  --font-primary: 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --border-radius: 12px;
  --border-radius-lg: 16px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.12);
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== Reset ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-primary);
  font-size: 16px;
  line-height: 1.6;
  color: var(--color-gray-800);
  background-color: var(--color-white);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

a { text-decoration: none; color: inherit; }
ul { list-style: none; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
input { font-family: inherit; }

/* ===== Header ===== */
.header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.05);
  z-index: 1000;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 52px;
  width: 100%;
  padding: 0 8rem;
  max-width: none;
  margin: 0;
}

.nav__logo {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav__logo-text {
  font-size: 18px;
  font-weight: 700;
  color: var(--color-gray-900);
}

.nav__list {
  display: flex;
  gap: 32px;
}

.nav__link {
  font-weight: 500;
  color: var(--color-gray-700);
  padding: 8px 0;
  position: relative;
}

.nav__link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--color-primary);
  transition: var(--transition);
}

.nav__link:hover { color: var(--color-primary); }
.nav__link:hover::after { width: 100%; }

.nav__toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 8px;
}

.nav__toggle-bar {
  width: 24px;
  height: 2px;
  background-color: var(--color-gray-800);
  border-radius: 2px;
}

/* ===== Hero Section ===== */
.price-hero {
  position: relative;
  width: 100%;
  height: 400px;
  display: flex;
  align-items: center;
  overflow: hidden;
  margin-top: 52px;
}

.price-hero__bg {
  position: absolute;
  inset: 0;
  z-index: -1;
}

.price-hero__bg-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.price-hero__bg-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(27, 94, 32, 0.9) 0%, rgba(46, 125, 50, 0.8) 100%);
}

.price-hero__container {
  text-align: center;
}

.price-hero__content {
  animation: fadeInUp 0.8s ease-out;
}

.price-hero__badge {
  display: inline-block;
  padding: 6px 16px;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50px;
  color: white;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 16px;
}

.price-hero__title {
  font-size: 48px;
  font-weight: 700;
  color: white;
  margin-bottom: 8px;
  letter-spacing: -1px;
}

.price-hero__subtitle {
  font-size: 24px;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 12px;
}

.price-hero__subtitle .highlight {
  color: #A5D6A7;
  font-weight: 600;
}

.price-hero__description {
  font-size: 16px;
  color: rgba(255, 255, 255, 0.8);
  max-width: 500px;
  margin: 0 auto 20px;
}

.price-hero__meta {
  display: flex;
  justify-content: center;
  gap: 24px;
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 6px;
  color: rgba(255, 255, 255, 0.8);
  font-size: 14px;
}

/* ===== Section Headers ===== */
.section-header {
  text-align: center;
  margin-bottom: 40px;
}

.section-tag {
  display: inline-block;
  padding: 6px 16px;
  background: var(--color-primary-lightest);
  color: var(--color-primary);
  font-size: 14px;
  font-weight: 600;
  border-radius: 50px;
  margin-bottom: 12px;
}

.section-title {
  font-size: 32px;
  font-weight: 700;
  color: var(--color-gray-900);
  margin-bottom: 8px;
}

.section-subtitle {
  font-size: 16px;
  color: var(--color-gray-600);
}

/* ===== Search Section ===== */
.search-section {
  padding: 60px 0;
  background: var(--color-gray-50);
}

.search-form {
  background: white;
  border-radius: var(--border-radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-md);
  margin-bottom: 24px;
}

.search-form__main {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
}

.search-input-group {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
}

.search-input-group svg {
  position: absolute;
  left: 16px;
  color: var(--color-gray-400);
  pointer-events: none;
}

.search-input {
  width: 100%;
  padding: 14px 16px 14px 48px;
  border: 2px solid var(--color-gray-200);
  border-radius: var(--border-radius);
  font-size: 16px;
  transition: var(--transition);
  background: var(--color-gray-50);
}

.search-input:focus {
  outline: none;
  border-color: var(--color-primary);
  background: white;
  box-shadow: 0 0 0 4px rgba(46, 125, 50, 0.1);
}

.search-clear {
  position: absolute;
  right: 16px;
  color: var(--color-gray-400);
  padding: 4px;
  transition: var(--transition);
}

.search-clear:hover { color: var(--color-gray-600); }

.search-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  background: linear-gradient(135deg, var(--color-primary-light), var(--color-primary));
  color: white;
  border-radius: var(--border-radius);
  font-size: 16px;
  font-weight: 500;
  transition: var(--transition);
  box-shadow: 0 4px 15px rgba(46, 125, 50, 0.3);
}

.search-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(46, 125, 50, 0.4);
}

/* Category Filter */
.category-filter {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.category-filter__label {
  font-weight: 500;
  color: var(--color-gray-700);
  white-space: nowrap;
}

.category-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.category-chip {
  padding: 8px 16px;
  border: 1px solid var(--color-gray-200);
  border-radius: 50px;
  font-size: 14px;
  color: var(--color-gray-600);
  background: white;
  transition: var(--transition);
}

.category-chip:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.category-chip.active {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: white;
}

/* Date Range Filter */
.date-range-filter {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
}

.date-range-filter__label {
  font-weight: 500;
  color: var(--color-gray-700);
}

.date-select {
  padding: 8px 32px 8px 12px;
  border: 1px solid var(--color-gray-200);
  border-radius: var(--border-radius);
  font-size: 14px;
  background: white;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23757575' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}

.date-select:focus {
  outline: none;
  border-color: var(--color-primary);
}

/* ===== Search Results ===== */
.search-results {
  background: white;
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.results-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  background: var(--color-gray-50);
  border-bottom: 1px solid var(--color-gray-200);
}

.results-count {
  font-size: 14px;
  color: var(--color-gray-600);
}

.results-count strong {
  color: var(--color-primary);
  font-weight: 600;
}

.btn-export {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border: 1px solid var(--color-gray-200);
  border-radius: var(--border-radius);
  font-size: 14px;
  color: var(--color-gray-600);
  background: white;
  transition: var(--transition);
}

.btn-export:not(:disabled):hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.btn-export:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Results Table */
.results-table-container {
  overflow-x: auto;
}

.results-table {
  width: 100%;
  border-collapse: collapse;
}

.results-table th {
  padding: 14px 16px;
  background: var(--color-gray-100);
  font-weight: 600;
  font-size: 14px;
  color: var(--color-gray-700);
  text-align: left;
  white-space: nowrap;
}

.results-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--color-gray-100);
  font-size: 14px;
}

.results-table tbody tr:hover {
  background: var(--color-primary-lightest);
}

.col-index { width: 60px; text-align: center; color: var(--color-gray-400); }
.col-name { min-width: 150px; font-weight: 500; color: var(--color-gray-900); }
.col-category { width: 80px; }
.col-lowprice, .col-highprice, .col-avgprice { width: 100px; text-align: right; font-family: 'SF Mono', monospace; }
.col-unit { width: 80px; color: var(--color-gray-500); }
.col-date { width: 120px; color: var(--color-gray-500); }

.category-tag {
  display: inline-block;
  padding: 2px 8px;
  background: var(--color-gray-100);
  border-radius: 4px;
  font-size: 12px;
  color: var(--color-gray-600);
}

.price-value {
  font-weight: 600;
  color: var(--color-primary);
}

.price-up { color: var(--color-error); }
.price-down { color: var(--color-success); }

/* Empty State */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--color-gray-400);
}

.empty-state svg {
  margin-bottom: 16px;
  opacity: 0.5;
}

.empty-state p {
  font-size: 16px;
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  padding: 16px 24px;
  border-top: 1px solid var(--color-gray-200);
}

.pagination-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border: 1px solid var(--color-gray-200);
  border-radius: var(--border-radius);
  font-size: 14px;
  color: var(--color-gray-600);
  background: white;
  transition: var(--transition);
}

.pagination-btn:not(:disabled):hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.pagination-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.pagination-info {
  font-size: 14px;
  color: var(--color-gray-600);
}

/* ===== Trends Section ===== */
.trends-section {
  padding: 60px 0;
  background: white;
}

.trends-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.trend-card {
  background: white;
  border: 1px solid var(--color-gray-200);
  border-radius: var(--border-radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.trend-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-4px);
}

.trend-card__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.trend-card__name {
  font-weight: 600;
  color: var(--color-gray-900);
}

.trend-card__price {
  font-weight: 600;
  color: var(--color-primary);
}

.trend-card__chart {
  height: 120px;
  margin-bottom: 12px;
}

.trend-card__meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.trend-change {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 14px;
  font-weight: 600;
}

.trend-up { color: var(--color-error); }
.trend-down { color: var(--color-success); }
.trend-stable { color: var(--color-gray-500); }

.trend-period {
  font-size: 12px;
  color: var(--color-gray-400);
}

/* ===== Stats Section ===== */
.stats-section {
  padding: 60px 0;
  background: var(--color-gray-50);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

.stat-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 24px;
  background: white;
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-sm);
}

.stat-card__icon {
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-primary-lightest);
  border-radius: var(--border-radius);
  color: var(--color-primary);
  flex-shrink: 0;
}

.stat-card__value {
  font-size: 28px;
  font-weight: 700;
  color: var(--color-gray-900);
  display: block;
}

.stat-card__label {
  font-size: 14px;
  color: var(--color-gray-500);
}

/* ===== Footer ===== */
.footer {
  padding: 48px 0 24px;
  background: var(--color-gray-900);
  color: white;
}

.footer__top {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 48px;
  padding-bottom: 32px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 24px;
}

.footer__logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  font-size: 18px;
  font-weight: 700;
}

.footer__desc {
  color: var(--color-gray-400);
  font-size: 14px;
  line-height: 1.6;
}

.footer__links {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 32px;
}

.footer__column h4 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 12px;
  color: white;
}

.footer__column ul {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.footer__column a {
  color: var(--color-gray-400);
  font-size: 14px;
}

.footer__column a:hover { color: white; }

.footer__bottom {
  text-align: center;
  font-size: 14px;
  color: var(--color-gray-500);
}

/* ===== Animations ===== */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===== Responsive ===== */
@media (max-width: 1024px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .trends-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .nav { padding: 0 16px; height: 56px; }
  .nav__list { display: none; }
  .nav__toggle { display: flex; }

  .price-hero { margin-top: 56px; height: 300px; }
  .price-hero__title { font-size: 32px; }
  .price-hero__subtitle { font-size: 18px; }
  .price-hero__meta { flex-direction: column; gap: 8px; }

  .search-form__main { flex-direction: column; }
  .search-btn { width: 100%; justify-content: center; }

  .category-filter { flex-direction: column; align-items: flex-start; }
  .category-chips { width: 100%; }

  .results-header { flex-direction: column; gap: 12px; }
  .results-table { font-size: 12px; }
  .results-table th, .results-table td { padding: 10px 8px; }

  .stats-grid { grid-template-columns: 1fr; }

  .footer__top { grid-template-columns: 1fr; }
}
