/* ==================== 管理后台 - 未来科技风格 ==================== */

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

body {
    font-family: 'SF Pro Display', 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Roboto', sans-serif;
    line-height: 1.6;
    color: #ffffff;
    background: radial-gradient(ellipse at bottom, #1B2735 0%, #090A0F 100%);
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

/* ==================== 星空背景 ==================== */
.starfield-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

#starCanvas {
    width: 100%;
    height: 100%;
    display: block;
}

/* ==================== 鼠标特效 ==================== */
.mouse-effects {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    pointer-events: none;
}

#rippleCanvas {
    width: 100%;
    height: 100%;
    display: block;
}

/* ==================== 容器 ==================== */
.admin-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    position: relative;
    z-index: 1;
}

/* ==================== 返回首页按钮 ==================== */
.back-home {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 28px;
    background: rgba(15, 20, 40, 0.7);
    backdrop-filter: blur(20px);
    color: #00f0ff;
    text-decoration: none;
    border-radius: 50px;
    border: 1px solid rgba(0, 240, 255, 0.4);
    font-weight: 700;
    transition: all 0.3s ease;
    box-shadow:
        0 4px 15px rgba(0, 0, 0, 0.3),
        0 0 20px rgba(0, 240, 255, 0.2);
    margin-bottom: 25px;
    animation: slideDown 0.6s ease-out;
    text-shadow: 0 0 10px rgba(0, 240, 255, 0.5);
}

.back-home:hover {
    background: rgba(0, 240, 255, 0.2);
    transform: translateY(-3px);
    box-shadow:
        0 6px 25px rgba(0, 0, 0, 0.4),
        0 0 35px rgba(0, 240, 255, 0.4);
    border-color: rgba(0, 240, 255, 0.6);
}

.back-icon {
    font-size: 22px;
    filter: drop-shadow(0 0 8px rgba(0, 240, 255, 0.6));
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==================== 标题区域 ==================== */
.admin-header {
    text-align: center;
    padding: 40px 20px;
    animation: fadeInUp 0.8s ease-out 0.2s both;
}

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

.admin-title {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    margin-bottom: 15px;
}

.title-icon {
    font-size: 54px;
    animation: iconSpin 4s ease-in-out infinite;
    filter: drop-shadow(0 0 15px rgba(181, 55, 255, 0.8));
}

@keyframes iconSpin {
    0%, 100% { transform: rotate(0deg) scale(1); }
    50% { transform: rotate(10deg) scale(1.1); }
}

.title-gradient {
    font-size: 48px;
    font-weight: 900;
    background: linear-gradient(45deg, #00f0ff, #b537ff, #ff2e97, #39ff14);
    background-size: 300% 300%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: neonGradient 4s ease infinite;
    text-shadow:
        0 0 30px rgba(0, 240, 255, 0.5),
        0 0 60px rgba(181, 55, 255, 0.3);
}

@keyframes neonGradient {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.admin-subtitle {
    color: rgba(0, 240, 255, 0.7);
    font-size: 18px;
    font-weight: 400;
    letter-spacing: 2px;
    text-transform: uppercase;
    text-shadow: 0 0 10px rgba(0, 240, 255, 0.4);
}

/* ==================== 登录部分 ==================== */
.login-section {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 55vh;
    animation: fadeInUp 0.8s ease-out 0.4s both;
}

.login-card {
    background: rgba(15, 20, 40, 0.8);
    backdrop-filter: blur(30px);
    padding: 55px;
    border-radius: 25px;
    box-shadow:
        0 15px 40px rgba(0, 0, 0, 0.5),
        0 0 35px rgba(181, 55, 255, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(181, 55, 255, 0.4);
    text-align: center;
    max-width: 480px;
    width: 100%;
    position: relative;
    overflow: hidden;
}

.login-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent 30%,
        rgba(181, 55, 255, 0.1) 50%,
        transparent 70%
    );
    animation: shimmer 4s linear infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%) translateY(-100%) rotate(45deg); }
    100% { transform: translateX(100%) translateY(100%) rotate(45deg); }
}

.login-card .card-icon {
    font-size: 68px;
    margin-bottom: 25px;
    filter: drop-shadow(0 0 20px rgba(181, 55, 255, 0.8));
    animation: iconFloat 3s ease-in-out infinite;
}

@keyframes iconFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-12px); }
}

.login-card h3 {
    color: #b537ff;
    font-size: 32px;
    margin-bottom: 35px;
    font-weight: 800;
    text-shadow:
        0 0 15px rgba(181, 55, 255, 0.6),
        0 0 30px rgba(181, 55, 255, 0.3);
}

/* ==================== 管理界面 ==================== */
.admin-section {
    animation: fadeInUp 0.8s ease-out 0.4s both;
}

.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
    gap: 30px;
    margin-bottom: 35px;
}

.config-card {
    background: rgba(15, 20, 40, 0.8);
    backdrop-filter: blur(25px);
    border-radius: 22px;
    padding: 35px;
    border: 1px solid rgba(0, 240, 255, 0.3);
    box-shadow:
        0 10px 35px rgba(0, 0, 0, 0.4),
        0 0 25px rgba(0, 240, 255, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    transition: all 0.4s ease;
    animation: slideInLeft 0.6s ease-out;
    position: relative;
    overflow: hidden;
}

.config-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(0, 240, 255, 0.1),
        transparent
    );
    transition: left 0.6s ease;
}

.config-card:hover::before {
    left: 100%;
}

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

.config-card:hover {
    transform: translateY(-8px) scale(1.01);
    box-shadow:
        0 15px 50px rgba(0, 0, 0, 0.5),
        0 0 40px rgba(0, 240, 255, 0.3),
        inset 0 0 25px rgba(0, 240, 255, 0.05);
    border-color: rgba(0, 240, 255, 0.5);
}

.card-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 2px solid rgba(0, 240, 255, 0.2);
}

.card-header .card-icon {
    font-size: 42px;
    filter: drop-shadow(0 0 12px rgba(0, 240, 255, 0.6));
}

.card-header h3 {
    color: #00f0ff;
    font-size: 22px;
    font-weight: 700;
    text-shadow: 0 0 10px rgba(0, 240, 255, 0.5);
}

.card-body {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

/* ==================== 表单元素 ==================== */
.form-group {
    margin-bottom: 20px;
}

.form-input {
    width: 100%;
    padding: 16px 20px;
    background: rgba(10, 14, 30, 0.8);
    border: 1px solid rgba(0, 240, 255, 0.3);
    border-radius: 15px;
    color: #ffffff;
    font-size: 16px;
    outline: none;
    transition: all 0.3s ease;
    box-shadow:
        0 4px 15px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.form-input:focus {
    border-color: rgba(0, 240, 255, 0.6);
    box-shadow:
        0 0 20px rgba(0, 240, 255, 0.3),
        inset 0 0 15px rgba(0, 240, 255, 0.1);
}

.form-input::placeholder {
    color: rgba(0, 240, 255, 0.4);
}

.cookie-textarea {
    width: 100%;
    min-height: 135px;
    padding: 16px 20px;
    background: rgba(10, 14, 30, 0.8);
    border: 1px solid rgba(0, 240, 255, 0.3);
    border-radius: 15px;
    color: #ffffff;
    font-size: 15px;
    font-family: 'Courier New', monospace;
    outline: none;
    resize: vertical;
    transition: all 0.3s ease;
    box-shadow:
        0 4px 15px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.cookie-textarea:focus {
    border-color: rgba(0, 240, 255, 0.6);
    box-shadow:
        0 0 20px rgba(0, 240, 255, 0.3),
        inset 0 0 15px rgba(0, 240, 255, 0.1);
}

.cookie-textarea::placeholder {
    color: rgba(0, 240, 255, 0.4);
}

/* ==================== 有效期提示 ==================== */
.expiry-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    background: rgba(0, 240, 255, 0.1);
    border-radius: 12px;
    border: 1px solid rgba(0, 240, 255, 0.3);
}

.info-label {
    font-size: 16px;
    font-weight: 600;
    color: rgba(0, 240, 255, 0.8);
}

.info-value {
    font-size: 20px;
    font-weight: 800;
    color: #00f0ff;
    font-family: 'Courier New', monospace;
    text-shadow: 0 0 10px rgba(0, 240, 255, 0.6);
}

.expiry-hints {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.hint-item {
    font-size: 13px;
    color: rgba(181, 55, 255, 0.8);
    background: rgba(181, 55, 255, 0.15);
    padding: 6px 14px;
    border-radius: 20px;
    border: 1px solid rgba(181, 55, 255, 0.3);
}

/* ==================== 统计信息 ==================== */
.stats-grid {
    display: grid;
    gap: 12px;
    margin-bottom: 20px;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 18px;
    background: rgba(0, 240, 255, 0.08);
    border-radius: 10px;
    border: 1px solid rgba(0, 240, 255, 0.2);
}

.stat-name {
    color: rgba(0, 240, 255, 0.7);
    font-size: 15px;
    font-weight: 600;
}

.stat-value {
    color: #00f0ff;
    font-size: 16px;
    font-weight: 700;
    font-family: 'Courier New', monospace;
    text-shadow: 0 0 8px rgba(0, 240, 255, 0.5);
}

/* ==================== 按钮样式 ==================== */
.btn-primary,
.btn-success,
.btn-warning,
.btn-info,
.btn-danger {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 16px 32px;
    border: none;
    border-radius: 50px;
    font-weight: 700;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    overflow: hidden;
}

.btn-primary::before,
.btn-success::before,
.btn-warning::before,
.btn-info::before,
.btn-danger::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn-primary:hover::before,
.btn-success:hover::before,
.btn-warning:hover::before,
.btn-info:hover::before,
.btn-danger:hover::before {
    width: 300px;
    height: 300px;
}

.btn-primary {
    background: linear-gradient(135deg, #00f0ff, #00b8d4);
    color: #0a0e1a;
    box-shadow:
        0 6px 20px rgba(0, 240, 255, 0.4),
        0 0 30px rgba(0, 240, 255, 0.3);
    border: 1px solid rgba(0, 240, 255, 0.5);
}

.btn-primary:hover {
    transform: translateY(-4px);
    box-shadow:
        0 10px 35px rgba(0, 240, 255, 0.6),
        0 0 50px rgba(0, 240, 255, 0.4);
}

.btn-success {
    background: linear-gradient(135deg, #39ff14, #00c853);
    color: #0a0e1a;
    box-shadow:
        0 6px 20px rgba(57, 255, 20, 0.4),
        0 0 30px rgba(57, 255, 20, 0.3);
    border: 1px solid rgba(57, 255, 20, 0.5);
}

.btn-success:hover {
    transform: translateY(-4px);
    box-shadow:
        0 10px 35px rgba(57, 255, 20, 0.6),
        0 0 50px rgba(57, 255, 20, 0.4);
}

.btn-warning {
    background: linear-gradient(135deg, #ffc107, #ff9800);
    color: #0a0e1a;
    box-shadow:
        0 6px 20px rgba(255, 193, 7, 0.4),
        0 0 30px rgba(255, 193, 7, 0.3);
    border: 1px solid rgba(255, 193, 7, 0.5);
}

.btn-warning:hover {
    transform: translateY(-4px);
    box-shadow:
        0 10px 35px rgba(255, 193, 7, 0.6),
        0 0 50px rgba(255, 193, 7, 0.4);
}

.btn-info {
    background: linear-gradient(135deg, #b537ff, #8e24aa);
    color: #ffffff;
    box-shadow:
        0 6px 20px rgba(181, 55, 255, 0.4),
        0 0 30px rgba(181, 55, 255, 0.3);
    border: 1px solid rgba(181, 55, 255, 0.5);
}

.btn-info:hover {
    transform: translateY(-4px);
    box-shadow:
        0 10px 35px rgba(181, 55, 255, 0.6),
        0 0 50px rgba(181, 55, 255, 0.4);
}

.btn-danger {
    background: linear-gradient(135deg, #ff2e97, #ff1744);
    color: #ffffff;
    box-shadow:
        0 6px 20px rgba(255, 46, 151, 0.4),
        0 0 30px rgba(255, 46, 151, 0.3);
    border: 1px solid rgba(255, 46, 151, 0.5);
}

.btn-danger:hover {
    transform: translateY(-4px);
    box-shadow:
        0 10px 35px rgba(255, 46, 151, 0.6),
        0 0 50px rgba(255, 46, 151, 0.4);
}

/* ==================== 退出登录部分 ==================== */
.logout-section {
    display: flex;
    justify-content: center;
    margin-top: 40px;
    padding-top: 30px;
    border-top: 2px solid rgba(0, 240, 255, 0.2);
}

.logout-section button {
    max-width: 300px;
}

/* ==================== 响应式设计 ==================== */
@media (max-width: 1024px) {
    .cards-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 767px) {
    .admin-header {
        padding: 25px 15px;
    }

    .title-icon {
        font-size: 42px;
    }

    .title-gradient {
        font-size: 36px;
    }

    .admin-subtitle {
        font-size: 15px;
        letter-spacing: 1px;
    }

    .back-home span:last-child {
        display: none;
    }

    .login-card {
        padding: 40px 30px;
        position: relative;
        z-index: 100; /* 确保登录卡片可点击 */
    }

    .config-card {
        padding: 25px;
        position: relative;
        z-index: 100; /* 确保配置卡片可点击 */
    }

    .cards-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    /* 确保所有按钮可点击 */
    button,
    .btn-primary,
    .btn-success,
    .btn-warning,
    .btn-info,
    .btn-danger {
        pointer-events: auto !important;
        position: relative;
        z-index: 200;
        touch-action: manipulation;
    }

    /* 减少星空效果在移动端的影响 */
    .starfield-background {
        opacity: 0.5;
    }
}

@media (max-width: 480px) {
    .admin-title {
        flex-direction: column;
        gap: 10px;
    }

    .title-icon {
        font-size: 32px;
    }

    .title-gradient {
        font-size: 28px;
    }

    .login-card {
        padding: 30px 20px;
    }

    .login-card h3 {
        font-size: 24px;
    }

    .config-card {
        padding: 20px;
    }

    .card-header h3 {
        font-size: 18px;
    }

    /* 小屏幕按钮优化 */
    button,
    .btn-primary,
    .btn-success,
    .btn-warning,
    .btn-info,
    .btn-danger {
        padding: 16px 30px;
        font-size: 15px;
        min-height: 50px; /* 确保足够的触摸区域 */
    }

    /* 确保输入框和文本域可见 */
    .form-input,
    .cookie-textarea {
        position: relative;
        z-index: 100;
    }
}

.hidden {
    display: none;
}
