/* ========================================
   安全浏览器 - 现代化深色主题样式
   ======================================== */

:root {
    /* 主色调 - 深邃的蓝紫渐变 */
    --primary-gradient: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    --accent-color: #e94560;
    --accent-hover: #ff6b6b;
    --secondary-accent: #00d9ff;
    
    /* 背景色 */
    --bg-dark: #0d0d1a;
    --bg-card: rgba(26, 26, 46, 0.95);
    --bg-input: rgba(15, 52, 96, 0.6);
    --bg-hover: rgba(233, 69, 96, 0.1);
    
    /* 文字颜色 */
    --text-primary: #ffffff;
    --text-secondary: #a0a0c0;
    --text-muted: #606080;
    
    /* 边框和阴影 */
    --border-color: rgba(233, 69, 96, 0.3);
    --shadow-glow: 0 0 30px rgba(233, 69, 96, 0.2);
    --shadow-card: 0 10px 40px rgba(0, 0, 0, 0.5);
    
    /* 尺寸 */
    --header-height: 70px;
    --footer-height: 35px;
    --quick-access-height: 50px;
    --border-radius: 12px;
    
    /* 过渡 */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    overflow: hidden;
    /* 移动端适配 */
    -webkit-overflow-scrolling: touch;
    touch-action: manipulation;
}

body {
    font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    line-height: 1.6;
    /* 防止移动端缩放 */
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
}

/* ========================================
   安全检测遮罩层
   ======================================== */

.security-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--primary-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.security-checking {
    text-align: center;
    animation: fadeInUp 0.5s ease;
}

.loader {
    width: 60px;
    height: 60px;
    border: 3px solid var(--bg-input);
    border-top-color: var(--accent-color);
    border-radius: 50%;
    margin: 0 auto 30px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.security-checking h2 {
    font-size: 24px;
    font-weight: 500;
    margin-bottom: 15px;
    background: linear-gradient(90deg, var(--text-primary), var(--secondary-accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.security-checking p {
    color: var(--text-secondary);
    font-size: 14px;
}

/* ========================================
   访问被拒绝页面
   ======================================== */

.access-denied {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--primary-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9998;
}

.denied-content {
    text-align: center;
    padding: 60px;
    background: var(--bg-card);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-card);
    animation: shake 0.5s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-10px); }
    40%, 80% { transform: translateX(10px); }
}

.denied-icon {
    font-size: 80px;
    margin-bottom: 20px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.denied-content h1 {
    font-size: 32px;
    color: var(--accent-color);
    margin-bottom: 15px;
}

.denied-content p {
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.denied-info {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.denied-info p {
    font-size: 12px;
    color: var(--text-muted);
}

/* ========================================
   微信跳转提示页面
   ======================================== */

.wechat-redirect {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #07c160 0%, #09bb07 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9997;
}

.wechat-content {
    text-align: center;
    padding: 40px;
    max-width: 350px;
}

.wechat-icon {
    font-size: 70px;
    margin-bottom: 20px;
    animation: bounce 1s infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-15px); }
}

.wechat-content h2 {
    font-size: 24px;
    color: #fff;
    margin-bottom: 20px;
}

.wechat-content p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 16px;
    margin-bottom: 10px;
}

.dots {
    background: rgba(255, 255, 255, 0.3);
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: bold;
}

.browser-hint {
    font-size: 18px !important;
    font-weight: 600;
    color: #fff !important;
    background: rgba(0, 0, 0, 0.2);
    padding: 10px 20px;
    border-radius: 8px;
    display: inline-block;
    margin: 10px 0;
}

.arrow-guide {
    position: fixed;
    top: 20px;
    right: 30px;
}

.arrow {
    font-size: 50px;
    color: #fff;
    animation: pointUp 1s infinite;
}

@keyframes pointUp {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(10px, -10px); }
}

.copy-link-section {
    margin-top: 30px;
    padding: 20px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
}

.copy-link-section p {
    font-size: 14px !important;
    margin-bottom: 10px;
}

.copy-link-section input {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    background: rgba(255, 255, 255, 0.9);
    color: #333;
    margin-bottom: 10px;
}

.copy-btn {
    width: 100%;
    padding: 12px;
    background: #fff;
    color: #07c160;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-fast);
}

.copy-btn:hover {
    background: #f0f0f0;
}

.copy-btn:active {
    transform: scale(0.98);
}

/* ========================================
   主容器
   ======================================== */

.main-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh; /* 动态视口高度，适配移动端地址栏 */
    width: 100vw;
    background: var(--primary-gradient);
    overflow: hidden;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

/* ========================================
   头部导航栏
   ======================================== */

.header {
    height: var(--header-height);
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    padding: 0 20px;
    gap: 20px;
    backdrop-filter: blur(10px);
}

.header-left {
    flex-shrink: 0;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-icon {
    font-size: 28px;
}

.logo-text {
    font-size: 18px;
    font-weight: 600;
    background: linear-gradient(90deg, var(--accent-color), var(--secondary-accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header-center {
    flex: 1;
    max-width: 800px;
    margin: 0 auto;
}

.url-input-container {
    display: flex;
    align-items: center;
    background: var(--bg-input);
    border: 2px solid transparent;
    border-radius: 50px;
    padding: 5px 5px 5px 20px;
    transition: var(--transition-normal);
}

.url-input-container:focus-within {
    border-color: var(--accent-color);
    box-shadow: var(--shadow-glow);
}

.url-prefix {
    font-size: 18px;
    margin-right: 10px;
    opacity: 0.7;
}

#url-input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 15px;
    padding: 10px 0;
    outline: none;
}

#url-input::placeholder {
    color: var(--text-muted);
}

.go-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, var(--accent-color), var(--accent-hover));
    color: #fff;
    border: none;
    padding: 12px 25px;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-normal);
}

.go-btn:hover {
    transform: translateX(5px);
    box-shadow: 0 5px 20px rgba(233, 69, 96, 0.4);
}

.btn-arrow {
    transition: var(--transition-fast);
}

.go-btn:hover .btn-arrow {
    transform: translateX(5px);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-shrink: 0;
}

.icon-btn {
    width: 40px;
    height: 40px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    font-size: 18px;
    cursor: pointer;
    transition: var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-btn:hover {
    background: var(--bg-hover);
    border-color: var(--accent-color);
    transform: scale(1.05);
}

.security-status {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 15px;
    background: var(--bg-input);
    border-radius: 20px;
    font-size: 13px;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    animation: statusPulse 2s infinite;
}

.status-dot.safe {
    background: #00ff88;
    box-shadow: 0 0 10px #00ff88;
}

.status-dot.warning {
    background: #ffaa00;
    box-shadow: 0 0 10px #ffaa00;
}

.status-dot.danger {
    background: #ff4444;
    box-shadow: 0 0 10px #ff4444;
}

@keyframes statusPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* ========================================
   快捷访问栏
   ======================================== */

.quick-access {
    height: var(--quick-access-height);
    background: rgba(15, 52, 96, 0.4);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    padding: 0 20px;
    gap: 15px;
    overflow-x: auto;
}

.quick-title {
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
}

.quick-links {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    flex: 1;
}

.quick-link {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--bg-input);
    border: 1px solid transparent;
    border-radius: 20px;
    color: var(--text-secondary);
    font-size: 12px;
    text-decoration: none;
    cursor: pointer;
    white-space: nowrap;
    transition: var(--transition-fast);
}

.quick-link:hover {
    background: var(--bg-hover);
    border-color: var(--accent-color);
    color: var(--text-primary);
}

.quick-link-icon {
    font-size: 14px;
}

/* ========================================
   iframe 容器
   ======================================== */

.iframe-container {
    flex: 1;
    position: relative;
    background: #000;
    overflow: hidden;
    /* 移动端全屏适配 */
    width: 100%;
    height: 100%;
    min-height: 0;
}

#content-frame {
    width: 100%;
    height: 100%;
    border: none;
    background: #fff;
    /* 移动端iframe优化 */
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    -webkit-overflow-scrolling: touch;
    overflow: auto;
}

.welcome-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--primary-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.welcome-content {
    text-align: center;
    animation: fadeInUp 0.8s ease;
}

.welcome-icon {
    font-size: 100px;
    margin-bottom: 30px;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

.welcome-content h1 {
    font-size: 36px;
    font-weight: 600;
    margin-bottom: 15px;
    background: linear-gradient(90deg, var(--text-primary), var(--secondary-accent), var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.welcome-content > p {
    color: var(--text-secondary);
    font-size: 16px;
    margin-bottom: 40px;
}

.features {
    display: flex;
    justify-content: center;
    gap: 40px;
}

.feature-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    min-width: 120px;
    transition: var(--transition-normal);
}

.feature-item:hover {
    transform: translateY(-5px);
    border-color: var(--accent-color);
    box-shadow: var(--shadow-glow);
}

.feature-icon {
    font-size: 32px;
}

.feature-item span:last-child {
    color: var(--text-secondary);
    font-size: 14px;
}

.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(13, 13, 26, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 20;
}

.frame-loader {
    width: 50px;
    height: 50px;
    border: 3px solid var(--bg-input);
    border-top-color: var(--accent-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

.loading-overlay p {
    color: var(--text-secondary);
}

.error-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--primary-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 20;
}

.error-content {
    text-align: center;
    padding: 40px;
}

.error-icon {
    font-size: 70px;
    margin-bottom: 20px;
}

.error-content h2 {
    font-size: 24px;
    color: var(--accent-color);
    margin-bottom: 15px;
}

.error-content p {
    color: var(--text-secondary);
    margin-bottom: 25px;
}

.retry-btn {
    padding: 12px 30px;
    background: linear-gradient(135deg, var(--accent-color), var(--accent-hover));
    color: #fff;
    border: none;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-normal);
}

.retry-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 20px rgba(233, 69, 96, 0.4);
}

/* ========================================
   底部状态栏
   ======================================== */

.footer {
    height: var(--footer-height);
    background: var(--bg-card);
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    font-size: 12px;
    color: var(--text-muted);
}

.footer-center {
    color: var(--text-secondary);
}

/* ========================================
   模态框
   ======================================== */

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.modal-content {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 40px;
    max-width: 450px;
    text-align: center;
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-content.danger {
    border-color: var(--accent-color);
    box-shadow: 0 0 50px rgba(233, 69, 96, 0.3);
}

.modal-icon {
    font-size: 60px;
    margin-bottom: 20px;
}

.modal-content h2 {
    font-size: 22px;
    margin-bottom: 15px;
    color: var(--accent-color);
}

.modal-content p {
    color: var(--text-secondary);
    margin-bottom: 25px;
}

.modal-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.btn {
    padding: 12px 25px;
    border: none;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-fast);
}

.btn-primary {
    background: linear-gradient(135deg, var(--secondary-accent), #00a8cc);
    color: #fff;
}

.btn-primary:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(0, 217, 255, 0.4);
}

.btn-danger {
    background: transparent;
    color: var(--accent-color);
    border: 2px solid var(--accent-color);
}

.btn-danger:hover {
    background: var(--accent-color);
    color: #fff;
}

/* ========================================
   响应式设计
   ======================================== */

@media (max-width: 768px) {
    :root {
        --header-height: 60px;
        --footer-height: 30px;
    }
    
    .header {
        flex-wrap: wrap;
        height: auto;
        padding: 10px;
        gap: 8px;
    }
    
    .header-left {
        order: 1;
    }
    
    .header-right {
        order: 2;
        margin-left: auto;
    }
    
    .header-center {
        order: 3;
        width: 100%;
        max-width: none;
    }
    
    .logo-text {
        display: none;
    }
    
    .url-input-container {
        padding: 3px 3px 3px 15px;
    }
    
    .go-btn {
        padding: 10px 18px;
    }
    
    .go-btn span:first-child {
        display: none;
    }
    
    .quick-access {
        display: none;
    }
    
    .features {
        flex-direction: column;
        gap: 15px;
    }
    
    .welcome-content h1 {
        font-size: 24px;
    }
    
    .welcome-icon {
        font-size: 60px;
    }
    
    .modal-content {
        margin: 15px;
        padding: 25px;
    }
    
    .modal-actions {
        flex-direction: column;
    }
    
    /* iframe移动端全屏 */
    .iframe-container {
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        height: 100%;
    }
    
    #content-frame {
        width: 100% !important;
        height: 100% !important;
    }
    
    .footer {
        font-size: 10px;
        padding: 0 10px;
    }
}

/* 更小的屏幕适配 */
@media (max-width: 480px) {
    .security-checking h2 {
        font-size: 18px;
    }
    
    .denied-content {
        padding: 30px 20px;
        margin: 15px;
    }
    
    .denied-icon {
        font-size: 60px;
    }
    
    .denied-content h1 {
        font-size: 24px;
    }
    
    .wechat-content {
        padding: 25px 15px;
    }
    
    .wechat-icon {
        font-size: 50px;
    }
    
    .wechat-content h2 {
        font-size: 20px;
    }
    
    .browser-hint {
        font-size: 16px !important;
        padding: 8px 15px;
    }
    
    .arrow-guide {
        top: 15px;
        right: 20px;
    }
    
    .arrow {
        font-size: 40px;
    }
}

/* 横屏模式适配 */
@media (max-height: 500px) and (orientation: landscape) {
    .security-overlay,
    .access-denied,
    .wechat-redirect {
        overflow-y: auto;
    }
    
    .security-checking,
    .denied-content,
    .wechat-content {
        padding: 20px;
    }
    
    .loader {
        width: 40px;
        height: 40px;
        margin-bottom: 15px;
    }
    
    .denied-icon,
    .wechat-icon {
        font-size: 40px;
        margin-bottom: 10px;
    }
}

/* 安全区域适配（刘海屏、药丸屏） */
@supports (padding: env(safe-area-inset-top)) {
    .main-container {
        padding-top: env(safe-area-inset-top);
        padding-bottom: env(safe-area-inset-bottom);
        padding-left: env(safe-area-inset-left);
        padding-right: env(safe-area-inset-right);
    }
    
    .header {
        padding-top: max(10px, env(safe-area-inset-top));
    }
    
    .footer {
        padding-bottom: max(5px, env(safe-area-inset-bottom));
    }
}

/* ========================================
   滚动条样式
   ======================================== */

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
    background: var(--bg-input);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-color);
}

/* ========================================
   选择文本样式
   ======================================== */

::selection {
    background: var(--accent-color);
    color: #fff;
}
