/* Import Modern Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;450;500;600;650;700;800&display=swap');

/* CSS Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.7;
    color: #2c3e50;
    overflow-x: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 400;
    letter-spacing: -0.02em;
}

/* Page States - Modern Single Background Colors */
body.loading {
    background: #4f46e5; /* 现代紫色 */
}

body.forbidden {
    background: #ef4444; /* 现代红色 */
}

body.blocked {
    background: #f59e0b; /* 现代橙色 */
}

body.whitelisted {
    background: #10b981; /* 现代绿色 */
}

body.success {
    background: #06b6d4; /* 现代青色 */
}

body.error {
    background: #dc2626; /* 深红色 */
}

/* Page Container */
.page-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    position: relative;
}

/* Header */
.header {
    width: 100%;
    max-width: 1200px;
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

.logo {
    display: flex;
    align-items: center;
    color: rgba(255, 255, 255, 0.95);
    font-size: 22px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.logo svg {
    margin-right: 14px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 动态徽标样式 - 根据页面状态变化 */
/* 加载状态 */
body.loading .logo {
    color: rgba(255, 255, 255, 1);
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
}

body.loading .logo svg {
    animation: logoSpin 2s linear infinite;
    filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.5));
}

/* 禁止访问状态 */
body.forbidden .logo {
    color: rgba(255, 255, 255, 0.9);
    text-shadow: 0 0 15px rgba(255, 100, 100, 0.4);
}

body.forbidden .logo svg {
    animation: logoShake 0.5s ease-in-out;
    filter: drop-shadow(0 0 8px rgba(255, 100, 100, 0.6));
}

/* 被拦截状态 */
body.blocked .logo {
    color: rgba(255, 255, 255, 0.95);
    text-shadow: 0 0 15px rgba(255, 165, 0, 0.4);
    animation: logoPulse 2s ease-in-out infinite;
}

body.blocked .logo svg {
    animation: logoAlert 1.5s ease-in-out infinite;
    filter: drop-shadow(0 0 8px rgba(255, 165, 0, 0.6));
}

/* 已放行状态 */
body.whitelisted .logo {
    color: rgba(255, 255, 255, 1);
    text-shadow: 0 0 15px rgba(34, 197, 94, 0.4);
}

body.whitelisted .logo svg {
    animation: logoSuccess 0.6s ease-out;
    filter: drop-shadow(0 0 8px rgba(34, 197, 94, 0.6));
}

/* 成功状态 */
body.success .logo {
    color: rgba(255, 255, 255, 1);
    text-shadow: 0 0 15px rgba(6, 182, 212, 0.4);
}

body.success .logo svg {
    animation: logoCheckmark 0.8s ease-out;
    filter: drop-shadow(0 0 10px rgba(6, 182, 212, 0.6));
}

/* 错误状态 */
body.error .logo {
    color: rgba(255, 255, 255, 0.9);
    text-shadow: 0 0 15px rgba(220, 38, 38, 0.4);
}

body.error .logo svg {
    animation: logoError 0.6s ease-in-out;
    filter: drop-shadow(0 0 8px rgba(220, 38, 38, 0.6));
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    max-width: 600px;
}

.content-card {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    border-radius: 28px;
    padding: 56px 48px;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(255, 255, 255, 0.1);
    border: none;
    text-align: center;
    width: 100%;
    max-width: 520px;
    animation: slideInUp 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.content-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.8), transparent);
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Status Icons */
.status-icon {
    margin: 0 auto 24px;
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.forbidden-icon {
    color: #dc2626;
}

.blocked-icon {
    color: #ea580c;
}

.success-icon {
    color: #059669;
}

.error-icon {
    color: #dc2626;
}

/* Typography */
h1 {
    font-size: 32px;
    font-weight: 800;
    margin-bottom: 20px;
    color: #1a202c;
    letter-spacing: -0.04em;
    line-height: 1.2;
}

h3 {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 16px;
    color: #2d3748;
    letter-spacing: -0.02em;
}

h4 {
    font-size: 18px;
    font-weight: 650;
    margin-bottom: 12px;
    color: #2d3748;
    letter-spacing: -0.01em;
}

p {
    font-size: 17px;
    color: #4a5568;
    margin-bottom: 20px;
    line-height: 1.8;
    letter-spacing: -0.01em;
    font-weight: 450;
}

/* URL Display */
.url-display {
    margin: 24px 0;
    text-align: left;
}

.url-display label {
    display: block;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 12px;
    font-size: 16px;
    letter-spacing: -0.01em;
}

.url-box {
    background: #f9fafb;
    border: 2px solid #f3f4f6;
    border-radius: 16px;
    padding: 20px;
    word-break: break-all;
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', 'Source Code Pro', monospace;
    font-size: 15px;
    color: #374151;
    line-height: 1.6;
    transition: all 0.2s ease;
}

.url-box:hover {
    border-color: #e5e7eb;
    background: #ffffff;
}

.url-box a {
    color: #2563eb;
    text-decoration: none;
    transition: color 0.2s ease;
    font-weight: 500;
}

.url-box a:hover {
    color: #1d4ed8;
    text-decoration: underline;
}

/* Reason Display */
.reason-display {
    margin: 24px 0;
    text-align: left;
}

.reason-display label {
    display: block;
    font-weight: 600;
    color: #34495e;
    margin-bottom: 8px;
    font-size: 14px;
}

.reason-box {
    background: #fff3cd;
    border: 2px solid #ffeaa7;
    border-radius: 12px;
    padding: 16px;
    font-size: 14px;
    color: #856404;
    line-height: 1.4;
}

/* Buttons */
.button-group {
    margin: 40px 0 20px;
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 16px 32px;
    border-radius: 16px;
    font-size: 17px;
    font-weight: 650;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-transform: none;
    letter-spacing: -0.01em;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: #1f2937;
    color: white;
    box-shadow: 0 10px 25px rgba(31, 41, 55, 0.25);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 35px rgba(31, 41, 55, 0.35);
    background: #111827;
}

.btn-secondary {
    background: #6b7280;
    color: white;
    box-shadow: 0 10px 25px rgba(107, 114, 128, 0.25);
}

.btn-secondary:hover {
    background: #4b5563;
    transform: translateY(-3px);
    box-shadow: 0 15px 35px rgba(75, 85, 99, 0.35);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

.btn svg {
    width: 16px;
    height: 16px;
}

/* Info Boxes */
.info-box {
    background: #f0f9ff;
    border: 2px solid #e0f2fe;
    border-radius: 16px;
    padding: 24px;
    margin: 28px 0;
    text-align: left;
    font-size: 15px;
}

.info-box.success {
    background: #f0fdf4;
    border-color: #dcfce7;
}

.info-box p {
    margin-bottom: 12px;
    color: #0c4a6e;
    line-height: 1.7;
}

.info-box.success p {
    color: #166534;
}

.info-box strong {
    font-weight: 700;
}

/* Error Message */
.error-message {
    background: #ffebee;
    border: 2px solid #ffcdd2;
    border-radius: 12px;
    padding: 20px;
    margin: 24px 0;
    text-align: left;
}

.error-message p {
    color: #c62828;
    margin: 0;
    font-size: 14px;
}

/* DNS Help */
.dns-help {
    background: #f8f9fa;
    border: 2px solid #dee2e6;
    border-radius: 12px;
    padding: 20px;
    margin: 24px 0;
    text-align: left;
    font-size: 14px;
}

.dns-help ul {
    margin: 12px 0 0 20px;
}

.dns-help li {
    margin-bottom: 8px;
    color: #495057;
}

.dns-help code {
    background: #e9ecef;
    padding: 4px 8px;
    border-radius: 4px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 12px;
    color: #495057;
}

/* Loading Spinner */
.loading-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(102, 126, 234, 0.2);
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 24px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Footer */
.footer {
    width: 100%;
    text-align: center;
    padding: 20px 0;
    margin-top: 20px;
}

.footer p {
    color: rgba(255, 255, 255, 0.6);
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin: 0;
}

/* Loading Overlay */
#loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.overlay-content {
    text-align: center;
    color: white;
}

.overlay-content p {
    color: rgba(255, 255, 255, 0.9);
    margin-top: 20px;
    font-size: 16px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .page-container {
        padding: 15px;
    }
    
    .content-card {
        padding: 32px 24px;
        border-radius: 20px;
    }
    
    h1 {
        font-size: 24px;
    }
    
    .btn {
        padding: 12px 20px;
        font-size: 14px;
    }
    
    .button-group {
        flex-direction: column;
        align-items: center;
    }
    
    .btn {
        width: 100%;
        max-width: 280px;
    }
    
    .logo {
        font-size: 18px;
    }
    
    .logo svg {
        margin-right: 10px;
        width: 28px;
        height: 28px;
    }
}

@media (max-width: 480px) {
    .content-card {
        padding: 24px 20px;
        margin: 10px;
    }
    
    h1 {
        font-size: 22px;
    }
    
    .url-box, .reason-box {
        font-size: 12px;
        padding: 12px;
    }
    
    .logo {
        font-size: 16px;
        letter-spacing: 1px;
    }
    
    .logo svg {
        width: 24px;
        height: 24px;
        margin-right: 8px;
    }
}

/* Logo Animations */
@keyframes logoSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes logoShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-3px); }
    75% { transform: translateX(3px); }
}

@keyframes logoAlert {
    0%, 100% { 
        transform: scale(1);
        opacity: 1;
    }
    50% { 
        transform: scale(1.1);
        opacity: 0.8;
    }
}

@keyframes logoSuccess {
    0% { 
        transform: scale(1);
    }
    50% { 
        transform: scale(1.15);
    }
    100% { 
        transform: scale(1);
    }
}

@keyframes logoCheckmark {
    0% { 
        transform: scale(1) rotate(0deg);
    }
    50% { 
        transform: scale(1.2) rotate(5deg);
    }
    100% { 
        transform: scale(1) rotate(0deg);
    }
}

@keyframes logoError {
    0%, 100% { 
        transform: rotate(0deg);
    }
    25% { 
        transform: rotate(-5deg);
    }
    75% { 
        transform: rotate(5deg);
    }
}

@keyframes logoPulse {
    0%, 100% { 
        transform: scale(1);
        opacity: 1;
    }
    50% { 
        transform: scale(1.05);
        opacity: 0.9;
    }
}

/* Animation Utilities */
.fade-in {
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.slide-in {
    animation: slideIn 0.5s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Focus States for Accessibility */
.btn:focus,
button:focus {
    outline: 2px solid rgba(102, 126, 234, 0.5);
    outline-offset: 2px;
}

a:focus {
    outline: 2px solid rgba(102, 126, 234, 0.5);
    outline-offset: 2px;
    border-radius: 4px;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}