/* ============================================
   现代化全局样式 - 参考 v2code.ai 设计风格
   ============================================ */

:root {
    --primary-color: #6366F1;
    --primary-hover: #5558E3;
    --secondary-color: #64748B;
    --success-color: #10B981;
    --info-color: #3B82F6;
    --warning-color: #F59E0B;
    --danger-color: #EF4444;

    --text-primary: #1E293B;
    --text-secondary: #64748B;
    --text-muted: #94A3B8;

    --bg-primary: #FFFFFF;
    --bg-secondary: #F8FAFC;
    --bg-tertiary: #F1F5F9;

    --border-color: #E2E8F0;
    --border-radius: 12px;
    --border-radius-sm: 8px;
    --border-radius-lg: 16px;

    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);

    --transition: all 0.2s ease;

    /* 动态视口高度（由JavaScript设置） */
    --vh: 1vh;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: var(--text-primary);
    background: var(--bg-secondary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.modern-body {
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    /* 防止body出现滚动条 */
}

/* ============================================
   导航栏样式
   ============================================ */
.modern-navbar {
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    height: 75px;
    display: flex;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1000;
    flex-shrink: 0;
}

.navbar-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.navbar-brand {
    display: flex;
    align-items: center;
    text-decoration: none;
    gap: 0.75rem;
}

.brand-logo {
    width: 32px;
    height: 32px;
}

.brand-text {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

.navbar-menu {
    display: flex;
    gap: 2rem;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius-sm);
    transition: var(--transition);
}

.nav-link:hover {
    color: var(--text-primary);
    background: var(--bg-tertiary);
}

.nav-link.active {
    color: var(--primary-color);
    background: rgba(99, 102, 241, 0.1);
}

.navbar-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--bg-tertiary);
    border-radius: var(--border-radius-sm);
    min-width: 100px;
    /* 防止宽度变化 */
}

.user-name {
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 40px;
    /* 保证最小宽度 */
    display: inline-block;
}

.btn-logout {
    padding: 0.5rem 1rem;
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.btn-logout:hover {
    background: var(--danger-color);
    color: white;
    border-color: var(--danger-color);
}

.mobile-menu-btn {
    display: none;
    background: transparent;
    border: none;
    font-size: 1.5rem;
    color: var(--text-primary);
    cursor: pointer;
}

.mobile-menu {
    display: none;
    position: fixed;
    top: 75px;
    left: 0;
    right: 0;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem;
    box-shadow: var(--shadow-lg);
    z-index: 999;
}

.mobile-menu.show {
    display: block;
}

.mobile-nav-link {
    display: block;
    padding: 0.75rem 1rem;
    color: var(--text-primary);
    text-decoration: none;
    border-radius: var(--border-radius-sm);
    margin-bottom: 0.5rem;
}

.mobile-nav-link:hover {
    background: var(--bg-tertiary);
}

.mobile-logout-btn {
    width: 100%;
    padding: 0.75rem;
    background: var(--danger-color);
    color: white;
    border: none;
    border-radius: var(--border-radius-sm);
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    margin-top: 1rem;
}

.mobile-logout-btn:hover {
    background: #dc2626;
}

/* ============================================
   登录页顶部导航栏
   ============================================ */
.login-navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    z-index: 1000;
    height: 75px;
    display: flex;
    align-items: center;
}

.navbar-container {
    width: 100%;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    height: 100%;
}

.navbar-brand-group {
    display: flex;
    align-items: center;
}

.navbar-text {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.navbar-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin: 0;
    letter-spacing: -0.01em;
}

.navbar-separator {
    color: var(--border-color);
    font-weight: 300;
    font-size: 1.375rem;
    opacity: 0.5;
}

.navbar-subtitle {
    font-size: 1rem;
    color: var(--text-secondary);
    font-weight: 400;
}

/* ============================================
   极简现代化登录页面样式
   ============================================ */
.minimal-login-wrapper {
    min-height: 100vh;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    padding-top: 80px;
    /* 为顶部栏留出空间 */
    overflow: auto;
}

.login-content {
    width: 100%;
    max-width: 1100px;
    min-height: 560px;
    display: flex;
    background: white;
    border-radius: 24px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

/* 左侧品牌区 */
.login-left {
    flex: 1;
    background: linear-gradient(135deg, #6366F1 0%, #8B5CF6 100%);
    padding: 3rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.login-left::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    animation: float 20s ease-in-out infinite;
}

@keyframes float {

    0%,
    100% {
        transform: translate(0, 0) rotate(0deg);
    }

    50% {
        transform: translate(-30px, -30px) rotate(180deg);
    }
}

.brand-section {
    position: relative;
    z-index: 1;
    color: white;
}

/* 左侧核心标语样式 - 优化版 */
.core-motto-left {
    text-align: center;
    margin-bottom: 2rem;
    /* 减小底部间距 */
    padding: 1.5rem;
    /* 减小内边距 */
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    /* 稍微减小圆角 */
    border: 1px solid rgba(255, 255, 255, 0.2);
    animation: fadeInUp 0.6s ease-out;
}

.motto-icon-large {
    font-size: 3rem;
    /* 减小图标大小 */
    margin-bottom: 1rem;
    /* 减小间距 */
    display: block;
    filter: drop-shadow(0 4px 20px rgba(0, 0, 0, 0.2));
    animation: sparkle 3s ease-in-out infinite;
}

.motto-text-large {
    color: white;
}

.motto-main-large {
    font-size: 1.75rem;
    /* 减小字体大小 */
    font-weight: 800;
    margin-bottom: 0.5rem;
    /* 减小间距 */
    letter-spacing: 0.02em;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    line-height: 1.2;
}

.motto-sub-large {
    font-size: 1rem;
    /* 稍微减小字体 */
    opacity: 0.95;
    margin: 0;
    font-weight: 400;
    line-height: 1.4;
}

/* 左侧特色列表 - 优化版 */
.features-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    /* 减小间距 */
}

.feature-item-new {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    /* 调整间距适配更小的图标 */
    padding: 0.5rem 0.625rem;
    /* 更紧凑的内边距 */
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    transition: all 0.3s ease;
    animation: fadeInUp 0.7s ease-out backwards;
}

.feature-item-new:nth-child(1) {
    animation-delay: 0.1s;
}

.feature-item-new:nth-child(2) {
    animation-delay: 0.2s;
}

.feature-item-new:nth-child(3) {
    animation-delay: 0.3s;
}

.feature-item-new:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateX(4px);
    /* 减小移动距离 */
}

.feature-icon-new {
    width: 28px;
    /* 紧凑的正方形框 */
    height: 28px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
    /* 确保内容不溢出 */
    box-sizing: border-box;
}

.feature-icon-new i {
    font-size: 0.875rem;
    color: white;
}

.feature-emoji {
    font-size: 1rem;
    /* 16px基础大小 */
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    transform: scale(0.5);
    /* 缩小到50%，确保完整显示 */
    transform-origin: center center;
}

.feature-text-new {
    flex: 1;
    color: white;
    line-height: 1.3;
    /* 优化行高 */
}

.feature-text-new strong {
    display: block;
    font-size: 0.875rem;
    /* 与图标更协调 */
    margin-bottom: 0.0625rem;
    /* 极小间距 */
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: 0.01em;
}

.feature-text-new span {
    font-size: 0.75rem;
    /* 更精致的字体 */
    opacity: 0.9;
    /* 稍微提高可读性 */
    line-height: 1.3;
    display: block;
    letter-spacing: 0.005em;
}

.welcome-content {
    margin-bottom: 3rem;
}

.welcome-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    letter-spacing: -0.02em;
}

.welcome-subtitle {
    font-size: 1.125rem;
    opacity: 0.9;
    line-height: 1.5;
    margin-bottom: 2rem;
}

/* 核心标语样式 - 右侧登录框顶部 */
.core-motto {
    text-align: center;
    margin-bottom: 1.5rem;
    padding: 1.25rem;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.05) 0%, rgba(139, 92, 246, 0.05) 100%);
    border-radius: 16px;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(99, 102, 241, 0.1);
    background-clip: padding-box;
}

.core-motto::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #6366F1 0%, #8B5CF6 100%);
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.motto-icon {
    font-size: 2rem;
    margin-bottom: 0.75rem;
    animation: sparkle 2s ease-in-out infinite;
}

@keyframes sparkle {

    0%,
    100% {
        transform: scale(1) rotate(0deg);
    }

    50% {
        transform: scale(1.1) rotate(5deg);
    }
}

.motto-text {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.motto-main {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: 0.05em;
    background: linear-gradient(135deg, #6366F1 0%, #8B5CF6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.motto-sub {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 400;
}

.brand-header {
    margin-bottom: 4rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.logo-and-title {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

.brand-logo {
    width: 56px;
    height: 56px;
    flex-shrink: 0;
    padding: 12px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.brand-logo:hover {
    transform: rotate(-5deg) scale(1.05);
}

.brand-name {
    font-size: 2.25rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    margin: 0;
    line-height: 1;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.brand-tagline {
    font-size: 1.375rem;
    opacity: 0.95;
    margin: 0;
    margin-left: calc(56px + 1.25rem);
    font-weight: 300;
    letter-spacing: 0.01em;
    background: linear-gradient(90deg, rgba(255, 255, 255, 1) 0%, rgba(255, 255, 255, 0.8) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.highlights {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.highlight-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.highlight-emoji {
    font-size: 1.5rem;
    line-height: 1;
}

.highlight-item div {
    flex: 1;
}

.highlight-item strong {
    display: block;
    font-size: 1rem;
    margin-bottom: 0.25rem;
}

.highlight-item span {
    font-size: 0.875rem;
    opacity: 0.85;
    line-height: 1.4;
}

/* 右侧登录区 */
.login-right {
    flex: 1;
    padding: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
}

.login-form-wrapper {
    width: 100%;
    max-width: 380px;
    margin: 0 auto;
}

.form-header {
    margin-bottom: 2rem;
    text-align: center;
    animation: fadeInUp 0.7s ease-out 0.1s both;
}

.header-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 1rem;
    background: rgba(99, 102, 241, 0.1);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    font-size: 24px;
}

.form-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.375rem;
    letter-spacing: -0.01em;
}

.form-header p {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.minimal-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    animation: fadeInUp 0.8s ease-out 0.2s both;
}

.form-field {
    display: flex;
    flex-direction: column;
}

.field-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.input-wrapper {
    position: relative;
}

.input-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    font-size: 1.125rem;
    pointer-events: none;
    transition: color 0.2s;
}

.minimal-input {
    width: 100%;
    padding: 1rem 3rem 1rem 1rem;
    font-size: 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    background: #f9fafb;
    color: var(--text-primary);
    transition: all 0.2s ease;
    outline: none;
}

.minimal-input.with-icon {
    padding-left: 3rem;
}

.input-hint {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    margin-top: 0.5rem;
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

.input-hint i {
    font-size: 0.875rem;
    opacity: 0.7;
}

.minimal-input:focus {
    border-color: #6366F1;
    background: white;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.input-wrapper:focus-within .input-icon {
    color: #6366F1;
}

.minimal-input::placeholder {
    color: #9ca3af;
}

.toggle-btn {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: #6b7280;
    cursor: pointer;
    padding: 0.5rem;
    transition: color 0.2s;
}

.toggle-btn:hover {
    color: #667eea;
}

.submit-btn {
    width: 100%;
    padding: 1.125rem;
    font-size: 1rem;
    font-weight: 600;
    color: white;
    background: linear-gradient(135deg, #6366F1 0%, #8B5CF6 100%);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.submit-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.2);
    transition: left 0.5s ease;
}

.submit-btn:hover::before {
    left: 100%;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(99, 102, 241, 0.35);
    background: linear-gradient(135deg, #5558E3 0%, #7C3AED 100%);
}

.submit-btn:active {
    transform: translateY(0);
}

.submit-btn:disabled {
    background: #e5e7eb;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-loading {
    display: none;
}

.spin {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.form-divider {
    margin: 1.5rem 0;
    text-align: center;
    position: relative;
    animation: fadeInUp 0.9s ease-out 0.3s both;
}

.form-divider::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    width: 100%;
    height: 1px;
    background: var(--border-color);
}

.form-divider span {
    position: relative;
    padding: 0 1rem;
    background: white;
    color: var(--text-muted);
    font-size: 0.875rem;
}

.form-footer {
    text-align: center;
    animation: fadeInUp 1s ease-out 0.4s both;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 2rem;
}

.footer-link {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.875rem;
    transition: color 0.2s;
}

.footer-link:hover {
    color: var(--primary-color);
}

.footer-link i {
    font-size: 1rem;
}


/* 响应式设计 - 顶部栏 */
@media (max-width: 768px) {
    .navbar-container {
        padding: 0 1rem;
        width: 100%;
    }

    .navbar-subtitle {
        font-size: 0.875rem;
    }

    .navbar-title {
        font-size: 1.375rem;
    }

    .navbar-separator {
        font-size: 1.25rem;
    }

}

@media (max-width: 540px) {
    .navbar-text {
        flex-wrap: wrap;
    }

    .navbar-subtitle {
        display: none;
    }

    .navbar-separator {
        display: none;
    }
}

/* 响应式设计 - 登录页面 */
@media (max-width: 640px) {
    .minimal-login-wrapper {
        padding-top: 70px;
        background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    }

    .login-content-single {
        box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
        border-radius: 20px;
        max-width: calc(100% - 2rem);
    }

    .login-single {
        padding: 2rem 1.5rem;
    }

    .core-motto-hero {
        margin-bottom: 2rem;
        padding: 1.5rem 1rem;
        border-radius: 16px;
    }

    .core-motto-hero .motto-icon {
        font-size: 2.5rem;
        margin-bottom: 0.75rem;
    }

    .core-motto-hero .motto-main {
        font-size: 1.375rem;
        font-weight: 700;
    }

    .core-motto-hero .motto-sub {
        font-size: 0.875rem;
        margin-top: 0.375rem;
    }

    .form-header {
        margin-bottom: 1.5rem;
    }

    .header-icon {
        width: 48px;
        height: 48px;
        font-size: 20px;
    }

    .form-header h2 {
        font-size: 1.25rem;
    }

    .form-header p {
        font-size: 0.8125rem;
    }

    .minimal-input {
        padding: 0.875rem 2.5rem 0.875rem 0.875rem;
        font-size: 0.9375rem;
    }

    .minimal-input.with-icon {
        padding-left: 2.5rem;
    }

    .input-icon {
        left: 0.875rem;
        font-size: 1rem;
    }

    .submit-btn {
        padding: 1rem;
        font-size: 0.9375rem;
    }

    .form-divider {
        margin: 1.25rem 0;
    }

    .footer-links {
        gap: 1.5rem;
    }

    .footer-link {
        font-size: 0.8125rem;
    }
}

@media (max-width: 480px) {
    .login-content {
        max-width: 100%;
        box-shadow: none;
        border-radius: 0;
    }

    .login-left {
        padding: 2rem 1.5rem;
        border-radius: 0;
    }

    .core-motto-left {
        padding: 1.25rem;
        margin-bottom: 1.5rem;
    }

    .motto-icon-large {
        font-size: 2.5rem;
    }

    .motto-main-large {
        font-size: 1.5rem;
    }

    .motto-sub-large {
        font-size: 0.875rem;
    }

    .features-list {
        gap: 0.625rem;
    }

    .feature-item-new {
        padding: 0.5rem;
        background: rgba(255, 255, 255, 0.08);
    }

    .feature-icon-new {
        width: 24px;
        /* 移动端更紧凑 */
        height: 24px;
        border-radius: 5px;
    }

    .feature-icon-new i {
        font-size: 0.75rem;
    }

    .feature-emoji {
        font-size: 0.875rem;
        /* 14px基础大小 */
        transform: scale(0.5);
        /* 缩小50%，确保完整显示 */
    }

    .feature-text-new strong {
        font-size: 0.8125rem;
    }

    .feature-text-new span {
        font-size: 0.6875rem;
    }

    .login-right {
        padding: 2rem 1.5rem;
    }
}

/* 登录页响应式 - 平板 */
@media (max-width: 1024px) {
    .login-content {
        flex-direction: column;
        max-width: 600px;
    }

    .login-left {
        padding: 2.5rem;
        min-height: auto;
    }

    .core-motto-left {
        margin-bottom: 2rem;
        padding: 1.5rem;
    }

    .motto-icon-large {
        font-size: 3rem;
        margin-bottom: 1rem;
    }

    .motto-main-large {
        font-size: 1.75rem;
    }

    .motto-sub-large {
        font-size: 1rem;
    }

    .features-list {
        gap: 0.75rem;
    }

    .feature-item-new {
        padding: 0.625rem;
    }

    .login-right {
        padding: 2.5rem;
    }
}

/* ============================================
   旧版登录页面样式（已废弃）
   ============================================ */
/* 登录页头部 */
.login-header-bar {
    background: white;
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 0;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* 登录页容器 */
.login-page-container {
    min-height: calc(100vh - 60px);
    display: flex;
    flex-direction: column;
    background: var(--bg-secondary);
}

/* 登录区域 */
.login-section {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem 1rem;
}

.login-box {
    background: white;
    border-radius: var(--border-radius);
    padding: 2.5rem;
    width: 100%;
    max-width: 400px;
    box-shadow: var(--shadow-sm);
}

.login-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    text-align: center;
}

.login-subtitle {
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: 2rem;
}

/* 简化的表单样式 */
.login-form-simple {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.input-group {
    position: relative;
    display: flex;
    align-items: center;
}

.simple-input {
    width: 100%;
    padding: 0.75rem 3rem 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    font-size: 1rem;
    transition: all 0.2s;
}

.simple-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.input-toggle {
    position: absolute;
    right: 0.75rem;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.5rem;
}

.input-toggle:hover {
    color: var(--text-primary);
}

.btn-login {
    padding: 0.75rem 1.5rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--border-radius-sm);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-login:hover:not(:disabled) {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-login:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* 特性展示区域 */
.features-section {
    background: white;
    border-top: 1px solid var(--border-color);
    padding: 3rem 1rem;
}

.features-container {
    max-width: 900px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.feature-card {
    text-align: center;
    padding: 1.5rem;
}

.feature-emoji {
    font-size: 2.5rem;
}

.feature-card h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.feature-card p {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* 旋转动画 */
.spin {
    animation: spin 1s linear infinite;
}

/* 移除旧的登录样式，已被新样式替代 */

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-logo {
    display: inline-flex;
}

.login-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.login-subtitle {
    font-size: 1.125rem;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.login-description {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.login-form {
    margin-bottom: 2rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.modern-input {
    width: 100%;
    padding: 0.875rem 3rem 0.875rem 1rem;
    font-size: 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    transition: var(--transition);
    background: var(--bg-secondary);
}

.modern-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
    background: var(--bg-primary);
}

.input-addon {
    position: absolute;
    right: 0.75rem;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.5rem;
}

.input-hint {
    margin-top: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.btn-primary-modern {
    width: 100%;
    padding: 0.875rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--border-radius-sm);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-primary-modern:hover:not(:disabled) {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-primary-modern:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.features-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem;
    background: var(--bg-secondary);
    border-radius: var(--border-radius-sm);
}

.feature-icon {
    font-size: 1.5rem;
}

.feature-text strong {
    display: block;
    color: var(--text-primary);
    font-weight: 600;
}

.feature-text span {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.alert-container {
    margin-top: 1rem;
}

.modern-alert {
    padding: 1rem;
    border-radius: var(--border-radius-sm);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.modern-alert.alert-error {
    background: #FEE2E2;
    color: #991B1B;
}

.modern-alert.alert-success {
    background: #D1FAE5;
    color: #065F46;
}

.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #E5E7EB;
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ============================================
   控制台页面样式
   ============================================ */
.dashboard-container {
    padding: 1rem 0;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.page-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
}

.btn-refresh {
    padding: 0.625rem 1.25rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--border-radius-sm);
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-refresh:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.stat-card {
    background: var(--bg-primary);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--border-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
}

.bg-primary {
    background: var(--primary-color);
}

.bg-success {
    background: var(--success-color);
}

.bg-info {
    background: var(--info-color);
}

.bg-warning {
    background: var(--warning-color);
}

.bg-danger {
    background: var(--danger-color);
}

.stat-content {
    flex: 1;
}

.stat-title {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
    font-weight: 500;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    min-height: 2.25rem;
    /* 防止内容变化时跳动 */
    display: flex;
    align-items: center;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin: 0;
    min-height: 1.25rem;
    /* 固定高度防止跳动 */
    transition: opacity 0.3s ease;
}

/* 有效期卡片样式 - 与其他卡片保持一致 */
.validity-card .stat-icon {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

/* 固定卡片高度，避免内容变化导致跳动 */
.validity-card .stat-content {
    min-height: 95px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.validity-value {
    text-align: left;
    display: flex;
    align-items: center;
    min-height: 32px; /* 确保有固定高度 */
    margin: 4px 0;
}

/* 日期范围独立样式 - 专业设计 */
.validity-range {
    font-size: 0.82rem !important;  /* 独立小字体，避免影响卡片高度 */
    font-weight: 600 !important;
    color: #4a5568 !important;
    white-space: nowrap;
    letter-spacing: -0.2px;          /* 轻微压缩提升紧凑感 */
    font-family: 'SF Mono', 'Monaco', 'Consolas', monospace; /* 等宽字体确保对齐 */
    display: inline-block;
    line-height: 1.3 !important;
    padding: 3px 0;
}

/* 日期之间的分隔符 */
.date-divider {
    margin: 0 3px;
    color: #a0aec0;
    font-weight: 400;
}

/* 骨架屏加载效果 */
.skeleton-loading {
    position: relative;
    overflow: hidden;
    background: #f0f0f0;
}

.skeleton-loading::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background: linear-gradient(90deg,
            transparent 0%,
            rgba(255, 255, 255, 0.4) 50%,
            transparent 100%);
    animation: skeleton-shimmer 1.5s infinite;
}

@keyframes skeleton-shimmer {
    0% {
        transform: translateX(-100%);
    }

    100% {
        transform: translateX(100%);
    }
}

.badge-status {
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-success {
    background: #D1FAE5;
    color: #065F46;
}

.badge-warning {
    background: #FEF3C7;
    color: #92400E;
}

.badge-danger {
    background: #FEE2E2;
    color: #991B1B;
}

.badge-urgent {
    background: #FF6B35;
    color: white;
    font-weight: 700;
}


.modern-card {
    background: var(--bg-primary);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    margin-bottom: 0;
}

/* 配额区域布局 */
.quota-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

/* 加油包列表 */
.package-list {
    display: flex;
    gap: 0.75rem;
    justify-content: space-between;
}

.package-btn {
    flex: 1;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 1rem;
    font-weight: 600;
    color: var(--primary-color);
}

.package-btn:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.package-btn.package-more {
    color: var(--text-secondary);
}

.package-btn.package-more:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border-color: var(--border-color);
}

/* API Key显示 */
.api-key-display {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    max-width: 100%;
}

.api-key-display .stat-value {
    flex: 1;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.95rem;
    min-width: 0;
}

.btn-copy-key {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.25rem;
    transition: all 0.2s;
    flex-shrink: 0;
}

.btn-copy-key:hover {
    color: var(--primary-color);
    transform: scale(1.1);
}

.btn-copy-key i {
    font-size: 1.125rem;
}


@media (max-width: 992px) {
    .quota-section {
        grid-template-columns: 1fr;
    }
}

.card-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.time-info {
    display: flex;
    gap: 1.5rem;
    font-size: 0.875rem;
}

.time-item {
    display: flex;
    align-items: center;
}

.time-value {
    color: var(--text-primary);
    font-weight: 500;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
}

.card-body {
    padding: 1.25rem;
}

.progress-wrapper {
    max-width: 600px;
}

.progress-labels {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.modern-progress {
    height: 8px;
    background: var(--bg-tertiary);
    border-radius: 999px;
    overflow: hidden;
}

.modern-progress-bar {
    height: 100%;
    background: var(--success-color);
    transition: width 0.5s ease;
}

.modern-progress-bar.bg-warning {
    background: var(--warning-color);
}

.modern-progress-bar.bg-danger {
    background: var(--danger-color);
}

.progress-stats {
    display: flex;
    gap: 2rem;
    margin-top: 1rem;
}

.progress-stat {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.stat-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.action-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.action-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1.5rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    text-decoration: none;
    cursor: pointer;
    transition: var(--transition);
}

.action-item:hover {
    background: var(--bg-primary);
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.action-icon {
    width: 48px;
    height: 48px;
    background: var(--primary-color);
    color: white;
    border-radius: var(--border-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.action-text h4 {
    font-size: 1rem;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.action-text p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin: 0;
}

/* 局部加载状态 */
.dashboard-container.loading {
    position: relative;
    pointer-events: none;
}

.dashboard-container.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(248, 250, 252, 0.5);
    animation: pulseOpacity 0.3s ease;
    z-index: 1;
}

@keyframes pulseOpacity {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.btn-refresh-nav.loading {
    pointer-events: none;
    color: var(--primary-color);
}

.btn-refresh-nav.loading i {
    animation: spin 1s linear infinite;
}

/* 数据卡片加载过渡 */
.stat-card,
.modern-card {
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.loading .stat-card,
.loading .modern-card {
    opacity: 0.8;
}

/* ============================================
   日志页面样式
   ============================================ */
.logs-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 0;
}

.logs-container .container-xl {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 1rem;
    gap: 1rem;
    min-height: 0;
}

/* 底部控制栏 */
.logs-bottom-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: var(--bg-primary);
    border-radius: var(--border-radius);
    flex-shrink: 0;
    box-shadow: var(--shadow-sm);
}

.page-size-control {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
}

.simple-select {
    padding: 0.25rem 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: white;
    font-size: 0.875rem;
    cursor: pointer;
}

.simple-select:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* 简化的分页控件 */
.pagination-simple {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.page-btn-simple {
    min-width: 32px;
    height: 32px;
    padding: 0 0.5rem;
    border: 1px solid var(--border-color);
    background: white;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.875rem;
}

.page-btn-simple:hover {
    background: var(--bg-tertiary);
    border-color: var(--primary-color);
}

.page-btn-simple.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.page-btn-simple:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.page-dots {
    padding: 0 0.5rem;
    color: var(--text-muted);
}

.page-info {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.no-pages {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.header-actions {
    display: flex;
    gap: 1rem;
}

.btn-secondary-modern {
    padding: 0.625rem 1.25rem;
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    font-weight: 500;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: var(--transition);
}

.btn-secondary-modern:hover {
    background: var(--bg-tertiary);
    border-color: var(--text-secondary);
}

.filter-card {
    background: var(--bg-primary);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.filter-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.filter-item {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.filter-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.modern-select {
    padding: 0.5rem 2rem 0.5rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 0.875rem;
    cursor: pointer;
    transition: var(--transition);
}

.modern-select:focus {
    outline: none;
    border-color: var(--primary-color);
}

.filter-stats {
    display: flex;
    gap: 2rem;
}

.stats-item {
    font-size: 0.875rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.stats-item strong {
    color: var(--text-primary);
}

.modern-table-card {
    background: var(--bg-primary);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    position: relative;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    /* 重要：允许flex子元素收缩 */
    overflow: hidden;
}

.table-responsive {
    overflow-y: auto;
    overflow-x: auto;
    flex: 1;
    min-height: 0;
    /* 重要：允许滚动 */
}

.modern-table {
    width: 100%;
    border-collapse: collapse;
}

.modern-table thead {
    background: var(--bg-tertiary);
}

.modern-table th {
    padding: 1rem;
    text-align: left;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.modern-table td {
    padding: 1rem;
    border-top: 1px solid var(--border-color);
    font-size: 0.875rem;
}

.modern-table tbody tr:hover {
    background: var(--bg-secondary);
}

.text-time {
    color: var(--text-secondary);
}

.badge-model {
    padding: 0.25rem 0.5rem;
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary-color);
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-stream {
    padding: 0.125rem 0.375rem;
    background: rgba(16, 185, 129, 0.1);
    color: var(--success-color);
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-left: 0.25rem;
}

.text-duration {
    color: var(--text-primary);
}

.token-value {
    color: var(--text-secondary);
}

.token-total {
    color: var(--text-primary);
}

.cost-value {
    color: var(--success-color);
    font-weight: 600;
}

.empty-state {
    padding: 4rem 2rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 200px;
}

/* 表格刷新状态 */
.modern-table-card.refreshing {
    position: relative;
}

.modern-table-card.refreshing::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(248, 250, 252, 0.5);
    animation: pulseOpacity 0.3s ease;
    z-index: 1;
    pointer-events: none;
}

/* 骨架屏样式 */
.skeleton-row td {
    padding: 0.75rem;
}

.skeleton-text {
    display: inline-block;
    height: 14px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 4px;
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

.empty-icon {
    font-size: 3rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.empty-state h3 {
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.empty-state p {
    color: var(--text-secondary);
}

.modern-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 2rem;
}

.page-btn {
    padding: 0.5rem 0.75rem;
    min-width: 36px;
    background: var(--bg-primary);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.page-btn:hover:not(.disabled) {
    background: var(--bg-tertiary);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.page-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.page-btn.disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.page-dots {
    padding: 0 0.5rem;
    color: var(--text-muted);
}

/* ============================================
   Toast 弹窗样式
   ============================================ */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast-notification {
    min-width: 300px;
    max-width: 400px;
    background: white;
    border-radius: var(--border-radius-sm);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    transform: translateX(400px);
    transition: transform 0.3s ease;
}

.toast-notification.show {
    transform: translateX(0);
}

.toast-content {
    display: flex;
    align-items: center;
    padding: 1rem;
    gap: 0.75rem;
}

.toast-content i {
    font-size: 1.25rem;
    flex-shrink: 0;
}

.toast-message {
    flex: 1;
    font-size: 0.875rem;
    line-height: 1.4;
}

.toast-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.25rem;
    margin-left: 0.5rem;
    transition: color 0.2s;
}

.toast-close:hover {
    color: var(--text-primary);
}

.toast-error {
    border-left: 4px solid var(--danger-color);
}

.toast-error .toast-content i {
    color: var(--danger-color);
}

.toast-success {
    border-left: 4px solid var(--success-color);
}

.toast-success .toast-content i {
    color: var(--success-color);
}

.toast-warning {
    border-left: 4px solid var(--warning-color);
}

.toast-warning .toast-content i {
    color: var(--warning-color);
}

.toast-info {
    border-left: 4px solid var(--info-color);
}

.toast-info .toast-content i {
    color: var(--info-color);
}

/* ============================================
   页脚样式
   ============================================ */
.modern-footer {
    margin-top: auto;
    padding: 2rem 0;
    background: var(--bg-primary);
    border-top: 1px solid var(--border-color);
}

.footer-text {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin: 0;
}

.main-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    min-height: 0;
    -webkit-overflow-scrolling: touch;
}

.dashboard-container .container-xl {
    padding: 0.75rem 1rem;
    min-height: auto;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding-bottom: 1.5rem;
}

/* ============================================
   响应式设计
   ============================================ */
@media (max-width: 768px) {

    /* 保持body结构一致 */
    .modern-body {
        height: 100vh;
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }

    /* 导航栏调整为固定定位 */
    .modern-navbar {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        width: 100%;
        z-index: 100;
    }

    /* 主内容区域调整 */
    .main-content {
        margin-top: 75px;
        /* 为固定导航栏留出空间 */
        flex: 1;
        overflow-y: auto;
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
    }

    .dashboard-container {
        flex: 1;
        display: flex;
        flex-direction: column;
    }

    .dashboard-container .container-xl {
        padding: 0.75rem;
        padding-bottom: 2rem;
        /* 底部留出更多空间 */
    }

    .navbar-menu,
    .navbar-actions .user-info {
        display: none;
    }

    .mobile-menu-btn {
        display: block;
    }

    .stats-grid {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    /* 统计卡片移动端优化 */
    .stat-card {
        padding: 1.25rem;
    }

    .quota-section {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    .action-grid {
        grid-template-columns: 1fr;
    }

    .filter-row {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }

    .filter-stats {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    /* 时间信息移动端优化 */
    .time-info {
        flex-direction: column;
        gap: 0.5rem;
        align-items: flex-end;
    }
    
    .time-value {
        font-size: 0.75rem;
    }

    .page-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
        padding: 0 0.75rem;
    }

    .header-actions {
        width: 100%;
    }

    .header-actions>* {
        flex: 1;
    }

    /* 表格优化 */
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .modern-table {
        font-size: 0.75rem;
        min-width: 600px;
        /* 防止表格过度压缩 */
    }

    .modern-table th,
    .modern-table td {
        padding: 0.5rem;
    }

    .login-card {
        padding: 2rem;
    }

}

@media (max-width: 480px) {

    /* 超小屏幕优化 */
    .modern-navbar {
        height: 75px;
    }

    .navbar-content {
        padding: 0 0.75rem;
    }

    .main-content {
        margin-top: 75px;
        /* 调整为导航栏高度 */
    }

    .page-title {
        font-size: 1.5rem;
    }

    .login-title {
        font-size: 1.5rem;
    }

    .container-xl {
        padding: 0 0.75rem;
    }

    .stats-grid {
        gap: 0.5rem;
    }

    .stat-card {
        padding: 1rem;
    }

    .stat-icon {
        width: 40px;
        height: 40px;
        font-size: 1.25rem;
    }

    .stat-title {
        font-size: 0.75rem;
    }

    .stat-value {
        font-size: 1.25rem;
    }
    
    /* 有效期日期在移动端的优化 */
    .validity-range {
        font-size: 0.75rem !important;  /* 移动端更小的字体 */
        letter-spacing: -0.3px;
    }
    
    .validity-card .stat-content {
        min-height: 85px;  /* 移动端稍微减少高度 */
    }
    
    .date-divider {
        margin: 0 2px;  /* 减少间距 */
    }

    /* 加油包按钮移动端优化 */
    .package-list {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .package-btn {
        min-width: calc(50% - 0.25rem);
        padding: 0.625rem 0.75rem;
        font-size: 0.875rem;
    }

    /* 底部分页控件优化 */
    .logs-bottom-bar {
        flex-direction: column;
        gap: 0.75rem;
        padding: 0.75rem;
    }

    .page-size-control {
        width: 100%;
        justify-content: center;
    }

    .pagination-simple {
        width: 100%;
        justify-content: center;
    }
}

/* iOS Safari特殊处理 */
@supports (-webkit-touch-callout: none) {
    .modern-body {
        height: 100vh;
        height: -webkit-fill-available;
    }

    .main-content {
        -webkit-overflow-scrolling: touch;
    }

    /* 防止iOS橡皮筋效果 */
    .dashboard-container {
        position: relative;
    }
}
