:root {
  --primary-color: #4f46e5;
  --primary-hover: #4338ca;
  --primary-light: #eef2ff;
  --bg-gradient: linear-gradient(135deg, #f8fafc 0%, #e0e7ff 100%);
  --card-bg: #ffffff;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  --border-color: #e2e8f0;
  --border-focus: #818cf8;
  
  --success-bg: #ecfdf5;
  --success-border: #a7f3d0;
  --success-text: #065f46;
  --success-accent: #10b981;

  --warning-bg: #fff7ed;
  --warning-border: #fed7aa;
  --warning-text: #9a3412;
  --warning-accent: #f97316;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 10px 25px -5px rgba(79, 70, 229, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 20px 30px -10px rgba(0, 0, 0, 0.1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg-gradient);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 24px 16px;
  position: relative;
  overflow-x: hidden;
}

/* Decorative Background Blobs */
.background-decor {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  z-index: 0;
  pointer-events: none;
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.5;
}

.blob-1 {
  width: 350px;
  height: 350px;
  background: #a5b4fc;
  top: -50px;
  right: -50px;
}

.blob-2 {
  width: 300px;
  height: 300px;
  background: #ddd6fe;
  bottom: -40px;
  left: -40px;
}

/* App Container */
.app-container {
  width: 100%;
  max-width: 480px;
  z-index: 1;
  position: relative;
}

/* App Header */
.app-header {
  text-align: center;
  margin-bottom: 24px;
}

.header-icon {
  font-size: 40px;
  margin-bottom: 8px;
  display: inline-block;
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

.app-header h1 {
  font-size: 26px;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.5px;
  margin-bottom: 6px;
}

.subtitle {
  font-size: 14px;
  color: var(--text-muted);
  font-weight: 500;
}

/* Calculator Card */
.calc-card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  box-shadow: var(--shadow-md);
  border: 1px solid rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(10px);
}

/* Form Styles */
.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 8px;
}

.label-icon {
  font-size: 16px;
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.form-input {
  width: 100%;
  padding: 14px 44px 14px 16px;
  font-size: 16px;
  font-family: inherit;
  font-weight: 600;
  color: var(--text-main);
  background-color: #f8fafc;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  outline: none;
  transition: all 0.2s ease-in-out;
}

.form-input:focus {
  background-color: #ffffff;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.12);
}

.form-input::placeholder {
  color: var(--text-light);
  font-weight: 400;
  font-size: 14px;
}

.input-unit {
  position: absolute;
  right: 16px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  pointer-events: none;
}

.input-hint {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 6px;
  line-height: 1.4;
}

/* Quick Actions Chips */
.quick-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 24px;
}

.quick-title {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
}

.btn-chip {
  background: var(--primary-light);
  color: var(--primary-color);
  border: none;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-chip:hover {
  background: #e0e7ff;
  transform: translateY(-1px);
}

/* Primary Calculate Button */
.btn-primary {
  width: 100%;
  padding: 16px;
  background: linear-gradient(135deg, #4f46e5 0%, #3730a3 100%);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-md);
  font-size: 16px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.35);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #4338ca 0%, #312e81 100%);
  box-shadow: 0 6px 16px rgba(79, 70, 229, 0.45);
  transform: translateY(-2px);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-arrow {
  font-size: 18px;
  transition: transform 0.2s ease;
}

.btn-primary:hover .btn-arrow {
  transform: translateX(4px);
}

/* Result Section */
.result-container {
  margin-top: 24px;
  opacity: 1;
  transform: translateY(0);
  transition: all 0.3s ease-in-out;
}

.result-container.hidden {
  display: none;
  opacity: 0;
  transform: translateY(10px);
}

.divider {
  border: none;
  height: 1px;
  background: var(--border-color);
  margin-bottom: 24px;
}

/* Status Banner */
.status-banner {
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 20px;
  border: 1px solid transparent;
}

.status-banner.success {
  background-color: var(--success-bg);
  border-color: var(--success-border);
  color: var(--success-text);
}

.status-banner.warning {
  background-color: var(--warning-bg);
  border-color: var(--warning-border);
  color: var(--warning-text);
}

.status-icon {
  font-size: 24px;
  line-height: 1;
  margin-top: 2px;
}

.status-title {
  font-size: 16px;
  font-weight: 800;
  margin-bottom: 4px;
}

.status-desc {
  font-size: 13px;
  line-height: 1.5;
  opacity: 0.9;
}

/* Breakdown Card */
.breakdown-card {
  background-color: #f8fafc;
  border-radius: var(--radius-md);
  padding: 18px;
  border: 1px solid var(--border-color);
  margin-bottom: 16px;
}

.breakdown-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 14px;
}

.breakdown-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13.5px;
  color: var(--text-muted);
  padding: 8px 0;
  border-bottom: 1px dashed #e2e8f0;
}

.breakdown-row:last-child {
  border-bottom: none;
}

.breakdown-row small {
  font-size: 11px;
  color: var(--text-light);
}

.row-value {
  font-weight: 600;
  color: var(--text-main);
}

.font-bold {
  font-weight: 800 !important;
}

.highlight-row {
  background-color: #ffffff;
  padding: 10px 12px;
  margin: 4px -12px;
  border-radius: var(--radius-sm);
  border-bottom: none;
  color: var(--primary-color);
}

.highlight-row .row-label {
  color: var(--text-main);
  font-weight: 700;
}

.highlight-row .row-value {
  color: var(--primary-color);
  font-size: 15px;
}

.variance-row {
  padding-top: 10px;
}

/* Rule Card */
.rule-card {
  background-color: #f1f5f9;
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
}

.rule-title {
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 4px;
}

/* Footer */
.app-footer {
  text-align: center;
  margin-top: 24px;
  font-size: 12px;
  color: var(--text-muted);
}

/* Mobile Friendly Optimizations */
@media (max-width: 480px) {
  body {
    padding: 16px 12px;
  }
  
  .calc-card {
    padding: 22px 18px;
  }

  .app-header h1 {
    font-size: 22px;
  }
}
