:root {
  --brand: rgb(192, 80, 77);
  --ink: #1f1b1b;
  --muted: #6c6767;
  --surface: #ffffff;
  --line: #e6e0e0;
  --wash: #f7f4f2;
  --accent: #2a5d6a;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: radial-gradient(circle at top, #fff7f6 0%, #f4efec 48%, #eee8e4 100%);
  color: var(--ink);
  font-family: "Microsoft YaHei", Arial, sans-serif;
}

.fred-shell {
  max-width: 1100px;
  margin: 0 auto;
  padding: 40px 24px 60px;
}

.fred-hero {
  text-align: center;
  padding: 30px 20px 36px;
  background: var(--surface);
  border-radius: 28px;
  border: 1px solid var(--line);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.08);
}

.logo-link {
  text-decoration: none;
}

.logo-block {
  margin-bottom: 24px;
}

.brand {
  font-size: 42px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--brand);
  font-family: "Microsoft YaHei", Arial, sans-serif;
}

.brand-sub {
  margin-top: 6px;
  font-size: 16px;
  color: var(--muted);
  letter-spacing: 0.3em;
}

.search-block {
  display: grid;
  gap: 12px;
  justify-items: center;
}

.search-input {
  width: min(680px, 100%);
  padding: 14px 18px;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-size: 16px;
  background: #fff;
}

.search-btn {
  padding: 10px 22px;
  border: none;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 10px 22px rgba(42, 93, 106, 0.25);
}

.search-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 26px rgba(42, 93, 106, 0.25);
}

.search-hint {
  font-size: 13px;
  color: var(--muted);
}

.search-suggestions {
  width: min(680px, 100%);
  display: grid;
  gap: 6px;
}

.suggestion-item {
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
  text-decoration: none;
  color: var(--ink);
  font-size: 14px;
}

.suggestion-item:hover {
  border-color: #d3caca;
  background: #fbfaf9;
}

.suggestion-empty {
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px dashed var(--line);
  color: var(--muted);
  text-align: center;
  font-size: 13px;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 20px;
  margin-top: 32px;
}

.category-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 22px;
  min-height: 200px;
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.05);
}

.category-title {
  margin: 0 0 12px;
  font-size: 20px;
  color: var(--ink);
}

.category-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 8px;
}

.category-link {
  text-decoration: none;
  color: var(--accent);
  font-weight: 600;
}

.category-link:hover {
  color: #1a4048;
}

.search-results {
  margin-top: 32px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 24px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.06);
}

.results-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 16px;
}

.results-title {
  margin: 0;
  font-size: 22px;
}

.results-count {
  color: var(--muted);
  font-size: 14px;
}

.results-list {
  display: grid;
  gap: 14px;
}

.result-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px 18px;
  background: #fbfaf9;
}

.result-name {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--accent);
  text-decoration: none;
}

.result-name:hover {
  color: #1a4048;
}

.result-meta {
  display: grid;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
}

.result-snippet {
  margin: 8px 0 10px;
  font-size: 13px;
  color: #5b5757;
  line-height: 1.5;
}

.result-snippet mark {
  background: rgba(255, 216, 99, 0.6);
  color: inherit;
  padding: 0 2px;
  border-radius: 3px;
}

.empty-snippet {
  color: var(--muted);
}

.empty-state {
  padding: 18px 20px;
  border: 1px dashed var(--line);
  border-radius: 14px;
  color: var(--muted);
  text-align: center;
}

.valuation-shell {
  margin-top: 32px;
  display: grid;
  gap: 22px;
}

.valuation-header {
  background: var(--surface);
  border-radius: 22px;
  border: 1px solid var(--line);
  padding: 20px 24px;
}

.valuation-title {
  margin: 0 0 8px;
  font-size: 24px;
}

.valuation-sub {
  margin: 0;
  color: var(--muted);
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 8px;
}

.breadcrumb-link {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

.breadcrumb-link:hover {
  color: #1a4048;
}

.breadcrumb-current {
  color: var(--ink);
  font-weight: 600;
}

.metric-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.metric-card {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 120px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  text-decoration: none;
  font-size: 18px;
  font-weight: 600;
  color: var(--accent);
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.06);
}

.metric-card:hover {
  color: #1a4048;
}

.indicator-info {
  display: grid;
  gap: 10px;
  background: #fbfaf9;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px 20px;
}

.chart-indicator-name {
  font-weight: 600;
  color: var(--ink);
  margin: 4px 0 12px;
  text-align: left;
}

.indicator-info div {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  color: var(--muted);
}

.indicator-info strong {
  color: var(--ink);
}

.chart-card {
  background: var(--surface);
  border-radius: 22px;
  border: 1px solid var(--line);
  padding: 18px 20px 14px;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.05);
}

.chart-title {
  font-weight: 600;
  margin-bottom: 10px;
}

.erp-controls {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  margin-bottom: 12px;
}

.date-controls {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  margin-bottom: 12px;
}

.date-input {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  font-size: 14px;
}

.download-btn {
  margin-top: 10px;
  border: none;
  background: #f0ebe8;
  color: var(--ink);
  padding: 8px 16px;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.chart-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.chart-editor {
  margin-top: 0;
}

.editor-toggle {
  list-style: none;
  cursor: pointer;
  font-weight: 600;
  color: var(--accent);
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
}

.editor-toggle:hover {
  border-color: #d3caca;
}

.editor-body {
  margin-top: 12px;
  border-top: 1px dashed var(--line);
  padding-top: 12px;
  display: grid;
  gap: 12px;
}

.series-row {
  display: grid;
  grid-template-columns: 1fr 60px 120px 80px 90px;
  gap: 8px;
  align-items: center;
}

.series-label {
  font-size: 14px;
  color: var(--ink);
}

.series-value {
  margin-left: 8px;
  font-size: 12px;
  color: var(--muted);
}

.series-date .series-date-value {
  font-size: 14px;
  color: var(--ink);
}

.series-color {
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0;
}

.series-width {
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--line);
}

.series-caption {
  color: var(--muted);
  font-size: 12px;
  text-align: right;
}

.download-btn:hover {
  background: #e7dfdb;
}

.data-error {
  margin-top: 32px;
  padding: 18px 20px;
  background: #fff3f3;
  border: 1px solid #f2c2c2;
  border-radius: 16px;
  color: #8a1f1f;
}

.sr-only {
  position: absolute;
  left: -10000px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

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

@media (max-width: 720px) {
  .brand {
    font-size: 30px;
  }

  .search-input {
    font-size: 15px;
  }

  .results-header {
    flex-direction: column;
    gap: 6px;
  }
}
