/* Apple 风格全局优化 */

/* 1. 基础变量定义 */
:root {
  /* 颜色系统 */
  --primary-color: #007aff;
  --secondary-color: #5856d6;
  --success-color: #34c759;
  --warning-color: #ff9500;
  --danger-color: #ff3b30;
  --background-color: #f8fafc;
  --card-background: #fff;
  --text-color: #222;
  --text-secondary: #8e8e93;
  --border-color: #c6c6c8;

  /* 尺寸系统 */
  --border-radius: 12px;
  --spacing-unit: 16px;
  --spacing-small: 8px;
  --spacing-large: 24px;

  /* 动画时间 */
  --transition-fast: 0.2s;
  --transition-normal: 0.3s;

  /* 阴影系统 */
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 24px rgba(0, 122, 255, 0.07);
  --shadow-lg: 0 8px 32px rgba(0, 122, 255, 0.12);
}

/* 2. 重置样式 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* 3. 基础样式 */
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica,
    Arial, sans-serif;
  background: var(--background-color);
  color: var(--text-color);
  font-size: 16px;
  line-height: 1.5;
}

/* 4. 排版样式 */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: 700;
  color: var(--primary-color);
  letter-spacing: -0.01em;
  margin-bottom: var(--spacing-unit);
}

h1 {
  font-size: 2rem;
}
h2 {
  font-size: 1.5rem;
}
h3 {
  font-size: 1.2rem;
}
h4 {
  font-size: 1.1rem;
}

/* 5. 通用组件样式 */
.card,
.suggestion-card,
.analysis-card {
  background: var(--card-background);
  border-radius: var(--border-radius);
  padding: var(--spacing-large);
  margin-bottom: var(--spacing-unit);
  box-shadow: var(--shadow-md);
  transition: box-shadow var(--transition-fast),
    transform var(--transition-fast);
  position: relative;
  background-clip: padding-box;
  border: 2px solid transparent;
  border-image: linear-gradient(120deg, #aad1ff 0%, #e0e7ff 100%) 1;
}

.card:hover,
.suggestion-card:hover,
.analysis-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

/* 6. 表单元素样式 */
input,
select,
button {
  border-radius: var(--border-radius);
  font-size: 16px;
  padding: 10px 16px;
  border: 1px solid var(--border-color);
  transition: box-shadow var(--transition-fast),
    border-color var(--transition-fast);
}

input:focus,
select:focus,
button:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.15);
}

/* 7. 趋势指标样式 */
.trend-up,
.profit-positive {
  color: var(--success-color);
  background: rgba(52, 199, 89, 0.08);
  font-family: "SF Mono", Menlo, monospace;
  font-size: 1.05rem;
  font-weight: 600;
  border-radius: 8px;
  padding: 2px 8px;
  animation: fadeInNumber 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

.trend-down,
.profit-negative {
  color: var(--danger-color);
  background: rgba(255, 59, 48, 0.08);
  font-family: "SF Mono", Menlo, monospace;
  font-size: 1.05rem;
  font-weight: 600;
  border-radius: 8px;
  padding: 2px 8px;
  animation: fadeInNumber 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 8. 动画定义 */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInNumber {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* 9. 响应式布局 */
@media (max-width: 768px) {
  .container {
    padding: calc(var(--spacing-unit) / 1.5);
  }

  .card,
  .suggestion-card,
  .analysis-card {
    padding: var(--spacing-unit);
  }

  .chart-container {
    flex-direction: column;
  }

  .input-grid,
  .strategy-selector,
  .condition-selector {
    grid-template-columns: 1fr;
  }
}

/* 10. 暗色模式支持 */
@media (prefers-color-scheme: dark) {
  :root {
    --background-color: #1c1c1e;
    --card-background: #2c2c2e;
    --text-color: #f2f2f7;
    --text-secondary: #aeaeb2;
    --border-color: #3a3a3c;
  }

  .card,
  .suggestion-card,
  .analysis-card {
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
  }

  input,
  select,
  button {
    background-color: var(--card-background);
    color: var(--text-color);
  }
}

/* 11. 工具类 */
.text-center {
  text-align: center;
}
.mt-1 {
  margin-top: var(--spacing-small);
}
.mt-2 {
  margin-top: var(--spacing-unit);
}
.mt-3 {
  margin-top: var(--spacing-large);
}
.mb-1 {
  margin-bottom: var(--spacing-small);
}
.mb-2 {
  margin-bottom: var(--spacing-unit);
}
.mb-3 {
  margin-bottom: var(--spacing-large);
}

/* 12. 其他样式 */
/* Header Styles */
header {
  text-align: center;
  margin-bottom: calc(var(--spacing-unit) * 2);
  padding-top: var(--spacing-large); /* Add some top padding to the header */
}

h1 {
  font-size: 2rem;
  /* Removed margin-top: 5rem; rely on header padding-top */
}

.subtitle {
  color: var(--text-secondary);
  font-size: 1.2rem;
}

.container,
.input-section,
.chart-section {
  border-radius: 12px;
  margin-bottom: 16px;
  padding: 24px;
}

.card:hover,
.suggestion-card:hover,
.analysis-card:hover {
  box-shadow: 0 8px 32px rgba(0, 122, 255, 0.12);
  transform: translateY(-2px);
}

.btn-add,
.btn-primary {
  background-color: var(--primary-color);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  padding: 10px 24px;
  transition: background 0.2s, box-shadow 0.2s;
}
.btn-add:hover,
.btn-primary:hover {
  background-color: #0056b3;
  box-shadow: 0 4px 16px rgba(0, 122, 255, 0.1);
}

.asset-input-section {
  background-color: var(--card-background);
  border-radius: var(--border-radius);
  padding: var(--spacing-unit);
  margin-bottom: var(--spacing-unit);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.asset-input-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: var(--spacing-unit);
}

#current-holdings {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 15px;
}

.currency-input-group {
  display: flex;
  align-items: center;
  background-color: var(--background-color);
  border-radius: 8px;
  padding: 10px 15px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  gap: 15px;
  transition: all 0.3s ease;
}

.currency-input-group:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.12);
}

.currency-input-group .form-group {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 0;
}

.currency-input-group label {
  min-width: 60px;
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.95em;
}

.currency-input-group input[type="number"],
.currency-input-group .currency-select {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 1rem;
  background-color: var(--card-background);
  color: var(--text-color);
  transition: all 0.3s ease;
}

.currency-input-group input[type="number"]:focus,
.currency-input-group .currency-select:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.2);
  transform: scale(1.01);
}

.remove-currency {
  padding: 6px 10px;
  background-color: var(--danger-color);
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 1.1em;
  transition: background-color 0.2s ease, transform 0.1s ease;
  flex-shrink: 0;
}

.remove-currency:hover {
  background-color: #cc0000;
}

.remove-currency:active {
  transform: scale(0.95);
}

.add-currency {
  margin-top: 10px;
  text-align: center;
}

.btn-add {
  background-color: #007aff;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  transition: background-color 0.2s;
}

.btn-add:hover {
  background-color: #0056b3;
}

.strategy-section {
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.strategy-selector {
  display: flex;
  gap: 20px;
  justify-content: space-between;
}

.strategy-group {
  flex: 1;
  background: #f8f9fa;
  padding: 15px;
  border-radius: 8px;
}

.strategy-group h3 {
  margin-bottom: 15px;
  color: #333;
  font-size: 1.1em;
}

.strategy-type,
.currency-select {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  margin-bottom: 10px;
  font-size: 0.95em;
  background: #fff;
}

.strategy-type:focus,
.currency-select:focus {
  border-color: #007bff;
  outline: none;
  box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.input-section {
  background-color: var(--card-background);
  border-radius: var(--border-radius);
  padding: var(--spacing-unit);
  margin-bottom: var(--spacing-unit);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.input-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--spacing-unit);
}

.input-group {
  background-color: var(--background-color);
  padding: var(--spacing-unit);
  border-radius: var(--border-radius);
}

.form-group {
  margin-bottom: var(--spacing-unit);
}

label {
  display: block;
  margin-bottom: 4px;
  color: var(--text-secondary);
}

input[type="number"] {
  width: 100%;
  padding: 8px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 1rem;
}

.chart-section {
  background-color: var(--card-background);
  border-radius: var(--border-radius);
  padding: var(--spacing-unit);
  margin-bottom: var(--spacing-unit);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.chart-container {
  display: flex;
  gap: 20px;
  margin-top: 20px;
}

.chart-wrapper {
  flex: 1;
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.chart-wrapper h3 {
  margin-bottom: 15px;
  color: #333;
  font-size: 1.1em;
}

.asset-chart-container,
.profit-chart-container {
  position: relative;
  height: 300px;
  width: 100%;
}

.empty-chart {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: #6c757d;
  text-align: center;
  padding: 20px;
}

.empty-chart svg {
  width: 64px;
  height: 64px;
  margin-bottom: 15px;
  opacity: 0.5;
}

.empty-chart p {
  margin: 0;
  font-size: 0.9em;
}

.trend-indicator {
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 12px;
}

.analysis-card:hover {
  transform: translateY(-2px);
}

.analysis-details {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-unit);
}

.current-status,
.settlement-scenarios {
  background-color: var(--background-color);
  padding: var(--spacing-unit);
  border-radius: calc(var(--border-radius) / 2);
  width: 100%;
}

.scenario {
  padding: var(--spacing-unit);
  border-radius: calc(var(--border-radius) / 2);
  margin-top: var(--spacing-unit);
  background-color: var(--card-background);
  border: 1px solid var(--border-color);
  transition: all 0.3s ease;
}

.scenario.active {
  border-color: var(--primary-color);
  background-color: rgba(0, 122, 255, 0.05);
}

#analysis-results {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--spacing-unit);
}

.analysis-card:hover {
  transform: translateY(-2px);
}

.analysis-details {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-unit);
}

.current-status,
.settlement-scenarios {
  background-color: var(--background-color);
  padding: var(--spacing-unit);
  border-radius: calc(var(--border-radius) / 2);
}

#trading-suggestions {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-template-rows: repeat(2, auto);
  gap: var(--spacing-unit);
  padding: 0;
}
@media (max-width: 900px) {
  #trading-suggestions {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
  }
}
.suggestion-card {
  background-color: var(--card-background);
  border-radius: var(--border-radius);
  padding: var(--spacing-unit);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 220px;
}
.suggestion-card > * {
  margin-bottom: 12px;
}
.suggestion-card > *:last-child {
  margin-bottom: 0;
}

.suggestion-section {
  background-color: var(--card-background);
  border-radius: var(--border-radius);
  padding: var(--spacing-unit);
  margin-bottom: var(--spacing-unit);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.suggestion-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.suggestion-card h3 {
  color: var(--text-color);
  margin-bottom: calc(var(--spacing-unit) * 1.5);
  font-size: 1.3rem;
  font-weight: 600;
}

.suggestion-card h4 {
  color: var(--text-secondary);
  margin-bottom: var(--spacing-unit);
  font-size: 1.1rem;
  font-weight: 500;
}

.price-analysis {
  background-color: var(--background-color);
  padding: var(--spacing-unit);
  border-radius: calc(var(--border-radius) / 2);
  margin-bottom: var(--spacing-unit);
}

.price-analysis p {
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.strategy-advice,
.overall-advice,
.strategy-combination-advice {
  background-color: var(--background-color);
  padding: var(--spacing-unit);
  border-radius: calc(var(--border-radius) / 2);
  margin-bottom: var(--spacing-unit);
}

.strategy-advice p,
.overall-advice p,
.strategy-combination-advice p {
  font-weight: 500;
  margin-bottom: var(--spacing-unit);
}

.strategy-advice ul,
.overall-advice ul,
.strategy-combination-advice ul {
  list-style: none;
  padding-left: 0;
}

.strategy-advice li,
.overall-advice li,
.strategy-combination-advice li {
  margin-bottom: 8px;
  padding-left: 24px;
  position: relative;
}

.strategy-advice li:before,
.overall-advice li:before,
.strategy-combination-advice li:before {
  content: "•";
  position: absolute;
  left: 8px;
  color: var(--primary-color);
}

.portfolio-analysis {
  background-color: var(--background-color);
  padding: var(--spacing-unit);
  border-radius: calc(var(--border-radius) / 2);
  margin-bottom: var(--spacing-unit);
}

.portfolio-analysis p {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  padding: 4px 0;
  border-bottom: 1px solid var(--border-color);
}

.portfolio-analysis p:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

footer {
  text-align: center;
  color: var(--text-secondary);
  padding: var(--spacing-unit);
  margin-top: calc(var(--spacing-unit) * 2);
}

@media (max-width: 768px) {
  .container {
    padding: calc(var(--spacing-unit) / 1.5);
  }

  h1 {
    font-size: 2rem;
    margin-bottom: var(--spacing-unit);
  }

  h2 {
    font-size: 1.4rem;
    margin-bottom: var(--spacing-unit);
  }

  h3 {
    font-size: 1.1rem;
    margin-bottom: calc(var(--spacing-unit) / 1.5);
  }

  .asset-input-grid,
  .strategy-selector,
  .input-grid,
  .chart-container,
  .condition-selector {
    grid-template-columns: 1fr;
    gap: var(--spacing-unit);
  }

  .asset-chart-container,
  .profit-chart-container {
    height: 250px;
    padding: calc(var(--spacing-unit) / 1.5);
  }

  #analysis-results {
    grid-template-columns: 1fr;
    gap: var(--spacing-unit);
  }

  .analysis-card {
    margin-bottom: var(--spacing-unit);
    padding: calc(var(--spacing-unit) / 1.5);
  }

  .analysis-details {
    gap: calc(var(--spacing-unit) / 1.5);
  }

  .current-status,
  .settlement-scenarios {
    padding: calc(var(--spacing-unit) / 1.5);
  }

  .suggestion-card {
    padding: calc(var(--spacing-unit) / 1.5);
    margin-bottom: var(--spacing-unit);
  }

  .price-analysis,
  .strategy-advice,
  .overall-advice,
  .strategy-combination-advice,
  .portfolio-analysis {
    padding: calc(var(--spacing-unit) / 1.5);
    gap: var(--spacing-unit);
  }

  .suggestion-card h3 {
    font-size: 1.2rem;
    margin-bottom: calc(var(--spacing-unit) / 1.5);
  }

  .suggestion-card h4 {
    font-size: 1rem;
    margin-bottom: calc(var(--spacing-unit) / 1.5);
  }

  #trading-suggestions .suggestion-card:last-child .overall-suggestions-grid {
    grid-template-columns: 1fr;
    gap: var(--spacing-unit);
    margin-top: var(--spacing-unit);
  }

  #trading-suggestions .suggestion-card:last-child .portfolio-analysis h4,
  #trading-suggestions .suggestion-card:last-child .overall-advice h4,
  #trading-suggestions
    .suggestion-card:last-child
    .strategy-combination-advice
    h4 {
    padding-bottom: calc(var(--spacing-unit) / 2);
    margin-bottom: calc(var(--spacing-unit) / 2);
  }

  #trading-suggestions .suggestion-card:last-child .portfolio-analysis p {
    padding: calc(var(--spacing-unit) / 4) 0;
  }

  #trading-suggestions .suggestion-card:last-child .overall-advice ul,
  #trading-suggestions
    .suggestion-card:last-child
    .strategy-combination-advice
    ul {
    margin-top: calc(var(--spacing-unit) / 2);
    gap: calc(var(--spacing-unit) / 4);
  }
}

.input-group,
.chart-wrapper,
.selector-group {
  transition: transform 0.2s ease-in-out;
}

.input-group:hover,
.chart-wrapper:hover,
.selector-group:hover {
  transform: translateY(-2px);
}

.strategy-config {
  background-color: var(--background-color);
  padding: var(--spacing-unit);
  border-radius: var(--border-radius);
  transition: all 0.3s ease;
}

.strategy-config:hover {
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

input[type="number"]:focus,
.strategy-select:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(0, 122, 255, 0.2);
}

h2 {
  color: var(--text-color);
  margin-bottom: var(--spacing-unit);
  font-size: 1.5rem;
}

h3 {
  color: var(--text-secondary);
  margin-bottom: calc(var(--spacing-unit) / 2);
  font-size: 1.2rem;
}

.protection-analysis {
  background-color: var(--background-color);
  padding: var(--spacing-unit);
  border-radius: calc(var(--border-radius) / 2);
  margin-bottom: var(--spacing-unit);
}

.protection-analysis h4 {
  color: var(--text-color);
  margin-bottom: var(--spacing-unit);
  font-size: 1.1rem;
  font-weight: 500;
}

.protection-analysis p {
  margin-bottom: 8px;
  line-height: 1.5;
}

.warning-advice {
  background-color: rgba(255, 59, 48, 0.1);
  border-left: 4px solid var(--danger-color);
  padding: var(--spacing-unit);
  margin-top: var(--spacing-unit);
  border-radius: 0 calc(var(--border-radius) / 2) calc(var(--border-radius) / 2)
    0;
}

.warning-advice p {
  margin-bottom: 8px;
}

.warning-advice p:last-child {
  margin-bottom: 0;
}

@media (max-width: 768px) {
  .protection-analysis,
  .warning-advice {
    padding: calc(var(--spacing-unit) / 1.5);
  }
}

.analysis-section {
  background-color: var(--card-background);
  padding: var(--spacing-unit);
  margin-top: var(--spacing-unit);
  border-radius: var(--border-radius);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.analysis-card {
  background-color: var(--card-background);
  padding: var(--spacing-unit);
  margin-bottom: var(--spacing-unit);
  border-radius: var(--border-radius-small);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s ease-in-out;
}

.analysis-card:hover {
  transform: translateY(-5px);
}

.analysis-card h3 {
  color: var(--text-color);
  margin-top: 0;
  margin-bottom: var(--spacing-small);
}

.analysis-details {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-unit);
}

.current-status h4,
.settlement-scenarios h4 {
  color: var(--text-secondary);
  margin-top: 0;
  margin-bottom: var(--spacing-small);
  border-bottom: 1px solid var(--border-color);
  padding-bottom: var(--spacing-small);
}

.settlement-scenarios .scenario {
  background-color: var(--card-background);
  padding: calc(var(--spacing-unit) * 1.5);
  border-radius: 16px;
  margin-bottom: var(--spacing-unit);
  border: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  position: relative;
  overflow: hidden;
}

.settlement-scenarios .scenario::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(
    90deg,
    var(--primary-color),
    var(--secondary-color)
  );
  opacity: 0;
  transition: opacity 0.3s ease;
}

.settlement-scenarios .scenario:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.settlement-scenarios .scenario:hover::before {
  opacity: 1;
}

.settlement-scenarios .scenario.active {
  background: linear-gradient(
    145deg,
    rgba(255, 255, 255, 0.9),
    rgba(255, 255, 255, 0.95)
  );
  box-shadow: 0 8px 24px rgba(0, 122, 255, 0.15);
}

.settlement-scenarios .scenario.active::before {
  opacity: 1;
}

.settlement-scenarios .scenario.inactive {
  background: linear-gradient(
    145deg,
    var(--background-color),
    var(--card-background)
  );
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.settlement-scenarios .scenario h5 {
  color: var(--text-color);
  margin: 0 0 calc(var(--spacing-unit) * 1.2) 0;
  font-size: 1.2rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 12px;
  letter-spacing: -0.01em;
}

.settlement-scenarios .scenario.active h5 {
  color: var(--primary-color);
  background: linear-gradient(
    90deg,
    var(--primary-color),
    var(--secondary-color)
  );
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.settlement-scenarios .scenario.inactive h5 {
  color: var(--text-secondary);
}

.settlement-scenarios .scenario p {
  margin-bottom: calc(var(--spacing-unit) * 1.2);
  line-height: 1.6;
  color: var(--text-color);
  font-size: 1rem;
  letter-spacing: -0.01em;
}

.calculation-details {
  background: linear-gradient(
    145deg,
    rgba(255, 255, 255, 0.8),
    rgba(255, 255, 255, 0.9)
  );
  padding: calc(var(--spacing-unit) * 1.2);
  border-radius: 12px;
  border: none;
  margin-top: calc(var(--spacing-unit) * 1.2);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.calculation-details h4 {
  color: var(--text-color);
  margin: 0 0 calc(var(--spacing-unit) * 1.2) 0;
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.calculation-details p {
  margin-bottom: calc(var(--spacing-unit) * 1.2);
  font-family: "SF Mono", "Menlo", "Monaco", "Consolas", "Courier New",
    monospace;
  font-size: 0.95em;
  line-height: 1.6;
  color: var(--text-color);
  background: rgba(0, 0, 0, 0.03);
  padding: calc(var(--spacing-unit) * 1.2);
  border-radius: 8px;
  letter-spacing: -0.01em;
}

.calculation-details p:last-child {
  margin-bottom: 0;
}

.settlement-scenarios .scenario {
  animation: fadeIn 0.5s ease-out forwards;
}

.settlement-scenarios .scenario:nth-child(2) {
  animation-delay: 0.1s;
}

@media (max-width: 768px) {
  .settlement-scenarios .scenario {
    padding: var(--spacing-unit);
  }

  .calculation-details {
    padding: var(--spacing-unit);
  }

  .calculation-details p {
    padding: var(--spacing-unit);
  }
}

.condition-selector {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--spacing-unit);
  margin-bottom: var(--spacing-unit);
}

.selector-group {
  background-color: var(--background-color);
  padding: var(--spacing-unit);
  border-radius: var(--border-radius);
}

.radio-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.radio-group label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

@media (max-width: 768px) {
  .condition-selector {
    grid-template-columns: 1fr;
  }
}

.assets-overview {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin: 15px 0;
}

.current-assets,
.predicted-assets {
  flex: 1;
  padding: 20px;
  background: rgba(0, 0, 0, 0.02);
  border-radius: 12px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.current-assets h4,
.predicted-assets h4 {
  margin: 0 0 15px 0;
  color: #333;
  font-size: 1.1em;
  font-weight: 600;
}

.current-assets p,
.predicted-assets p {
  margin: 8px 0;
  color: #666;
  font-size: 0.95em;
  line-height: 1.5;
}

.trend-indicator {
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
}

.trend-up {
  color: #4caf50;
  background: rgba(76, 175, 80, 0.1);
}

.trend-down {
  color: #f44336;
  background: rgba(244, 67, 54, 0.1);
}

.protection-analysis {
  margin-top: 15px;
  padding: 15px;
  background: rgba(0, 0, 0, 0.02);
  border-radius: 8px;
}

.protection-section {
  margin: 10px 0;
  padding: 10px;
  background: rgba(255, 255, 255, 0.5);
  border-radius: 6px;
}

.protection-section h5 {
  margin: 0 0 8px 0;
  color: #333;
  font-size: 1em;
}

.protection-suggestion {
  margin-top: 15px;
  padding: 12px;
  background: rgba(0, 122, 255, 0.05);
  border-radius: 6px;
  border-left: 4px solid #007aff;
}

.protection-suggestion h5 {
  margin: 0 0 8px 0;
  color: #007aff;
  font-size: 1em;
}

.suggestion-note {
  margin-top: 8px;
  font-size: 0.9em;
  color: #666;
  font-style: italic;
}

.warning-advice {
  margin-top: 15px;
  padding: 12px;
  background: rgba(255, 149, 0, 0.05);
  border-radius: 6px;
  border-left: 4px solid #ff9500;
}

.warning-advice p {
  margin: 5px 0;
  color: #666;
}

.warning-advice p:first-child {
  color: #ff9500;
  font-weight: 600;
}

@media (max-width: 768px) {
  .assets-overview {
    flex-direction: column;
  }

  .current-assets,
  .predicted-assets {
    width: 100%;
  }
}

.currency-tags-container {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 15px;
  min-height: 40px;
  align-items: center;
}

.currency-tag {
  display: inline-flex;
  align-items: center;
  background-color: #f5f5f5;
  border-radius: 20px;
  padding: 8px 16px;
  margin: 4px;
  font-size: 14px;
  color: #333;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.currency-tag:hover {
  background-color: #e8e8e8;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.currency-symbol {
  font-weight: bold;
  margin-right: 8px;
  color: #007aff;
}

.currency-amount {
  margin-right: 8px;
  color: #666;
}

.currency-price {
  margin-right: 8px;
  color: #666;
}

.currency-value {
  font-weight: bold;
  color: #007aff;
  margin-right: 8px;
}

.remove-tag {
  background: none;
  border: none;
  color: #ff3b30;
  font-size: 18px;
  cursor: pointer;
  padding: 0 4px;
  margin-left: 4px;
  opacity: 0.6;
  transition: opacity 0.3s ease;
}

.remove-tag:hover {
  opacity: 1;
}

.currency-edit-area {
  background-color: #fff;
  border-radius: 8px;
  padding: 20px;
  margin: 20px 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.currency-edit-area h3 {
  margin-bottom: 16px;
  color: #333;
}

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

.currency-edit-area label {
  display: block;
  margin-bottom: 8px;
  color: #666;
}

.currency-edit-area input,
.currency-edit-area select {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
  transition: border-color 0.3s ease;
}

.currency-edit-area input:focus,
.currency-edit-area select:focus {
  border-color: #007aff;
  outline: none;
  box-shadow: 0 0 0 2px rgba(0, 122, 255, 0.2);
}

.currency-edit-area .button-group {
  display: flex;
  gap: 12px;
  margin-top: 20px;
}

.currency-edit-area button {
  padding: 8px 16px;
  border: none;
  border-radius: 4px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.currency-edit-area .btn-primary {
  background-color: #007aff;
  color: white;
}

.currency-edit-area .btn-primary:hover {
  background-color: #0056b3;
}

.currency-edit-area .btn-secondary {
  background-color: #f5f5f5;
  color: #333;
}

.currency-edit-area .btn-secondary:hover {
  background-color: #e8e8e8;
}

.error-message,
.success-message {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 12px 24px;
  border-radius: 4px;
  font-size: 14px;
  z-index: 1000;
  animation: slideIn 0.3s ease-out;
}

.error-message {
  background-color: #ff3b30;
  color: white;
}

.success-message {
  background-color: #34c759;
  color: white;
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.empty-message {
  text-align: center;
  padding: 20px;
  color: #666;
  font-size: 14px;
  background-color: #f5f5f5;
  border-radius: 4px;
  margin: 10px 0;
}

#add-currency-select-group {
  margin-bottom: 16px;
}

#add-currency-select {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
  background-color: white;
  cursor: pointer;
}

#add-currency-select:focus {
  border-color: #007aff;
  outline: none;
  box-shadow: 0 0 0 2px rgba(0, 122, 255, 0.2);
}

.profit-chart-container canvas {
  border-radius: 16px;
  background: linear-gradient(135deg, #f8fafc 60%, #e9efff 100%);
  box-shadow: 0 4px 24px rgba(0, 122, 255, 0.07);
  transition: box-shadow 0.2s;
}
.profit-chart-container canvas:hover {
  box-shadow: 0 8px 32px rgba(0, 122, 255, 0.12);
}

.chartjs-tooltip {
  background: rgba(30, 30, 30, 0.97) !important;
  color: #fff !important;
  border-radius: 12px !important;
  border: 1.5px solid #007aff !important;
  box-shadow: 0 4px 16px rgba(0, 122, 255, 0.1);
  font-size: 15px !important;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif !important;
  padding: 18px 22px !important;
  min-width: 180px;
  line-height: 1.7;
  pointer-events: none;
  z-index: 9999;
  transition: box-shadow 0.2s;
}

.chartjs-tooltip strong {
  color: #fff;
  font-weight: 600;
  font-size: 16px;
}

.chartjs-tooltip em {
  color: #aad1ff;
  font-style: normal;
}

.profit-chart-container .chartjs-legend {
  font-size: 14px;
  color: #333;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  margin-top: 10px;
}

.profit-chart-container .chartjs-axis-label {
  color: #007aff;
  font-weight: 500;
  font-size: 13px;
}

.settlement-details h4,
.asset-overview-card p {
  font-size: 1.05em;
  color: #333;
  font-weight: 500;
  margin: 8px 0;
  letter-spacing: 0.01em;
}

@media (max-width: 900px) {
  .chart-container {
    flex-direction: column;
    gap: 16px;
  }
}

h1 {
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary-color);
  letter-spacing: -0.01em;
}

.suggestion-card h3,
.analysis-card h3 {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text-color);
  margin-bottom: 18px;
}

.suggestion-card h4,
.analysis-card h4 {
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

.suggestion-card,
.analysis-card,
.asset-overview-card,
.settlement-details {
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-color);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica,
    Arial, sans-serif;
  line-height: 1.7;
}

/* 重要数字高亮（正/负收益） */
span.trend-up,
.profit-positive {
  color: var(--success-color);
  background: rgba(52, 199, 89, 0.08);
  font-family: "SF Mono", Menlo, monospace;
  font-size: 1.05rem;
  font-weight: 600;
  border-radius: 8px;
  padding: 2px 8px;
}
span.trend-down,
.profit-negative {
  color: var(--danger-color);
  background: rgba(255, 59, 48, 0.08);
  font-family: "SF Mono", Menlo, monospace;
  font-size: 1.05rem;
  font-weight: 600;
  border-radius: 8px;
  padding: 2px 8px;
}

/* 卡片阴影与圆角统一 */
.card,
.suggestion-card,
.analysis-card {
  border-radius: 12px;
  box-shadow: 0 4px 24px rgba(0, 122, 255, 0.07);
  transition: box-shadow 0.2s, transform 0.2s;
}
.card:hover,
.suggestion-card:hover,
.analysis-card:hover {
  box-shadow: 0 8px 32px rgba(0, 122, 255, 0.12);
  transform: translateY(-2px);
}

/* 卡片内容间距优化 */
.suggestion-card > *,
.analysis-card > * {
  margin-bottom: 14px;
}
.suggestion-card > *:last-child,
.analysis-card > *:last-child {
  margin-bottom: 0;
}

/* 卡片内分割线美化 */
.suggestion-card hr,
.analysis-card hr {
  border: none;
  border-top: 1px solid #ececec;
  margin: 16px 0;
}

/* 避免重复定义：去除多余的 trend-up/trend-down 样式，统一用上述高亮样式 */

/* 数字淡入动画 */
@keyframes fadeInNumber {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

span.trend-up,
.profit-positive,
span.trend-down,
.profit-negative {
  animation: fadeInNumber 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 卡片渐变边框与微光泽 */
.card,
.suggestion-card,
.analysis-card {
  position: relative;
  background-clip: padding-box;
  border: 2px solid transparent;
  /* 渐变边框 */
  border-image: linear-gradient(120deg, #aad1ff 0%, #e0e7ff 100%) 1;
  /* 微光泽 */
  box-shadow: 0 4px 24px rgba(0, 122, 255, 0.07),
    0 1.5px 0.5px 0 rgba(255, 255, 255, 0.12) inset;
}
.card::before,
.suggestion-card::before,
.analysis-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 18px;
  border-radius: 12px 12px 0 0;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.18) 0%,
    rgba(255, 255, 255, 0.04) 100%
  );
  pointer-events: none;
  z-index: 1;
}

/* 页脚链接样式优化 */
.site-footer a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px dotted transparent;
  transition: color 0.2s ease-in-out, border-bottom-color 0.2s ease-in-out;
}

.site-footer a:hover {
  color: var(--primary-color);
  border-bottom-color: var(--primary-color);
}

@media (prefers-color-scheme: dark) {
  .site-footer a:hover {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
  }
}

.site-footer span:last-child {
  font-weight: 500;
  color: #b0b0b5;
  margin-left: 8px;
}

@media (prefers-color-scheme: dark) {
  .site-footer span:last-child {
    color: #8e8e93;
  }
}

#trading-suggestions
  > div.suggestion-card.price-protection-card
  > div.warning-advice
  > ul {
  list-style: none;
  padding: 0;
  margin: 8px 0 0 0;
}

#trading-suggestions
  > div.suggestion-card.price-protection-card
  > div.warning-advice
  > ul
  > li {
  position: relative;
  margin-bottom: 6px;
  padding-left: 15px;
  color: var(--text-color-secondary);
  line-height: 1.4;
}

#trading-suggestions
  > div.suggestion-card.price-protection-card
  > div.warning-advice
  > ul
  > li::before {
  content: "•";
  position: absolute;
  left: 0;
  top: 0;
  color: var(--warning-color);
  font-weight: bold;
}
