/* Material Design 3 Base Styles */
:root {
  /* Light Theme Colors - 匹配Flutter项目的颜色方案 */
  --md-sys-color-primary: #36693d;
  --md-sys-color-on-primary: #ffffff;
  --md-sys-color-primary-container: #b8f1b9;
  --md-sys-color-on-primary-container: #1e5128;
  
  --md-sys-color-secondary: #516350;
  --md-sys-color-on-secondary: #ffffff;
  --md-sys-color-secondary-container: #d4e8d1;
  --md-sys-color-on-secondary-container: #3a4b3a;
  
  --md-sys-color-tertiary: #39656c;
  --md-sys-color-on-tertiary: #ffffff;
  --md-sys-color-tertiary-container: #bdeaf3;
  --md-sys-color-on-tertiary-container: #1f4d54;
  
  --md-sys-color-error: #ba1a1a;
  --md-sys-color-on-error: #ffffff;
  --md-sys-color-error-container: #ffdad6;
  --md-sys-color-on-error-container: #93000a;
  
  --md-sys-color-surface: #f7fbf2;
  --md-sys-color-on-surface: #181d18;
  --md-sys-color-surface-variant: #e0e4db;
  --md-sys-color-on-surface-variant: #424940;
  
  --md-sys-color-outline: #727970;
  --md-sys-color-outline-variant: #c1c9be;
  --md-sys-color-shadow: #000000;
  --md-sys-color-scrim: #000000;
  
  --md-sys-color-inverse-surface: #2d322c;
  --md-sys-color-inverse-on-surface: #eef2e9;
  --md-sys-color-inverse-primary: #9dd49f;
  
  --md-sys-color-surface-dim: #d7dbd3;
  --md-sys-color-surface-bright: #f7fbf2;
  --md-sys-color-surface-container-lowest: #ffffff;
  --md-sys-color-surface-container-low: #f1f5ec;
  --md-sys-color-surface-container: #ebefe7;
  --md-sys-color-surface-container-high: #e5e9e1;
  --md-sys-color-surface-container-highest: #e0e4db;
  
  /* Typography Scale - 匹配Flutter项目 */
  --md-sys-typescale-display-large-font-size: 57px;
  --md-sys-typescale-display-large-line-height: 64px;
  --md-sys-typescale-display-large-font-weight: 400;
  --md-sys-typescale-display-large-letter-spacing: -0.25px;
  
  --md-sys-typescale-display-medium-font-size: 45px;
  --md-sys-typescale-display-medium-line-height: 52px;
  --md-sys-typescale-display-medium-font-weight: 400;
  --md-sys-typescale-display-medium-letter-spacing: 0px;
  
  --md-sys-typescale-display-small-font-size: 36px;
  --md-sys-typescale-display-small-line-height: 44px;
  --md-sys-typescale-display-small-font-weight: 400;
  --md-sys-typescale-display-small-letter-spacing: 0px;
  
  --md-sys-typescale-headline-large-font-size: 32px;
  --md-sys-typescale-headline-large-line-height: 40px;
  --md-sys-typescale-headline-large-font-weight: 400;
  --md-sys-typescale-headline-large-letter-spacing: 0px;
  
  --md-sys-typescale-headline-medium-font-size: 28px;
  --md-sys-typescale-headline-medium-line-height: 36px;
  --md-sys-typescale-headline-medium-font-weight: 400;
  --md-sys-typescale-headline-medium-letter-spacing: 0px;
  
  --md-sys-typescale-headline-small-font-size: 24px;
  --md-sys-typescale-headline-small-line-height: 32px;
  --md-sys-typescale-headline-small-font-weight: 400;
  --md-sys-typescale-headline-small-letter-spacing: 0px;
  
  --md-sys-typescale-title-large-font-size: 22px;
  --md-sys-typescale-title-large-line-height: 28px;
  --md-sys-typescale-title-large-font-weight: 500;
  --md-sys-typescale-title-large-letter-spacing: 0px;
  
  --md-sys-typescale-title-medium-font-size: 16px;
  --md-sys-typescale-title-medium-line-height: 24px;
  --md-sys-typescale-title-medium-font-weight: 500;
  --md-sys-typescale-title-medium-letter-spacing: 0.15px;
  
  --md-sys-typescale-title-small-font-size: 14px;
  --md-sys-typescale-title-small-line-height: 20px;
  --md-sys-typescale-title-small-font-weight: 500;
  --md-sys-typescale-title-small-letter-spacing: 0.1px;
  
  --md-sys-typescale-body-large-font-size: 16px;
  --md-sys-typescale-body-large-line-height: 24px;
  --md-sys-typescale-body-large-font-weight: 400;
  --md-sys-typescale-body-large-letter-spacing: 0.15px;
  
  --md-sys-typescale-body-medium-font-size: 14px;
  --md-sys-typescale-body-medium-line-height: 20px;
  --md-sys-typescale-body-medium-font-weight: 400;
  --md-sys-typescale-body-medium-letter-spacing: 0.25px;
  
  --md-sys-typescale-body-small-font-size: 12px;
  --md-sys-typescale-body-small-line-height: 16px;
  --md-sys-typescale-body-small-font-weight: 400;
  --md-sys-typescale-body-small-letter-spacing: 0.4px;
  
  --md-sys-typescale-label-large-font-size: 14px;
  --md-sys-typescale-label-large-line-height: 20px;
  --md-sys-typescale-label-large-font-weight: 500;
  --md-sys-typescale-label-large-letter-spacing: 0.1px;
  
  --md-sys-typescale-label-medium-font-size: 12px;
  --md-sys-typescale-label-medium-line-height: 16px;
  --md-sys-typescale-label-medium-font-weight: 500;
  --md-sys-typescale-label-medium-letter-spacing: 0.5px;
  
  --md-sys-typescale-label-small-font-size: 11px;
  --md-sys-typescale-label-small-line-height: 16px;
  --md-sys-typescale-label-small-font-weight: 500;
  --md-sys-typescale-label-small-letter-spacing: 0.5px;
  
  /* Shape Tokens */
  --md-sys-shape-corner-none: 0px;
  --md-sys-shape-corner-extra-small: 4px;
  --md-sys-shape-corner-small: 8px;
  --md-sys-shape-corner-medium: 12px;
  --md-sys-shape-corner-large: 16px;
  --md-sys-shape-corner-extra-large: 28px;
  
  /* Motion Tokens */
  --md-sys-motion-easing-standard: cubic-bezier(0.2, 0.0, 0, 1.0);
  --md-sys-motion-easing-emphasized: cubic-bezier(0.2, 0.0, 0, 1.0);
  --md-sys-motion-easing-emphasized-decelerate: cubic-bezier(0.05, 0.7, 0.1, 1.0);
  --md-sys-motion-easing-emphasized-accelerate: cubic-bezier(0.3, 0.0, 0.8, 0.15);
  --md-sys-motion-duration-short1: 50ms;
  --md-sys-motion-duration-short2: 100ms;
  --md-sys-motion-duration-short3: 150ms;
  --md-sys-motion-duration-short4: 200ms;
  --md-sys-motion-duration-medium1: 250ms;
  --md-sys-motion-duration-medium2: 300ms;
  --md-sys-motion-duration-medium3: 350ms;
  --md-sys-motion-duration-medium4: 400ms;
  --md-sys-motion-duration-long1: 450ms;
  --md-sys-motion-duration-long2: 500ms;
  --md-sys-motion-duration-long3: 550ms;
  --md-sys-motion-duration-long4: 600ms;
  --md-sys-motion-duration-extra-long1: 700ms;
  --md-sys-motion-duration-extra-long2: 800ms;
  --md-sys-motion-duration-extra-long3: 900ms;
  --md-sys-motion-duration-extra-long4: 1000ms;
}

/* Dark Theme Colors */
.dark-theme {
  --md-sys-color-primary: #9dd49f;
  --md-sys-color-on-primary: #013913;
  --md-sys-color-primary-container: #1e5128;
  --md-sys-color-on-primary-container: #b8f1b9;
  
  --md-sys-color-secondary: #b8ccb5;
  --md-sys-color-on-secondary: #243424;
  --md-sys-color-secondary-container: #3a4b3a;
  --md-sys-color-on-secondary-container: #d4e8d1;
  
  --md-sys-color-tertiary: #a1ced6;
  --md-sys-color-on-tertiary: #00363d;
  --md-sys-color-tertiary-container: #1f4d54;
  --md-sys-color-on-tertiary-container: #bdeaf3;
  
  --md-sys-color-error: #ffb4ab;
  --md-sys-color-on-error: #690005;
  --md-sys-color-error-container: #93000a;
  --md-sys-color-on-error-container: #ffdad6;
  
  --md-sys-color-surface: #101510;
  --md-sys-color-on-surface: #e0e4db;
  --md-sys-color-surface-variant: #424940;
  --md-sys-color-on-surface-variant: #c1c9be;
  
  --md-sys-color-outline: #8b9389;
  --md-sys-color-outline-variant: #424940;
  --md-sys-color-shadow: #000000;
  --md-sys-color-scrim: #000000;
  
  --md-sys-color-inverse-surface: #e0e4db;
  --md-sys-color-inverse-on-surface: #2d322c;
  --md-sys-color-inverse-primary: #36693d;
  
  --md-sys-color-surface-dim: #101510;
  --md-sys-color-surface-bright: #363a35;
  --md-sys-color-surface-container-lowest: #0b0f0b;
  --md-sys-color-surface-container-low: #181d18;
  --md-sys-color-surface-container: #1c211c;
  --md-sys-color-surface-container-high: #272b26;
  --md-sys-color-surface-container-highest: #313630;
}

/* Base Styles */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background-color: var(--md-sys-color-surface);
  color: var(--md-sys-color-on-surface);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Typography Classes */
.md3-display-large {
  font-size: var(--md-sys-typescale-display-large-font-size);
  line-height: var(--md-sys-typescale-display-large-line-height);
  font-weight: var(--md-sys-typescale-display-large-font-weight);
  letter-spacing: var(--md-sys-typescale-display-large-letter-spacing);
}

.md3-display-medium {
  font-size: var(--md-sys-typescale-display-medium-font-size);
  line-height: var(--md-sys-typescale-display-medium-line-height);
  font-weight: var(--md-sys-typescale-display-medium-font-weight);
  letter-spacing: var(--md-sys-typescale-display-medium-letter-spacing);
}

.md3-display-small {
  font-size: var(--md-sys-typescale-display-small-font-size);
  line-height: var(--md-sys-typescale-display-small-line-height);
  font-weight: var(--md-sys-typescale-display-small-font-weight);
  letter-spacing: var(--md-sys-typescale-display-small-letter-spacing);
}

.md3-headline-large {
  font-size: var(--md-sys-typescale-headline-large-font-size);
  line-height: var(--md-sys-typescale-headline-large-line-height);
  font-weight: var(--md-sys-typescale-headline-large-font-weight);
  letter-spacing: var(--md-sys-typescale-headline-large-letter-spacing);
}

.md3-headline-medium {
  font-size: var(--md-sys-typescale-headline-medium-font-size);
  line-height: var(--md-sys-typescale-headline-medium-line-height);
  font-weight: var(--md-sys-typescale-headline-medium-font-weight);
  letter-spacing: var(--md-sys-typescale-headline-medium-letter-spacing);
}

.md3-headline-small {
  font-size: var(--md-sys-typescale-headline-small-font-size);
  line-height: var(--md-sys-typescale-headline-small-line-height);
  font-weight: var(--md-sys-typescale-headline-small-font-weight);
  letter-spacing: var(--md-sys-typescale-headline-small-letter-spacing);
}

.md3-title-large {
  font-size: var(--md-sys-typescale-title-large-font-size);
  line-height: var(--md-sys-typescale-title-large-line-height);
  font-weight: var(--md-sys-typescale-title-large-font-weight);
  letter-spacing: var(--md-sys-typescale-title-large-letter-spacing);
}

.md3-title-medium {
  font-size: var(--md-sys-typescale-title-medium-font-size);
  line-height: var(--md-sys-typescale-title-medium-line-height);
  font-weight: var(--md-sys-typescale-title-medium-font-weight);
  letter-spacing: var(--md-sys-typescale-title-medium-letter-spacing);
}

.md3-title-small {
  font-size: var(--md-sys-typescale-title-small-font-size);
  line-height: var(--md-sys-typescale-title-small-line-height);
  font-weight: var(--md-sys-typescale-title-small-font-weight);
  letter-spacing: var(--md-sys-typescale-title-small-letter-spacing);
}

.md3-body-large {
  font-size: var(--md-sys-typescale-body-large-font-size);
  line-height: var(--md-sys-typescale-body-large-line-height);
  font-weight: var(--md-sys-typescale-body-large-font-weight);
  letter-spacing: var(--md-sys-typescale-body-large-letter-spacing);
}

.md3-body-medium {
  font-size: var(--md-sys-typescale-body-medium-font-size);
  line-height: var(--md-sys-typescale-body-medium-line-height);
  font-weight: var(--md-sys-typescale-body-medium-font-weight);
  letter-spacing: var(--md-sys-typescale-body-medium-letter-spacing);
}

.md3-body-small {
  font-size: var(--md-sys-typescale-body-small-font-size);
  line-height: var(--md-sys-typescale-body-small-line-height);
  font-weight: var(--md-sys-typescale-body-small-font-weight);
  letter-spacing: var(--md-sys-typescale-body-small-letter-spacing);
}

.md3-label-large {
  font-size: var(--md-sys-typescale-label-large-font-size);
  line-height: var(--md-sys-typescale-label-large-line-height);
  font-weight: var(--md-sys-typescale-label-large-font-weight);
  letter-spacing: var(--md-sys-typescale-label-large-letter-spacing);
}

.md3-label-medium {
  font-size: var(--md-sys-typescale-label-medium-font-size);
  line-height: var(--md-sys-typescale-label-medium-line-height);
  font-weight: var(--md-sys-typescale-label-medium-font-weight);
  letter-spacing: var(--md-sys-typescale-label-medium-letter-spacing);
}

.md3-label-small {
  font-size: var(--md-sys-typescale-label-small-font-size);
  line-height: var(--md-sys-typescale-label-small-line-height);
  font-weight: var(--md-sys-typescale-label-small-font-weight);
  letter-spacing: var(--md-sys-typescale-label-small-letter-spacing);
}

/* Surface Classes */
.md3-surface {
  background-color: var(--md-sys-color-surface);
  color: var(--md-sys-color-on-surface);
}

.md3-surface-variant {
  background-color: var(--md-sys-color-surface-variant);
  color: var(--md-sys-color-on-surface-variant);
}

.md3-surface-container-lowest {
  background-color: var(--md-sys-color-surface-container-lowest);
  color: var(--md-sys-color-on-surface);
}

.md3-surface-container-low {
  background-color: var(--md-sys-color-surface-container-low);
  color: var(--md-sys-color-on-surface);
}

.md3-surface-container {
  background-color: var(--md-sys-color-surface-container);
  color: var(--md-sys-color-on-surface);
}

.md3-surface-container-high {
  background-color: var(--md-sys-color-surface-container-high);
  color: var(--md-sys-color-on-surface);
}

.md3-surface-container-highest {
  background-color: var(--md-sys-color-surface-container-highest);
  color: var(--md-sys-color-on-surface);
}

/* Button Components */
.md3-icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border: none;
  border-radius: var(--md-sys-shape-corner-extra-large);
  background-color: transparent;
  color: var(--md-sys-color-on-surface-variant);
  cursor: pointer;
  transition: all var(--md-sys-motion-duration-short2) var(--md-sys-motion-easing-standard);
  position: relative;
  overflow: hidden;
}

.md3-icon-button:hover {
  background-color: var(--md-sys-color-on-surface-variant);
  opacity: 0.08;
}

.md3-icon-button:focus {
  outline: none;
}

.md3-icon-button:focus::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--md-sys-color-on-surface-variant);
  opacity: 0.12;
  border-radius: inherit;
}

.md3-icon-button:active {
  background-color: var(--md-sys-color-on-surface-variant);
  opacity: 0.12;
}

.md3-text-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 10px 12px;
  border: none;
  border-radius: var(--md-sys-shape-corner-medium);
  background-color: transparent;
  color: var(--md-sys-color-primary);
  font-size: var(--md-sys-typescale-label-large-font-size);
  font-weight: var(--md-sys-typescale-label-large-font-weight);
  letter-spacing: var(--md-sys-typescale-label-large-letter-spacing);
  cursor: pointer;
  transition: all var(--md-sys-motion-duration-short2) var(--md-sys-motion-easing-standard);
  position: relative;
  overflow: hidden;
}

.md3-text-button:hover {
  background-color: var(--md-sys-color-primary);
  opacity: 0.08;
}

.md3-text-button:focus {
  outline: none;
  background-color: var(--md-sys-color-primary);
  opacity: 0.12;
}

.md3-text-button:active {
  background-color: var(--md-sys-color-primary);
  opacity: 0.12;
}

/* Elevation */
.md3-elevation-0 {
  box-shadow: none;
}

.md3-elevation-1 {
  box-shadow: 0px 1px 2px 0px rgba(0, 0, 0, 0.3), 0px 1px 3px 1px rgba(0, 0, 0, 0.15);
}

.md3-elevation-2 {
  box-shadow: 0px 1px 2px 0px rgba(0, 0, 0, 0.3), 0px 2px 6px 2px rgba(0, 0, 0, 0.15);
}

.md3-elevation-3 {
  box-shadow: 0px 1px 3px 0px rgba(0, 0, 0, 0.3), 0px 4px 8px 3px rgba(0, 0, 0, 0.15);
}

.md3-elevation-4 {
  box-shadow: 0px 2px 3px 0px rgba(0, 0, 0, 0.3), 0px 6px 10px 4px rgba(0, 0, 0, 0.15);
}

.md3-elevation-5 {
  box-shadow: 0px 4px 4px 0px rgba(0, 0, 0, 0.3), 0px 8px 12px 6px rgba(0, 0, 0, 0.15);
}

/* Responsive Design */
@media (max-width: 600px) {
  :root {
    --md-sys-typescale-display-large-font-size: 40px;
    --md-sys-typescale-display-large-line-height: 48px;
    --md-sys-typescale-display-medium-font-size: 32px;
    --md-sys-typescale-display-medium-line-height: 40px;
    --md-sys-typescale-display-small-font-size: 28px;
    --md-sys-typescale-display-small-line-height: 36px;
    --md-sys-typescale-headline-large-font-size: 28px;
    --md-sys-typescale-headline-large-line-height: 36px;
    --md-sys-typescale-headline-medium-font-size: 24px;
    --md-sys-typescale-headline-medium-line-height: 32px;
  }
}

