@font-face {
    font-family: 'MiSans';
    src: url('https://file.icve.com.cn/file_doc/qdqqd/8351771681661375.woff2') format('woff2');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
    unicode-range: U+0020-007E, U+00A0-00FF, U+4E00-9FFF;
}

:root {
    --md-sys-color-primary: #6750A4;
    --md-sys-color-on-primary: #FFFFFF;
    --md-sys-color-primary-container: #EADDFF;
    --md-sys-color-on-primary-container: #21005D;
    --md-sys-color-secondary: #625B71;
    --md-sys-color-on-secondary: #FFFFFF;
    --md-sys-color-secondary-container: #E8DEF8;
    --md-sys-color-on-secondary-container: #1D192B;
    --md-sys-color-tertiary: #7D5260;
    --md-sys-color-on-tertiary: #FFFFFF;
    --md-sys-color-tertiary-container: #E8DEF8;
    --md-sys-color-on-tertiary-container: #1D192B;
    --md-sys-color-error: #B3261E;
    --md-sys-color-on-error: #FFFFFF;
    --md-sys-color-error-container: #F9DEDC;
    --md-sys-color-on-error-container: #410E0B;
    --md-sys-color-background: #FFFBFE;
    --md-sys-color-on-background: #1C1B1F;
    --md-sys-color-surface: #FFFBFE;
    --md-sys-color-on-surface: #1C1B1F;
    --md-sys-color-surface-variant: #E7E0EC;
    --md-sys-color-on-surface-variant: #49454F;
    --md-sys-color-outline: #79747E;
    --md-sys-color-outline-variant: #CAC4D0;
    --md-sys-color-inverse-surface: #313033;
    --md-sys-color-inverse-on-surface: #F4EFF4;
    --md-sys-color-inverse-primary: #D0BCFF;
    --md-sys-color-surface-dim: #DED8E1;
    --md-sys-color-surface-bright: #FFFBFE;
    --md-sys-color-surface-container-lowest: #FFFFFF;
    --md-sys-color-surface-container-low: #F7F2FA;
    --md-sys-color-surface-container: #F3EDF7;
    --md-sys-color-surface-container-high: #ECE6F0;
    --md-sys-color-surface-container-highest: #E6E0E9;

    /* RGB 版本用于半透明效果 */
    --md-sys-color-surface-rgb: 255, 251, 254;
    --md-sys-color-background-rgb: 255, 251, 254;

    --md-sys-typescale-display-large: 57px;
    --md-sys-typescale-display-medium: 45px;
    --md-sys-typescale-display-small: 36px;
    --md-sys-typescale-headline-large: 32px;
    --md-sys-typescale-headline-medium: 28px;
    --md-sys-typescale-headline-small: 24px;
    --md-sys-typescale-title-large: 22px;
    --md-sys-typescale-title-medium: 16px;
    --md-sys-typescale-title-small: 14px;
    --md-sys-typescale-body-large: 16px;
    --md-sys-typescale-body-medium: 14px;
    --md-sys-typescale-body-small: 12px;
    --md-sys-typescale-label-large: 14px;
    --md-sys-typescale-label-medium: 12px;
    --md-sys-typescale-label-small: 11px;

    --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;
    --md-sys-shape-corner-full: 9999px;

    --md-sys-motion-easing-standard: cubic-bezier(0.2, 0, 0, 1);
    --md-sys-motion-easing-emphasized: cubic-bezier(0.2, 0, 0, 1);
    --md-sys-motion-easing-emphasized-decelerate: cubic-bezier(0.05, 0.7, 0.1, 1);
    --md-sys-motion-easing-emphasized-accelerate: cubic-bezier(0.3, 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;

    --transition-fast: var(--md-sys-motion-duration-short4) var(--md-sys-motion-easing-standard);
    --transition-medium: var(--md-sys-motion-duration-medium2) var(--md-sys-motion-easing-emphasized);
    --transition-slow: var(--md-sys-motion-duration-long2) var(--md-sys-motion-easing-emphasized);

    --card-gap: 24px;
    --card-border-radius: var(--md-sys-shape-corner-extra-large);
    --icon-size-sm: 20px;
    --icon-size-md: 24px;
    --icon-size-lg: 28px;
    --icon-size-xl: 48px;

    /* MD3 Elevation 阴影系统 */
    --md-sys-elevation-0: none;
    --md-sys-elevation-1: 0px 1px 3px 1px rgba(0, 0, 0, 0.15), 0px 1px 2px 0px rgba(0, 0, 0, 0.3);
    --md-sys-elevation-2: 0px 2px 6px 2px rgba(0, 0, 0, 0.15), 0px 1px 2px 0px rgba(0, 0, 0, 0.3);
    --md-sys-elevation-3: 0px 4px 8px 3px rgba(0, 0, 0, 0.15), 0px 1px 3px 0px rgba(0, 0, 0, 0.3);
    --md-sys-elevation-4: 0px 6px 10px 4px rgba(0, 0, 0, 0.15), 0px 2px 3px 0px rgba(0, 0, 0, 0.3);
    --md-sys-elevation-5: 0px 8px 12px 6px rgba(0, 0, 0, 0.15), 0px 4px 4px 0px rgba(0, 0, 0, 0.3);
    
    /* 超淡均匀阴影 - 用于悬浮效果 */
    --md-sys-elevation-subtle: 0px 2px 8px 2px rgba(0, 0, 0, 0.06), 0px 1px 2px 0px rgba(0, 0, 0, 0.08);
}

[data-theme="dark"] {
    --md-sys-color-primary: #D0BCFF;
    --md-sys-color-on-primary: #381E72;
    --md-sys-color-primary-container: #4F378B;
    --md-sys-color-on-primary-container: #EADDFF;
    --md-sys-color-secondary: #CCC2DC;
    --md-sys-color-on-secondary: #332D41;
    --md-sys-color-secondary-container: #4A4458;
    --md-sys-color-on-secondary-container: #E8DEF8;
    --md-sys-color-tertiary: #EFB8C8;
    --md-sys-color-on-tertiary: #492532;
    --md-sys-color-tertiary-container: #633B48;
    --md-sys-color-on-tertiary-container: #FFD8E4;
    --md-sys-color-error: #F2B8B5;
    --md-sys-color-on-error: #601410;
    --md-sys-color-error-container: #8C1D18;
    --md-sys-color-on-error-container: #F9DEDC;
    --md-sys-color-background: #1C1B1F;
    --md-sys-color-on-background: #E6E1E5;
    --md-sys-color-surface: #1C1B1F;
    --md-sys-color-on-surface: #E6E1E5;
    --md-sys-color-surface-variant: #49454F;
    --md-sys-color-on-surface-variant: #CAC4D0;
    --md-sys-color-outline: #938F99;
    --md-sys-color-outline-variant: #49454F;
    --md-sys-color-inverse-surface: #E6E1E5;
    --md-sys-color-inverse-on-surface: #313033;
    --md-sys-color-inverse-primary: #6750A4;
    --md-sys-color-surface-dim: #141218;
    --md-sys-color-surface-bright: #3B383E;
    --md-sys-color-surface-container-lowest: #0F0D13;
    --md-sys-color-surface-container-low: #1D1B20;
    --md-sys-color-surface-container: #211F26;
    --md-sys-color-surface-container-high: #2B2930;
    --md-sys-color-surface-container-highest: #36343B;

    /* RGB 版本用于半透明效果（深色模式） */
    --md-sys-color-surface-rgb: 28, 27, 31;
    --md-sys-color-background-rgb: 28, 27, 31;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'MiSans', 'Noto Sans SC', 'Roboto', sans-serif;
    background-color: var(--md-sys-color-background);
    color: var(--md-sys-color-on-background);
    line-height: 1.6;
    transition: background-color var(--transition-medium), color var(--transition-medium);
}

.md3-card {
    background-color: var(--md-sys-color-surface-container);
    border-radius: var(--card-border-radius);
    padding: 24px;
}

.icon-container {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.icon-container .material-icons-round {
    display: flex;
    align-items: center;
    justify-content: center;
}

.md3-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: inherit;
    font-size: var(--md-sys-typescale-label-large);
    font-weight: 500;
    letter-spacing: 0.1px;
    text-decoration: none;
    border: none;
    cursor: pointer;
    overflow: hidden;
    position: relative;
    min-width: 48px;
    height: 40px;
    padding: 0 24px;
    /* 胶囊形状：左右两边是半圆 */
    border-radius: 20px;
    will-change: border-radius, transform;
    transform: translateZ(0);
    backface-visibility: hidden;
    transition: border-radius 200ms cubic-bezier(0.4, 0, 0.2, 1),
                background-color 150ms cubic-bezier(0.4, 0, 0.2, 1),
                transform 100ms cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 200ms cubic-bezier(0.4, 0, 0.2, 1);
}

.md3-btn:hover {
    /* 悬停时变为更大的圆角矩形 */
    border-radius: 12px;
    transform: translateZ(0) scale(1.02);
}

.md3-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: currentColor;
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.md3-btn:hover::before {
    opacity: 0.08;
}

.md3-btn:active::before {
    opacity: 0.12;
}

.md3-btn:active {
    /* 按下时变为小圆角矩形 */
    border-radius: 8px;
    transform: translateZ(0) scale(0.96);
    transition: border-radius 100ms cubic-bezier(0.4, 0, 0.2, 1),
                background-color 100ms cubic-bezier(0.4, 0, 0.2, 1),
                transform 80ms cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 100ms cubic-bezier(0.4, 0, 0.2, 1);
}

.md3-btn .material-icons-round {
    font-size: var(--icon-size-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform var(--transition-fast);
}

.md3-btn:hover .material-icons-round {
    transform: scale(1.1);
}

.md3-btn-filled {
    background-color: var(--md-sys-color-primary);
    color: var(--md-sys-color-on-primary);
}

.md3-btn-filled:hover {
    background-color: var(--md-sys-color-primary);
}

.md3-btn-filled:active {
    transform: translateZ(0) scale(0.96);
}

.md3-btn-outlined {
    background-color: transparent;
    color: var(--md-sys-color-primary);
    border: 1px solid var(--md-sys-color-outline);
}

.md3-btn-outlined:hover {
    background-color: var(--md-sys-color-primary);
    color: var(--md-sys-color-on-primary);
    border-color: var(--md-sys-color-primary);
}

.md3-btn-outlined:active {
    transform: translateZ(0) scale(0.96);
}

.md3-btn-text {
    background-color: transparent;
    color: var(--md-sys-color-primary);
    padding: 0 12px;
}

.md3-btn-text:active {
    transform: translateZ(0) scale(0.96);
}

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

.md3-btn-tonal:active {
    transform: translateZ(0) scale(0.96);
}

.md3-btn-icon {
    padding: 8px;
    min-width: 40px;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background-color: transparent;
    color: var(--md-sys-color-on-surface-variant);
    transition: all 0.12s ease-out;
}

.md3-btn-icon:hover {
    background-color: var(--md-sys-color-surface-variant);
    color: var(--md-sys-color-on-surface);
    border-radius: 15px;
}

.md3-btn-icon:active {
    transform: scale(0.92);
}

.md3-btn-extended {
    border-radius: var(--md-sys-shape-corner-large);
    padding: 0 16px 0 12px;
}

.md3-btn-extended .material-icons-round {
    margin-left: -4px;
    margin-right: 4px;
}

.md3-fab {
    width: 56px;
    height: 56px;
    border-radius: var(--md-sys-shape-corner-large);
    background-color: var(--md-sys-color-primary-container);
    color: var(--md-sys-color-on-primary-container);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-medium);
}

.md3-fab:hover {
    transform: scale(1.05);
}

.md3-fab-extended {
    width: auto;
    padding: 0 20px;
    gap: 12px;
}

.md3-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 16px;
    border-radius: var(--md-sys-shape-corner-small);
    font-size: var(--md-sys-typescale-label-large);
    font-weight: 500;
    background-color: var(--md-sys-color-surface-container-low);
    color: var(--md-sys-color-on-surface-variant);
    border: 1px solid var(--md-sys-color-outline);
    cursor: pointer;
    transition: all var(--transition-fast);
}

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

.md3-chip-selected {
    background-color: var(--md-sys-color-secondary-container);
    color: var(--md-sys-color-on-secondary-container);
    border-color: transparent;
}

.md3-input {
    width: 100%;
    padding: 16px;
    border: none;
    border-radius: var(--md-sys-shape-corner-extra-small)
                   var(--md-sys-shape-corner-extra-small)
                   0 0;
    background-color: var(--md-sys-color-surface-container-highest);
    color: var(--md-sys-color-on-surface);
    font-family: inherit;
    font-size: var(--md-sys-typescale-body-large);
    transition: background-color var(--transition-fast);
    border-bottom: 1px solid var(--md-sys-color-on-surface-variant);
}

.md3-input:focus {
    outline: none;
    background-color: var(--md-sys-color-surface-container-highest);
    border-bottom: 2px solid var(--md-sys-color-primary);
}

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

.md3-textarea {
    min-height: 120px;
    resize: vertical;
    border-radius: var(--md-sys-shape-corner-medium);
    border: 1px solid var(--md-sys-color-outline-variant);
    border-bottom: none;
}

.md3-textarea:focus {
    border: 2px solid var(--md-sys-color-primary);
}

.glass-effect {
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    background-color: rgba(var(--md-sys-color-surface-rgb, 255, 251, 254), 0.7);
}

[data-theme="dark"] .glass-effect {
    background-color: rgba(var(--md-sys-color-surface-rgb, 28, 27, 31), 0.7);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.animate-fade-in {
    animation: fadeIn var(--md-sys-motion-duration-medium4) var(--md-sys-motion-easing-emphasized-decelerate);
}

.animate-slide-in {
    animation: slideIn var(--md-sys-motion-duration-medium4) var(--md-sys-motion-easing-emphasized-decelerate);
}

.animate-scale-in {
    animation: scaleIn var(--md-sys-motion-duration-medium4) var(--md-sys-motion-easing-emphasized-decelerate);
}

.skeleton {
    background: linear-gradient(90deg, 
        var(--md-sys-color-surface-container) 25%, 
        var(--md-sys-color-surface-container-high) 50%, 
        var(--md-sys-color-surface-container) 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: var(--md-sys-shape-corner-small);
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

.ripple {
    position: relative;
    overflow: hidden;
}

.ripple::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background-color: currentColor;
    opacity: 0.2;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s ease-out, height 0.6s ease-out, opacity 0.6s ease-out;
}

.ripple:active::after {
    width: 200px;
    height: 200px;
    opacity: 0;
}

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--md-sys-color-surface-container);
    border-radius: var(--md-sys-shape-corner-full);
}

::-webkit-scrollbar-thumb {
    background: var(--md-sys-color-outline);
    border-radius: var(--md-sys-shape-corner-full);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--md-sys-color-on-surface-variant);
}

::selection {
    background-color: var(--md-sys-color-primary-container);
    color: var(--md-sys-color-on-primary-container);
}
