@keyframes slideIn {
    0% {
        transform: translateX(100%);
        opacity: 0
    }

    to {
        transform: translateX(0);
        opacity: 1
    }
}

:root {
    --bg-primary: #F0F4F8;
    --bg-surface: #FFFFFF;
    --bg-surface-alt: #E2E8F0;
    --bg-surface-hover: #F1F5F9;
    --border: #CBD5E1;
    --text-primary: #1E293B;
    --text-secondary: #475569;
    --text-muted: #64748B;
    --accent: #2563EB;
    --accent-hover: #1D4ED8;
    --accent-light: #DBEAFE;
    --success: #059669;
    --danger: #DC2626;
    --warning: #D97706;
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --space-8: 32px;
    --header-height: 80px;
    --max-width: 1300px;
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px
}

@media (prefers-color-scheme:dark) {
    :root:not([data-theme=light]) {
        --bg-primary: #0F172A;
        --bg-surface: #1E293B;
        --bg-surface-alt: #334155;
        --bg-surface-hover: #334155;
        --border: #475569;
        --text-primary: #F1F5F9;
        --text-secondary: #94A3B8;
        --accent: #3B82F6;
        --accent-hover: #60A5FA;
        --accent-light: #1E3A5F
    }
}

*,
::after,
::before {
    box-sizing: border-box
}

html {
    height: 100%;
    scroll-behavior: smooth
}

body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 14px;
    line-height: 1.6;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased
}

a {
    text-decoration: none;
    color: inherit
}

button,
input,
select,
textarea {
    font-family: inherit
}

.app-main,
.app-root {
    display: flex;
    flex-direction: column
}

.app-root,
body {
    min-height: 100vh
}

.app-main {
    flex: 1;
    width: 100%
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    width: 100%;
    height: var(--header-height);
    flex-shrink: 0;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border)
}

.site-header__inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--space-6);
    height: 100%;
    box-sizing: border-box
}

.site-header__left,
.site-header__logo {
    display: flex;
    align-items: center;
    gap: var(--space-8)
}

.site-header__logo {
    gap: var(--space-3);
    text-decoration: none;
    color: var(--text-primary)
}

.site-header__logo-mark {
    width: 68px;
    height: 32px;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-hover) 100%);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(37, 99, 235, .3)
}

.site-header__brand {
    font-size: 16px;
    font-weight: 700;
    letter-spacing: -.02em
}

.site-header__nav {
    display: flex;
    align-items: center;
    gap: var(--space-1)
}

.site-header__nav-link {
    padding: 6px 16px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    transition: background .15s, color .15s;
    text-decoration: none
}

.site-header__nav-link:hover {
    background: var(--bg-surface-alt);
    color: var(--text-primary)
}

.site-header__nav-link.active {
    background: var(--accent-light);
    color: var(--accent)
}

.site-header__actions {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin-left: auto
}

.header-user-name {
    font-size: 14px;
    color: var(--text-secondary);
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap
}

.page-container,
.site-footer {
    width: 100%;
    box-sizing: border-box
}

.page-container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: var(--space-6) var(--space-6)0;
    flex: 1;
    display: flex;
    flex-direction: column
}

.site-footer {
    flex-shrink: 0;
    background: var(--bg-surface);
    border-top: 1px solid var(--border);
    padding: var(--space-6);
    margin-top: auto
}

.site-footer__inner {
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    text-align: center;
    padding-top: var(--space-4)
}

.site-footer__links {
    margin-bottom: var(--space-1)
}

.site-footer__link {
    color: var(--text-muted);
    font-size: 14px
}

.site-footer__link:hover {
    color: var(--accent)
}

.site-footer__sep {
    color: var(--border);
    margin: 0 var(--space-2);
    font-size: 13px
}

.site-footer__legal {
    font-size: 14px;
    color: var(--text-muted)
}

.site-footer__legal p {
    margin: 4px 0
}

.footer-badges {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px
}

.footer-badge {
    height: 20px;
    vertical-align: middle
}

.btn,
.btn-tips a {
    text-decoration: none
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    border-radius: var(--radius-md);
    border: 0;
    cursor: pointer;
    transition: all .15s
}

.btn-primary {
    background: var(--accent);
    color: #fff
}

.btn-primary:hover {
    background: var(--accent-hover)
}

.btn-secondary {
    background: var(--bg-surface);
    color: var(--text-primary);
    border: 1px solid var(--border)
}

.btn-secondary:hover {
    border-color: var(--accent);
    color: var(--accent)
}

.btn-danger {
    background: var(--danger);
    color: #fff
}

.btn-danger:hover {
    opacity: .9
}

.btn-sm {
    padding: 6px 12px;
    font-size: 13px
}

.btn-xs {
    padding: 3px 8px;
    font-size: 11px
}

.btn-lg {
    padding: 14px 28px;
    font-size: 16px
}

.btn-disabled {
    opacity: .5;
    cursor: not-allowed;
    background: var(--bg-surface-alt) !important;
    color: var(--text-secondary) !important;
    border: 1px solid var(--border) !important
}

.btn-tips {
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: var(--space-3);
    min-height: 20px
}

.btn-tips a {
    color: var(--accent)
}

.btn-tips a:hover {
    text-decoration: underline
}

.btn-block {
    width: 100%
}

.btn:disabled {
    opacity: .5;
    cursor: not-allowed
}

.form-group {
    margin-bottom: var(--space-4)
}

.form-input,
.form-label {
    font-size: 14px;
    color: var(--text-primary)
}

.form-label {
    display: block;
    font-weight: 500;
    margin-bottom: var(--space-2)
}

.form-input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--bg-surface);
    transition: border-color .15s, box-shadow .15s
}

.form-input:focus {
    outline: 0;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-light)
}

.form-input::placeholder {
    color: var(--text-muted)
}

.form-error,
.form-select {
    border-radius: var(--radius-md);
    font-size: 14px
}

.form-select {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    background: var(--bg-surface);
    color: var(--text-primary)
}

.form-error {
    background: #fef2f2;
    color: var(--danger);
    padding: 12px;
    margin-bottom: var(--space-4)
}

.card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-6)
}

.card-sm {
    padding: var(--space-4)
}

.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500
}

.badge-green {
    background: #dcfce7;
    color: #16a34a
}

.badge-blue {
    background: #dbeafe;
    color: #3b82f6
}

.badge-purple {
    background: #f3e8ff;
    color: #9333ea
}

.badge-cyan {
    background: #e0f9fc;
    color: #0891b2
}

.badge-gold {
    background: #fef9c3;
    color: #a16207
}

.badge-slate {
    background: #e2e8f0;
    color: #475569
}

.badge-gray {
    background: #f3f4f6;
    color: #6b7280
}

.badge-amber {
    background: #fef3c7;
    color: #92400e
}

.badge-orange {
    background: #ffedd5;
    color: #ea580c
}

.badge-rose {
    background: #fce7f3;
    color: #be185d
}

.badge-red {
    background: #fee2e2;
    color: #dc2626
}

.badge-sky {
    background: #e0f2fe;
    color: #0369a1
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-4)
}

.section-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    display: flex;
    align-items: center;
    gap: var(--space-2)
}

.section-title::before {
    content: "";
    display: inline-block;
    width: 4px;
    height: 18px;
    background: var(--accent);
    border-radius: 2px
}

.section-link {
    font-size: 13px;
    color: var(--accent)
}

.section-link:hover {
    text-decoration: underline
}

.text-muted {
    color: var(--text-muted)
}

.text-secondary {
    color: var(--text-secondary)
}

.text-accent {
    color: var(--accent)
}

.text-danger {
    color: var(--danger)
}

.text-center {
    text-align: center
}

.text-right {
    text-align: right
}

.font-bold {
    font-weight: 700
}

.mt-1 {
    margin-top: var(--space-1)
}

.mt-2 {
    margin-top: var(--space-2)
}

.mt-4 {
    margin-top: var(--space-4)
}

.mb-2 {
    margin-bottom: var(--space-2)
}

.mb-4 {
    margin-bottom: var(--space-4)
}

.mb-6 {
    margin-bottom: var(--space-6)
}

.mb-8 {
    margin-bottom: var(--space-8)
}

.ml-2 {
    margin-left: var(--space-2)
}

.ml-auto {
    margin-left: auto
}

.p-4 {
    padding: var(--space-4)
}

.p-6 {
    padding: var(--space-6)
}

.px-4 {
    padding-left: var(--space-4);
    padding-right: var(--space-4)
}

.py-2 {
    padding-top: var(--space-2);
    padding-bottom: var(--space-2)
}

.gap-2 {
    gap: var(--space-2)
}

.gap-3 {
    gap: var(--space-3)
}

.gap-4 {
    gap: var(--space-4)
}

.flex {
    display: flex
}

.flex-col {
    flex-direction: column
}

.flex-1 {
    flex: 1
}

.items-center {
    align-items: center
}

.justify-between {
    justify-content: space-between
}

.justify-center {
    justify-content: center
}

.grid {
    display: grid
}

.w-full {
    width: 100%
}

.h-full {
    height: 100%
}

.overflow-hidden {
    overflow: hidden
}

.overflow-auto {
    overflow: auto
}

.hidden {
    display: none
}

.relative {
    position: relative
}

.absolute {
    position: absolute
}

::-webkit-scrollbar {
    width: 6px;
    height: 6px
}

::-webkit-scrollbar-track {
    background: var(--bg-surface-alt)
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px
}

.toast {
    position: fixed;
    top: 80px;
    right: 24px;
    padding: 12px 20px;
    border-radius: var(--radius-md);
    color: #fff;
    font-size: 14px;
    z-index: 1000;
    animation: slideIn .3s ease
}

.toast-success {
    background: var(--success)
}

.toast-error {
    background: var(--danger)
}

.empty-state,
.loading {
    text-align: center;
    padding: 40px;
    color: var(--text-muted)
}

.empty-state {
    padding: 60px 24px
}

.page-title {
    font-size: 28px;
    font-weight: 700;
    margin: 0 0 24px
}

@media (max-width:768px) {
    .hide-mobile {
        display: none
    }

    .site-header__inner {
        padding: 0 var(--space-4)
    }
}