/* ========== 授权查询页面样式 ========== */

/* 全局变量 */
:root {
    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f1f5f9;
    --text-primary: #1e293b;
    --text-secondary: #475569;
    --text-tertiary: #94a3b8;
    --border-color: #e2e8f0;
    --input-bg: #ffffff;
    --input-border: #cbd5e1;
    --accent-color: #4f46e5;
    --accent-hover: #4338ca;
    --accent-light: #e0e7ff;
    --success-color: #10b981;
    --error-color: #ef4444;
    --warning-color: #f59e0b;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --bg-gradient-start: #e0e7ff;
    --bg-gradient-end: #818cf8;
}

[data-theme="dark"] {
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-tertiary: #64748b;
    --border-color: #334155;
    --input-bg: #1e293b;
    --input-border: #475569;
    --accent-color: #6366f1;
    --accent-hover: #818cf8;
    --accent-light: rgba(99, 102, 241, 0.2);
    --bg-gradient-start: #0f172a;
    --bg-gradient-end: #1e293b;
}

/* 基础样式 */
* { box-sizing: border-box; margin: 0; padding: 0; transition: background-color 0.3s, border-color 0.3s, color 0.3s; }
body { font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; background: var(--bg-primary); color: var(--text-primary); line-height: 1.6; min-height: 100vh; display: flex; align-items: center; justify-content: center; position: relative; overflow-x: hidden; }
.bg-decoration { position: absolute; top: 0; left: 0; width: 100%; height: 50vh; background: linear-gradient(135deg, var(--bg-gradient-start) 0%, var(--bg-primary) 100%); z-index: -1; }

/* 主容器 */
.container { width: 100%; max-width: 480px; padding: 20px; }
.query-card { background: var(--bg-secondary); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); padding: 40px; position: relative; overflow: hidden; border: 1px solid var(--border-color); animation: slideUp 0.5s cubic-bezier(0.16, 1, 0.3, 1); }
.header { text-align: center; margin-bottom: 30px; }
.logo-icon { font-size: 48px; color: var(--accent-color); margin-bottom: 15px; display: inline-block; }
h1 { font-size: 24px; font-weight: 700; color: var(--text-primary); margin-bottom: 8px; }
.subtitle { color: var(--text-secondary); font-size: 14px; }

/* 表单 */
.input-group { margin-bottom: 20px; position: relative; }
.input-group label { display: block; margin-bottom: 8px; font-size: 14px; font-weight: 500; color: var(--text-secondary); }
.input-wrapper { position: relative; }
.input-icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--text-tertiary); font-size: 16px; transition: color 0.3s; }
.query-input { width: 100%; padding: 12px 12px 12px 42px; 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: all 0.3s; }
.query-input:focus { border-color: var(--accent-color); box-shadow: 0 0 0 3px var(--accent-light); }
.query-input:focus + .input-icon { color: var(--accent-color); }

/* 按钮 */
.btn { width: 100%; padding: 14px; border: none; border-radius: var(--radius-md); font-size: 16px; font-weight: 600; cursor: pointer; transition: all 0.2s; display: flex; align-items: center; justify-content: center; gap: 8px; }
.btn-primary { background: var(--accent-color); color: white; }
.btn-primary:hover { background: var(--accent-hover); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3); }
.btn-primary:active { transform: translateY(0); }
.btn:disabled { opacity: 0.7; cursor: not-allowed; transform: none; }

/* 结果展示 */
.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: fadeIn 0.4s ease; }
.result-header { display: flex; align-items: center; gap: 10px; margin-bottom: 15px; padding-bottom: 15px; border-bottom: 1px solid var(--border-color); }
.status-icon { font-size: 24px; }
.status-title { font-weight: 600; 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: 15px; background: var(--bg-secondary); border-radius: var(--radius-md); 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.1); border-color: rgba(16, 185, 129, 0.2); }
.status-success .status-icon, .status-success .status-title { color: var(--success-color); }
.status-error { background: rgba(239, 68, 68, 0.1); border-color: rgba(239, 68, 68, 0.2); }
.status-error .status-icon, .status-error .status-title { color: var(--error-color); }

/* 底部链接 */
.footer-links { margin-top: 25px; text-align: center; display: flex; justify-content: center; gap: 20px; }
.link { color: var(--text-secondary); text-decoration: none; font-size: 14px; transition: color 0.2s; }
.link:hover { color: var(--accent-color); }

/* 工具栏 */
.toolbar { position: absolute; top: 20px; right: 20px; display: flex; gap: 10px; z-index: 10; }
.icon-btn { width: 40px; height: 40px; 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: all 0.2s; box-shadow: var(--shadow-sm); }
.icon-btn:hover { color: var(--accent-color); border-color: var(--accent-color); transform: rotate(15deg); }

/* 加载动画 */
.page-loader { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: linear-gradient(135deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%); display: flex; flex-direction: column; align-items: center; justify-content: center; z-index: 9999; transition: opacity 0.5s ease, visibility 0.5s ease; }
.page-loader.hidden { opacity: 0; visibility: hidden; }
.loader-spinner { width: 50px; height: 50px; border: 3px solid rgba(255, 255, 255, 0.3); border-radius: 50%; border-top-color: white; animation: spin 1s ease-in-out infinite; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes slideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@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: var(--radius-md);
        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;
    }
    .bg-decoration {
        height: 40vh;
    }
    .container {
        padding: 12px;
        align-items: flex-start;
        padding-top: 60px;
    }
    .query-card {
        padding: 28px 18px;
        border-radius: 12px;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    }
    .header {
        margin-bottom: 24px;
    }
    .logo-icon {
        font-size: 42px;
        margin-bottom: 12px;
    }
    h1 {
        font-size: 20px;
        margin-bottom: 6px;
    }
    .subtitle {
        font-size: 13px;
    }
    .input-group {
        margin-bottom: 16px;
    }
    .input-group label {
        font-size: 13px;
        margin-bottom: 6px;
    }
    .query-input {
        padding: 12px 12px 12px 40px;
        font-size: 16px; /* 防止iOS缩放 */
        border-radius: 8px;
    }
    .input-icon {
        left: 12px;
        font-size: 15px;
    }
    .btn {
        padding: 13px;
        font-size: 15px;
        border-radius: 8px;
    }
    .result-box {
        margin-top: 20px;
        padding: 16px;
        border-radius: 8px;
    }
    .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: 6px;
    }
    .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);
    }
}

