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

/* 全局变量 */
: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-image: url('/api/bg-tiny.php?v=20260508a');
    background-size: cover;
    background-position: center;
    background-color: #0a0a1a;
    filter: blur(10px);
    transition: filter 0.4s ease, background-image 0.2s ease;
    z-index: -2;
}

.bg-decoration.bg-loaded {
    background-image: url('/api/bg.php?v=20260508a');
    background-image: -webkit-image-set(url('/api/bg.webp?v=20260508a') type('image/webp'),
            url('/api/bg.php?v=20260508a') type('image/jpeg'));
    background-image: image-set(url('/api/bg.webp?v=20260508a') type('image/webp'),
            url('/api/bg.php?v=20260508a') type('image/jpeg'));
    filter: blur(0);
}

.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);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg), var(--shadow-glow);
    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);
    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: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.35s, background 0.35s;
    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: color 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);
    color: var(--text-primary);
    outline: none;
    transition: border-color 0.3s, box-shadow 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: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s, background 0.3s;
    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);
    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);
    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;
    position: relative;
    z-index: 100;
}

.link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s, border-color 0.3s;
    padding: 4px 0;
    border-bottom: 1px solid transparent;
    cursor: pointer !important;
    pointer-events: auto !important;
    position: relative;
    z-index: 101;
}

.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);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: color 0.3s, border-color 0.3s, transform 0.3s, box-shadow 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-tiny.php?v=20260508a') center/cover no-repeat, #0a0a1a;
    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: center;
    }

    .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) {
    html {
        height: 100%;
    }

    body {
        min-height: 100vh;
        min-height: -webkit-fill-available;
        align-items: center;
    }

    .container {
        padding: 16px;
        padding-top: 16px;
        align-items: center;
        justify-content: center;
        min-height: 100vh;
        min-height: -webkit-fill-available;
    }

    .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;
        align-items: center;
    }

    .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);
    }
}

/* ========== 🎨 v2026.06 首页查询页 UI 增强 ========== */

/* 查询输入框聚焦时柔和提升 */
.query-input:focus {
    transform: translateY(-1px);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, .15), 0 4px 12px rgba(99, 102, 241, .12) !important;
}

/* 标签按钮过渡更柔和 */
.tab-btn {
    transition: all 0.25s cubic-bezier(.4, 0, .2, 1) !important;
}

.tab-btn:not(.active):hover {
    background: rgba(99, 102, 241, .06);
    transform: translateY(-1px);
}

.tab-btn.active {
    box-shadow: 0 4px 12px rgba(99, 102, 241, .2);
}

/* 查询按钮：渐变发光 */
#queryBtn {
    position: relative;
    overflow: hidden;
}

#queryBtn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .25), transparent);
    transition: left 0.7s;
}

#queryBtn:hover::before {
    left: 100%;
}

#queryBtn:not(:disabled):hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(99, 102, 241, .35) !important;
}

/* 结果框出现动画 */
.result-box[style*="display: block"],
.result-box[style*="display:block"] {
    animation: resultSlideUp 0.35s cubic-bezier(.4, 0, .2, 1);
}

@keyframes resultSlideUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

/* 底部链接 hover 效果 */
.footer-links .link {
    transition: color .2s ease, transform .2s ease;
    position: relative;
}

.footer-links .link::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -2px;
    width: 0;
    height: 1.5px;
    background: var(--accent-color);
    transition: width .25s ease;
}

.footer-links .link:hover::after {
    width: 100%;
}

/* 滚动条精致化 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, rgba(99, 102, 241, .25), rgba(139, 92, 246, .25));
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, rgba(99, 102, 241, .45), rgba(139, 92, 246, .45));
}