/* ========== 授权查询页面样式 - 全新毛玻璃设计 ========== */

/* 全局变量 */
:root {
    --bg-primary: #f8fafc;
    --bg-secondary: rgba(255, 255, 255, 0.72);
    --bg-tertiary: rgba(241, 245, 249, 0.6);
    --text-primary: #1e293b;
    --text-secondary: #475569;
    --text-tertiary: #94a3b8;
    --border-color: rgba(255, 255, 255, 0.45);
    --input-bg: rgba(255, 255, 255, 0.65);
    --input-border: rgba(203, 213, 225, 0.6);
    --accent-color: #6366f1;
    --accent-hover: #4f46e5;
    --accent-light: rgba(99, 102, 241, 0.15);
    --success-color: #10b981;
    --error-color: #ef4444;
    --warning-color: #f59e0b;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.12);
    --shadow-glow: 0 0 40px rgba(99, 102, 241, 0.15);
    --radius-md: 12px;
    --radius-lg: 20px;
    --glass-blur: 18px;
    --bg-gradient-start: rgba(99, 102, 241, 0.3);
    --bg-gradient-end: rgba(139, 92, 246, 0.2);
}

[data-theme="dark"] {
    --bg-primary: #0f172a;
    --bg-secondary: rgba(15, 23, 42, 0.75);
    --bg-tertiary: rgba(30, 41, 59, 0.6);
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-tertiary: #64748b;
    --border-color: rgba(148, 163, 184, 0.15);
    --input-bg: rgba(30, 41, 59, 0.65);
    --input-border: rgba(71, 85, 105, 0.5);
    --accent-color: #818cf8;
    --accent-hover: #a5b4fc;
    --accent-light: rgba(99, 102, 241, 0.2);
    --shadow-glow: 0 0 40px rgba(129, 140, 248, 0.15);
    --bg-gradient-start: rgba(99, 102, 241, 0.2);
    --bg-gradient-end: rgba(15, 23, 42, 0.8);
}

/* 基础样式 */
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow-x: hidden;
    background: #0a0a1a;
}

/* 全屏背景图 */
.bg-decoration {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: url('/api/bg.php') center/cover no-repeat;
    z-index: -2;
}
.bg-decoration::after {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: linear-gradient(135deg, var(--bg-gradient-start), var(--bg-gradient-end));
    z-index: -1;
}



/* 浮动粒子效果 */
.particles { position: fixed; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; z-index: -1; overflow: hidden; }
.particle {
    position: absolute;
    width: 6px; height: 6px;
    background: rgba(255,255,255,0.25);
    border-radius: 50%;
    animation: particleFloat linear infinite;
}
@keyframes particleFloat {
    0% { transform: translateY(100vh) rotate(0deg); opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { transform: translateY(-10vh) rotate(720deg); opacity: 0; }
}

/* 主容器 */
.container { width: 100%; max-width: 500px; padding: 20px; z-index: 1; }
.query-card {
    background: var(--bg-secondary);
    backdrop-filter: blur(var(--glass-blur)) saturate(180%);
    -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(180%);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg), var(--shadow-glow), inset 0 1px 0 rgba(255,255,255,0.2);
    padding: 44px 40px;
    position: relative;
    overflow: hidden;
    border: 1px solid var(--border-color);
    animation: cardEntry 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}
.query-card::before {
    content: '';
    position: absolute; top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, #6366f1, #a855f7, #ec4899, #6366f1);
    background-size: 300% 100%;
    animation: gradientFlow 4s linear infinite;
}
.header { text-align: center; margin-bottom: 30px; }
.logo-icon { font-size: 48px; color: var(--accent-color); margin-bottom: 15px; display: inline-block; filter: drop-shadow(0 4px 12px rgba(99,102,241,0.3)); }
h1 { font-size: 24px; font-weight: 700; color: var(--text-primary); margin-bottom: 8px; }
.subtitle { color: var(--text-secondary); font-size: 14px; }

/* 查询类型选项卡 */
.query-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 28px;
    padding: 5px;
    background: var(--bg-tertiary);
    backdrop-filter: blur(8px);
    border-radius: var(--radius-md);
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.06);
    border: 1px solid var(--border-color);
}

.tab-btn {
    flex: 1;
    padding: 12px 20px;
    border: none;
    border-radius: calc(var(--radius-md) - 3px);
    background: transparent;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    position: relative;
    overflow: hidden;
}

.tab-btn:hover {
    color: var(--text-primary);
    background: rgba(99,102,241,0.08);
}

.tab-btn.active {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: white;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.35);
    transform: translateY(-1px);
}
.tab-btn.active:hover {
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.45);
}
.tab-btn i { font-size: 15px; transition: transform 0.3s; }
.tab-btn.active i { transform: scale(1.15); }

/* 表单 */
.input-group { margin-bottom: 22px; position: relative; }
.input-group label { display: block; margin-bottom: 8px; font-size: 13px; font-weight: 600; color: var(--text-secondary); letter-spacing: 0.5px; text-transform: uppercase; }
.input-wrapper { position: relative; }
.input-icon { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--text-tertiary); font-size: 16px; transition: all 0.3s; }
.query-input {
    width: 100%; padding: 14px 16px 14px 46px; font-size: 15px;
    border: 2px solid var(--input-border); border-radius: var(--radius-md);
    background: var(--input-bg); backdrop-filter: blur(8px);
    color: var(--text-primary); outline: none; transition: all 0.3s;
}
.query-input:focus { border-color: var(--accent-color); box-shadow: 0 0 0 4px var(--accent-light), 0 4px 12px rgba(99,102,241,0.1); }
.query-input:focus + .input-icon { color: var(--accent-color); transform: translateY(-50%) scale(1.1); }
.query-input::placeholder { color: var(--text-tertiary); }

/* 按钮 */
.btn {
    width: 100%; padding: 15px; border: none; border-radius: var(--radius-md);
    font-size: 16px; font-weight: 600; cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex; align-items: center; justify-content: center; gap: 8px;
    position: relative; overflow: hidden;
}
.btn::after {
    content: '';
    position: absolute; top: 50%; left: 50%;
    width: 0; height: 0;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}
.btn:active::after { width: 300px; height: 300px; }
.btn-primary { background: linear-gradient(135deg, #6366f1, #8b5cf6); color: white; }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(99,102,241,0.4); }
.btn-primary:active { transform: translateY(0); }
.btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none !important; box-shadow: none !important; }

/* 结果展示 */
.result-box {
    margin-top: 25px; padding: 20px; border-radius: var(--radius-md);
    background: var(--bg-tertiary); backdrop-filter: blur(8px);
    border: 1px solid var(--border-color);
    display: none; animation: resultSlide 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes resultSlide {
    from { opacity: 0; transform: translateY(10px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
.result-header { display: flex; align-items: center; gap: 12px; margin-bottom: 15px; padding-bottom: 15px; border-bottom: 1px solid var(--border-color); }
.status-icon { font-size: 26px; }
.status-title { font-weight: 700; font-size: 16px; }
.result-details { font-size: 14px; color: var(--text-secondary); }
.result-text {
    font-family: 'Consolas', 'Monaco', monospace; font-size: 13px; line-height: 1.8;
    color: var(--text-primary); white-space: pre-wrap; word-break: break-all;
    padding: 16px; background: var(--input-bg); backdrop-filter: blur(6px);
    border-radius: calc(var(--radius-md) - 2px); border: 1px solid var(--border-color); margin-top: 10px;
}
.result-item { display: flex; justify-content: space-between; margin-bottom: 8px; }
.result-label { color: var(--text-tertiary); }
.result-value { font-weight: 500; color: var(--text-primary); }
.status-success { background: rgba(16, 185, 129, 0.12); border-color: rgba(16, 185, 129, 0.25); }
.status-success .status-icon, .status-success .status-title { color: var(--success-color); }
.status-error { background: rgba(239, 68, 68, 0.12); border-color: rgba(239, 68, 68, 0.25); }
.status-error .status-icon, .status-error .status-title { color: var(--error-color); }

/* 无代理警告样式 */
.status-warning {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.15), rgba(220, 38, 38, 0.1));
    border: 2px solid rgba(239, 68, 68, 0.3);
    box-shadow: 0 4px 16px rgba(239, 68, 68, 0.15), inset 0 1px 0 rgba(255,255,255,0.1);
    position: relative; overflow: hidden;
}
.status-warning::before {
    content: '';
    position: absolute; top: 0; left: -100%; width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
    animation: shimmer 3s infinite;
}
@keyframes shimmer { 0% { left: -100%; } 100% { left: 100%; } }
.status-warning .status-icon, .status-warning .status-title { color: #dc2626; }
.status-warning .result-details { color: #991b1b; font-weight: 500; }
[data-theme="dark"] .status-warning { background: linear-gradient(135deg, rgba(239,68,68,0.2), rgba(220,38,38,0.15)); border-color: rgba(239,68,68,0.4); }
[data-theme="dark"] .status-warning .status-icon, [data-theme="dark"] .status-warning .status-title { color: #f87171; }
[data-theme="dark"] .status-warning .result-details { color: #fca5a5; }

/* 底部链接 */
.footer-links { margin-top: 28px; text-align: center; display: flex; justify-content: center; gap: 20px; }
.link {
    color: var(--text-secondary); text-decoration: none; font-size: 14px;
    transition: all 0.3s; padding: 4px 0;
    border-bottom: 1px solid transparent;
}
.link:hover { color: var(--accent-color); border-bottom-color: var(--accent-color); }

/* 工具栏 */
.toolbar { position: fixed; top: 20px; right: 20px; display: flex; gap: 10px; z-index: 100; }
.icon-btn {
    width: 42px; height: 42px; border-radius: 50%;
    background: var(--bg-secondary); backdrop-filter: blur(12px);
    border: 1px solid var(--border-color); color: var(--text-secondary);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; transition: all 0.3s; box-shadow: var(--shadow-md);
}
.icon-btn:hover { color: var(--accent-color); border-color: var(--accent-color); transform: rotate(20deg) scale(1.1); box-shadow: var(--shadow-glow); }

/* 加载动画 */
.page-loader {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: url('/api/bg.php') center/cover no-repeat;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    z-index: 9999; transition: opacity 0.25s ease, visibility 0.25s ease;
}
.page-loader::after {
    content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.45);
}
.page-loader.hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.loader-spinner {
    width: 48px; height: 48px;
    border: 3px solid rgba(255,255,255,0.2); border-radius: 50%;
    border-top-color: #a5b4fc; border-right-color: #818cf8;
    animation: spin 0.8s ease-in-out infinite; z-index: 1;
}

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes cardEntry {
    from { opacity: 0; transform: translateY(30px) scale(0.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes gradientFlow { 0% { background-position: 0% 50%; } 100% { background-position: 300% 50%; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ========== 移动端适配 ========== */

@media (max-width: 768px) {
    body { padding: 0; align-items: flex-start; }
    .container { max-width: 100%; padding: 15px; min-height: 100vh; display: flex; align-items: center; justify-content: center; }
    .query-card { padding: 35px 25px; border-radius: 16px; width: 100%; max-width: 420px; }
    .toolbar { top: 15px; right: 15px; }
}

@media (max-width: 480px) {
    body { min-height: 100vh; min-height: -webkit-fill-available; }
    html { height: -webkit-fill-available; }
    .container { padding: 12px; align-items: flex-start; padding-top: 60px; }
    .query-card { padding: 28px 18px; border-radius: 14px; }
    .header { margin-bottom: 24px; }
    .logo-icon { font-size: 42px; margin-bottom: 12px; }
    h1 { font-size: 20px; margin-bottom: 6px; }
    .subtitle { font-size: 13px; }
    .query-tabs { gap: 6px; padding: 3px; margin-bottom: 20px; }
    .tab-btn { padding: 10px 12px; font-size: 13px; gap: 5px; }
    .tab-btn i { font-size: 14px; }
    .input-group { margin-bottom: 16px; }
    .input-group label { font-size: 12px; margin-bottom: 6px; }
    .query-input { padding: 12px 12px 12px 40px; font-size: 16px; border-radius: 10px; }
    .input-icon { left: 12px; font-size: 15px; }
    .btn { padding: 13px; font-size: 15px; border-radius: 10px; }
    .result-box { margin-top: 20px; padding: 16px; border-radius: 10px; }
    .result-header { gap: 10px; margin-bottom: 12px; padding-bottom: 12px; }
    .status-icon { font-size: 22px; }
    .status-title { font-size: 15px; }
    .result-details { font-size: 13px; }
    .result-text { font-size: 12px; padding: 12px; line-height: 1.7; border-radius: 8px; }
    .footer-links { margin-top: 20px; gap: 16px; }
    .link { font-size: 13px; }
    .toolbar { top: 12px; right: 12px; }
    .icon-btn { width: 36px; height: 36px; font-size: 14px; }
}

@media (max-width: 360px) {
    .container { padding: 10px; padding-top: 55px; }
    .query-card { padding: 24px 15px; }
    .logo-icon { font-size: 38px; }
    h1 { font-size: 18px; }
    .subtitle { font-size: 12px; }
    .query-input { padding: 11px 11px 11px 38px; }
    .btn { padding: 12px; font-size: 14px; }
    .result-text { font-size: 11px; padding: 10px; }
}

@media (max-height: 500px) and (orientation: landscape) {
    .container { padding-top: 15px; align-items: flex-start; }
    .query-card { padding: 20px; }
    .header { margin-bottom: 15px; }
    .logo-icon { font-size: 32px; margin-bottom: 8px; }
    h1 { font-size: 18px; margin-bottom: 4px; }
    .input-group { margin-bottom: 12px; }
    .result-box { margin-top: 15px; padding: 12px; }
    .footer-links { margin-top: 15px; }
}

@supports (padding: max(0px)) {
    .container { padding-left: max(12px, env(safe-area-inset-left)); padding-right: max(12px, env(safe-area-inset-right)); padding-bottom: max(12px, env(safe-area-inset-bottom)); }
    .toolbar { right: max(12px, env(safe-area-inset-right)); }
}

@media (hover: none) and (pointer: coarse) {
    .btn:hover { transform: none; box-shadow: none; }
    .btn:active { transform: scale(0.98); opacity: 0.9; }
    .icon-btn:hover { transform: none; }
    .icon-btn:active { transform: scale(0.95); }
    .link:hover { color: var(--text-secondary); }
    .link:active { color: var(--accent-color); }
}
