﻿*,
*:before,
*:after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 14px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  line-height: 1.6;
  color: #1a1a1a;
  background: #fff;
}

a {
  color: #e65100;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid #f0f0f0;
  backdrop-filter: blur(16px);
}

.header-inner {
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.logo,
.footer-brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #1a1a1a;
  font-weight: 700;
}

.logo-icon,
.footer-brand-icon {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: #e65100;
  color: #fff;
  font-size: 13px;
  letter-spacing: 0;
}

.logo-text {
  font-size: 18px;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  height: 36px;
  padding: 0 12px;
  border-radius: 8px;
  color: #666;
  font-weight: 500;
}

.nav-link:hover,
.nav-link.active {
  color: #e65100;
  background: #fff3e0;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-avatar,
.group-entry-btn {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #eeeeee;
  border-radius: 999px;
  background: #fff;
  color: #666;
  font-weight: 700;
}

.main-content {
  min-height: 70vh;
}

.page {
  padding: 28px 0 36px;
}

.hero-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 420px;
  gap: 24px;
  align-items: stretch;
  margin-bottom: 22px;
  padding: 28px;
  border: 1px solid #f0f0f0;
  border-radius: 16px;
  background: linear-gradient(135deg, #fff 0%, #fff8f2 100%);
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  margin-bottom: 8px;
  color: #e65100;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.page-title {
  font-size: 32px;
  line-height: 1.25;
  font-weight: 700;
}

.page-desc {
  max-width: 680px;
  margin-top: 8px;
  color: #666;
  font-size: 15px;
}

.hero-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.hero-metric-card {
  min-height: 98px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  padding: 16px;
  border: 1px solid #f0f0f0;
  border-radius: 12px;
  background: #fff;
}

.hero-metric-card.accent {
  background: #e65100;
  color: #fff;
  border-color: #e65100;
}

.hero-metric-value {
  font-size: 26px;
  font-weight: 800;
}

.hero-metric-label {
  color: #777;
  font-size: 12px;
}

.hero-metric-card.accent .hero-metric-label {
  color: rgba(255, 255, 255, 0.82);
}

.section {
  margin-top: 20px;
}

.section-label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #e65100;
}

.section-text {
  font-size: 16px;
  font-weight: 700;
}

.section-action {
  margin-left: auto;
}

.card {
  background: #fff;
  border: 1px solid #f0f0f0;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.terms-grid {
  display: grid;
  grid-template-columns: repeat(11, 1fr);
  gap: 8px;
}

.term-btn {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  border: 1px solid #eeeeee;
  color: #666;
  font-weight: 700;
  background: #fff;
  transition: 0.16s ease;
}

.term-btn:hover,
.term-btn.active {
  color: #e65100;
  border-color: #e65100;
  background: #fff3e0;
}

.term-guide-strip {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 12px;
  padding: 10px 14px;
  border-radius: 10px;
  background: #fff8e1;
  color: #7a4b00;
  font-size: 13px;
}

.term-guide-label {
  flex: 0 0 auto;
  padding: 2px 8px;
  border-radius: 999px;
  background: #fff;
  color: #e65100;
  font-weight: 700;
}

.term-quick-picks {
  margin-top: 12px;
}

.term-quick-picks-header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.term-quick-picks-title,
.term-summary-code,
.mode-title {
  font-weight: 700;
}

.term-quick-picks-subtitle {
  color: #999;
  font-size: 13px;
}

.term-quick-picks-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.term-quick-pick,
.entry-mode-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  min-height: 84px;
  padding: 14px;
  border: 1px solid #eeeeee;
  border-radius: 10px;
  background: #fff;
  color: #1a1a1a;
  text-align: left;
  transition: 0.16s ease;
}

.term-quick-pick:hover,
.term-quick-pick.active,
.entry-mode-card:hover,
.entry-mode-card.active {
  border-color: #e65100;
  background: #fff3e0;
}

.term-quick-pick-code {
  color: #e65100;
  font-size: 16px;
  font-weight: 800;
}

.term-quick-pick-text,
.mode-desc {
  color: #666;
  font-size: 13px;
}

.term-summary-card {
  margin-top: 12px;
}

.term-summary-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.term-summary-title-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.term-summary-code {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 58px;
  height: 44px;
  border-radius: 10px;
  background: #e65100;
  color: #fff;
  font-size: 18px;
}

.term-summary-name {
  font-size: 17px;
  font-weight: 700;
}

.term-summary-subname,
.term-summary-tip,
.form-hint {
  color: #999;
  font-size: 13px;
}

.term-scene-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.term-scene-tag {
  padding: 3px 10px;
  border-radius: 999px;
  background: #f5f5f5;
  color: #666;
  font-size: 12px;
}

.term-summary-desc {
  color: #333;
  margin-bottom: 14px;
}

.term-summary-duty-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.term-summary-duty {
  padding: 14px;
  border-radius: 10px;
  background: #f8f8f8;
}

.term-summary-duty-label {
  display: block;
  margin-bottom: 4px;
  font-weight: 700;
}

.term-summary-duty.seller .term-summary-duty-label {
  color: #2e7d32;
}

.term-summary-duty.buyer .term-summary-duty-label {
  color: #0277bd;
}

.entry-mode-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.mode-icon {
  min-width: 42px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: #e65100;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}

.grid-2,
.grid-3,
.grid-4 {
  display: grid;
  gap: 16px;
}

.grid-2 {
  grid-template-columns: repeat(2, 1fr);
}

.grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

.grid-4 {
  grid-template-columns: repeat(4, 1fr);
}

.form-group {
  margin-bottom: 16px;
}

.grid-2 .form-group,
.grid-3 .form-group,
.grid-4 .form-group {
  margin-bottom: 0;
}

.form-label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
}

.form-control {
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  color: #1a1a1a;
  background: #fff;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.form-control:focus {
  border-color: #e65100;
  outline: none;
  box-shadow: 0 0 0 3px rgba(230, 81, 0, 0.1);
}

.form-control--textarea {
  min-height: 88px;
  resize: vertical;
}

.input-with-unit {
  display: flex;
  align-items: stretch;
}

.input-with-unit .form-control {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

.input-unit {
  min-width: 58px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  border: 1px solid #e0e0e0;
  border-left: 0;
  border-radius: 0 8px 8px 0;
  background: #f5f5f5;
  color: #666;
  font-size: 13px;
}

.select-unit {
  width: 76px;
  border-left: 0;
  border-radius: 0 8px 8px 0;
  color: #666;
  background: #f5f5f5;
}

.currency-selector {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 14px;
  align-items: center;
}

.currency-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.currency-tab {
  padding: 8px 13px;
  border: 1px solid #eeeeee;
  border-radius: 999px;
  color: #666;
  background: #fff;
  font-weight: 700;
}

.currency-tab.active {
  border-color: #e65100;
  color: #e65100;
  background: #fff3e0;
}

.rate-display {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #f5f5f5;
}

.rate-value {
  color: #e65100;
  font-weight: 800;
}

.rate-refresh {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 8px;
  background: #fff;
  color: #e65100;
}

.warning-tip {
  display: flex;
  gap: 8px;
  margin-top: 16px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #fff8e1;
  color: #7a4b00;
  font-size: 13px;
}

.warning-icon {
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #e65100;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}

.is-hidden {
  display: none !important;
}

.action-section {
  text-align: center;
}

.btn,
.btn-generate {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 10px 20px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-weight: 600;
  transition: 0.16s ease;
}

.btn-sm {
  min-height: 34px;
  padding: 6px 12px;
  font-size: 13px;
}

.btn-primary,
.btn-generate {
  background: #e65100;
  color: #fff;
  border-color: #e65100;
}

.btn-primary:hover,
.btn-generate:hover {
  background: #ff833a;
  border-color: #ff833a;
}

.btn-secondary {
  background: #fff;
  color: #1a1a1a;
  border-color: #e0e0e0;
}

.btn-secondary:hover {
  background: #f5f5f5;
}

.btn-ghost {
  background: transparent;
  color: #e65100;
}

.btn-ghost:hover {
  background: #fff3e0;
}

.btn-generate {
  min-width: 220px;
  min-height: 48px;
  font-size: 16px;
}

.action-hint {
  margin-top: 8px;
  color: #999;
  font-size: 13px;
}

.result-card {
  overflow: hidden;
  border: 1px solid #f0f0f0;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.result-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 22px;
}

.result-icon {
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #2e7d32;
  color: #fff;
  font-weight: 800;
}

.result-title {
  font-size: 17px;
  font-weight: 800;
}

.result-term {
  margin-left: auto;
  padding: 4px 12px;
  border-radius: 999px;
  background: #fff3e0;
  color: #e65100;
  font-weight: 800;
}

.result-divider {
  height: 1px;
  background: #eeeeee;
}

.calc-result-grid,
.profit-analysis {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
}

.calc-result-item,
.profit-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 18px 22px;
  border-right: 1px solid #f0f0f0;
}

.calc-result-item:last-child,
.profit-item:last-child {
  border-right: 0;
}

.calc-result-item span,
.profit-item span,
.result-amount-label {
  color: #999;
  font-size: 13px;
}

.calc-result-item strong,
.profit-item strong {
  font-size: 18px;
}

.highlight {
  color: #e65100;
}

.result-amount-label,
.result-amount-wrap {
  padding-left: 22px;
  padding-right: 22px;
}

.result-amount-label {
  padding-top: 18px;
}

.result-amount-wrap {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  padding-bottom: 22px;
}

.result-amount {
  color: #e65100;
  font-size: 44px;
  line-height: 1;
  font-weight: 900;
}

.result-amount-unit {
  margin-bottom: 4px;
  color: #666;
  font-weight: 800;
}

.inline-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  padding: 18px 22px;
  border-top: 1px solid #eeeeee;
}

.quotation-preview {
  min-height: 260px;
}

.preview-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 220px;
  color: #999;
}

.quotation-paper {
  padding: 8px;
}

.quotation-top {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 16px;
  border-bottom: 2px solid #1a1a1a;
}

.quotation-brand {
  font-size: 24px;
  font-weight: 900;
}

.quotation-title {
  font-size: 22px;
  font-weight: 900;
  text-align: right;
}

.quotation-meta {
  margin-top: 4px;
  color: #666;
  text-align: right;
}

.quotation-columns {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
  margin-top: 18px;
}

.quotation-block-title {
  margin-bottom: 6px;
  color: #e65100;
  font-weight: 800;
}

.quotation-table {
  width: 100%;
  margin-top: 18px;
  border-collapse: collapse;
}

.quotation-table th,
.quotation-table td {
  padding: 10px;
  border: 1px solid #e0e0e0;
  text-align: left;
}

.quotation-table th {
  background: #f5f5f5;
  font-weight: 800;
}

.quotation-total {
  display: flex;
  justify-content: flex-end;
  margin-top: 18px;
  font-size: 18px;
  font-weight: 900;
}

.quotation-note {
  margin-top: 16px;
  color: #666;
}

.table-wrapper {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 12px 14px;
  border-bottom: 1px solid #f0f0f0;
  text-align: left;
  white-space: nowrap;
}

th {
  background: #f5f5f5;
  color: #666;
  font-size: 13px;
}

.history-empty {
  color: #999;
  text-align: center;
}

.cloud-status {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 12px;
  padding: 10px 12px;
  border: 1px solid #e9ecef;
  border-radius: 8px;
  background: #fff;
  color: #666;
  font-size: 13px;
}

.cloud-status-dot {
  width: 9px;
  height: 9px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: #adb5bd;
}

.cloud-status[data-status="connected"] {
  border-color: #d7f3df;
  background: #f4fbf6;
  color: #1f7a3f;
}

.cloud-status[data-status="connected"] .cloud-status-dot {
  background: #22a957;
}

.cloud-status[data-status="missing"],
.cloud-status[data-status="checking"] {
  border-color: #ffe8bf;
  background: #fffaf1;
  color: #8a5b00;
}

.cloud-status[data-status="missing"] .cloud-status-dot,
.cloud-status[data-status="checking"] .cloud-status-dot {
  background: #f6a700;
}

.cloud-status[data-status="offline"] {
  border-color: #ffd8d2;
  background: #fff6f5;
  color: #b42318;
}

.cloud-status[data-status="offline"] .cloud-status-dot {
  background: #e74c3c;
}

.cloud-status-text {
  min-width: 0;
  flex: 1;
}

.cloud-status-action {
  flex: 0 0 auto;
}

.footer {
  margin-top: 20px;
  padding: 34px 0 18px;
  background: #1a1a1a;
  color: #fff;
}

.footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) 220px minmax(0, 1fr);
  gap: 28px;
}

.footer-brand-icon {
  background: #fff;
  color: #e65100;
}

.footer-brand-titles {
  display: flex;
  flex-direction: column;
}

.footer-brand-name {
  font-size: 18px;
  font-weight: 800;
}

.footer-brand-subtitle,
.footer-brand-desc,
.footer-meta-text,
.footer-contact-item,
.footer-text {
  color: rgba(255, 255, 255, 0.64);
}

.footer-brand-desc {
  margin-top: 12px;
}

.footer-heading {
  margin-bottom: 10px;
  font-weight: 800;
}

.footer-nav-links {
  display: grid;
  gap: 6px;
}

.footer-link {
  color: rgba(255, 255, 255, 0.7);
}

.footer-link:hover {
  color: #fff;
}

.footer-bottom {
  margin-top: 26px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.mobile-tabbar {
  display: none;
}

.toast-container {
  position: fixed;
  top: 20px;
  left: 50%;
  z-index: 1000;
  display: grid;
  gap: 8px;
  transform: translateX(-50%);
  pointer-events: none;
}

.toast {
  min-width: 220px;
  padding: 11px 16px;
  border-radius: 8px;
  background: #1a1a1a;
  color: #fff;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}

@media print {
  .header,
  .footer,
  .mobile-tabbar,
  .section:not(#preview),
  .toast-container {
    display: none !important;
  }

  .container,
  .page {
    max-width: none;
    padding: 0;
  }

  #preview {
    display: block !important;
    margin: 0;
  }

  .quotation-preview {
    border: 0;
    box-shadow: none;
  }
}

@media screen and (max-width: 980px) {
  .header-nav {
    display: none;
  }

  .hero-header,
  .currency-selector {
    grid-template-columns: 1fr;
  }

  .hero-metrics,
  .terms-grid,
  .term-quick-picks-grid,
  .grid-4,
  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .calc-result-grid,
  .profit-analysis {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media screen and (max-width: 768px) {
  .container {
    padding: 0 14px;
  }

  .page {
    padding-bottom: 84px;
  }

  .header-inner {
    height: 58px;
  }

  .header-action-btn,
  .group-entry-btn {
    display: none;
  }

  .page-title {
    font-size: 26px;
  }

  .hero-header,
  .card {
    padding: 16px;
    border-radius: 12px;
  }

  .grid-2,
  .grid-3,
  .grid-4,
  .entry-mode-cards,
  .term-summary-duty-grid,
  .quotation-columns,
  .footer-grid {
    grid-template-columns: 1fr;
  }

  .terms-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .term-quick-picks-grid {
    grid-template-columns: 1fr;
  }

  .term-guide-strip,
  .term-summary-header,
  .term-quick-picks-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .result-amount {
    font-size: 34px;
  }

  .inline-actions {
    justify-content: stretch;
  }

  .inline-actions .btn {
    flex: 1 1 140px;
  }

  .mobile-tabbar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 60;
    display: flex;
    height: 58px;
    border-top: 1px solid #e0e0e0;
    background: #fff;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.06);
  }

  .tabbar-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    color: #999;
  }

  .tabbar-item.active {
    color: #e65100;
  }

  .tabbar-icon {
    font-size: 20px;
    line-height: 1;
  }

  .tabbar-label {
    font-size: 10px;
    font-weight: 600;
  }
}

