:root {
    --color-bg: #fafaf9;
    --color-surface: #ffffff;
    --color-text-primary: #1c1917;
    --color-text-secondary: #57534e;
    --color-accent: #0f766e;
    --color-accent-light: #14b8a6;
    --color-production: #0f766e;
    --color-test: #ea580c;
    --color-border: #e7e5e4;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', sans-serif;
    background: var(--color-bg);
    color: var(--color-text-primary);
    line-height: 1.8;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

/* Decorative background elements */
body::before {
    content: '';
    position: fixed;
    top: -50%;
    right: -20%;
    width: 80%;
    height: 80%;
    background: radial-gradient(circle, rgba(20, 184, 166, 0.08) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

body::after {
    content: '';
    position: fixed;
    bottom: -30%;
    left: -10%;
    width: 60%;
    height: 60%;
    background: radial-gradient(circle, rgba(15, 118, 110, 0.05) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    width: 100%;
    position: relative;
    z-index: 1;
}

/* Header */
header {
    padding: 3rem 0 2rem;
    animation: fadeInDown 0.8s ease-out;
}

.header-content {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    justify-content: space-between;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.logo-container {
    width: 80px;
    height: 80px;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    background: var(--color-surface);
}

.logo-container:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-xl);
}

.logo-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.header-text h1 {
    font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--color-text-primary);
    letter-spacing: 0.02em;
    margin-bottom: 0.25rem;
}

.header-text p {
    font-size: 1rem;
    color: var(--color-text-secondary);
    font-weight: 400;
}

/* Toggle Switch */
.toggle-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.25rem;
    background: var(--color-surface);
    border: 2px solid var(--color-border);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    user-select: none;
}

.toggle-container:hover {
    border-color: var(--color-accent-light);
    box-shadow: var(--shadow-sm);
}

.toggle-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-text-secondary);
    transition: color 0.3s ease;
}

.toggle-switch {
    position: relative;
    width: 44px;
    height: 24px;
    background: var(--color-border);
    border-radius: 12px;
    transition: background 0.3s ease;
}

.toggle-switch::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-sm);
}

.toggle-container.active .toggle-switch {
    background: var(--color-test);
}

.toggle-container.active .toggle-switch::after {
    left: 22px;
}

.toggle-container.active .toggle-label {
    color: var(--color-test);
}

/* Main content */
main {
    flex: 1;
    padding: 2rem 0 4rem;
}

.admin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
    animation: fadeInUp 0.8s ease-out 0.2s both;
}

/* Admin card */
.admin-card {
    background: var(--color-surface);
    border-radius: 24px;
    padding: 2rem;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--color-border);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.admin-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--color-accent), var(--color-accent-light));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.admin-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
    border-color: var(--color-accent-light);
}

.admin-card:hover::before {
    transform: scaleX(1);
}

.card-header {
    display: flex;
    align-items: flex-start;
    gap: 1.25rem;
    margin-bottom: 1.75rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--color-border);
}

.admin-icon {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    overflow: hidden;
    flex-shrink: 0;
    box-shadow: var(--shadow-sm);
    transition: transform 0.3s ease;
    background: var(--color-bg);
}

.admin-card:hover .admin-icon {
    transform: scale(1.05);
}

.admin-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card-title {
    flex: 1;
}

.card-title h2 {
    font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--color-text-primary);
    margin-bottom: 0.25rem;
    letter-spacing: 0.02em;
}

.card-title p {
    font-size: 0.875rem;
    color: var(--color-text-secondary);
}

/* Environment links */
.environments {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.env-link {
    position: relative;
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: var(--color-bg);
    border: 2px solid var(--color-border);
    border-radius: 12px;
    text-decoration: none;
    color: var(--color-text-primary);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.env-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--env-color);
    transform: scaleY(0);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.env-link:hover {
    border-color: var(--env-color);
    background: var(--color-surface);
    transform: translateX(4px);
}

.env-link:hover::before {
    transform: scaleY(1);
}

.env-link.production {
    --env-color: var(--color-production);
}

.env-link.test {
    --env-color: var(--color-test);
    display: none;
    opacity: 0;
    transform: translateY(-10px);
}

body.show-test-env .env-link.test {
    display: flex;
    animation: slideIn 0.4s ease-out forwards;
}

@keyframes slideIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.env-icon-wrapper {
    position: relative;
    width: 40px;
    height: 40px;
    flex-shrink: 0;
}

.env-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    background: var(--color-surface);
}

.env-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.test-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--color-test);
    color: white;
    font-size: 0.625rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    box-shadow: var(--shadow-md);
    z-index: 2;
    animation: badgePulse 2s ease-in-out infinite;
}

.env-info {
    flex: 1;
    min-width: 0;
}

.env-label {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--env-color);
    margin-bottom: 0.125rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.env-url {
    font-size: 0.875rem;
    color: var(--color-text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-family: 'SF Mono', 'Monaco', 'Courier New', monospace;
}

.env-arrow {
    width: 20px;
    height: 20px;
    color: var(--color-text-secondary);
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.env-link:hover .env-arrow {
    color: var(--env-color);
    transform: translateX(4px);
}

/* Animations */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

@keyframes badgePulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 0 1.5rem;
    }

    header {
        padding: 2rem 0 1.5rem;
    }

    .header-content {
        gap: 1rem;
        flex-direction: column;
        align-items: flex-start;
    }

    .header-left {
        gap: 1rem;
    }

    .toggle-container {
        align-self: flex-end;
    }

    .logo-container {
        width: 60px;
        height: 60px;
        border-radius: 16px;
    }

    .header-text h1 {
        font-size: 1.75rem;
    }

    .header-text p {
        font-size: 0.875rem;
    }

    .admin-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .admin-card {
        padding: 1.5rem;
    }

    .card-header {
        gap: 1rem;
    }

    .admin-icon {
        width: 56px;
        height: 56px;
    }

    .card-title h2 {
        font-size: 1.25rem;
    }

    .env-url {
        font-size: 0.75rem;
    }
}

@media (max-width: 480px) {
    .env-link {
        padding: 0.875rem 1rem;
    }

    .env-icon-wrapper,
    .env-icon {
        width: 36px;
        height: 36px;
    }
}
