/* 网页代理浏览器 —— 必应风格门户 + 密码门禁 */
:root {
    --brand1: #667eea;
    --brand2: #764ba2;
    --brand: #4a6cf7;
    --text: #1f2330;
    --muted: #7b8095;
    --line: #e5e7ef;
    --card: #ffffff;
    --danger: #d93025;
    --ok: #1a8f3c;
    --radius: 14px;
    --shadow-sm: 0 1px 3px rgba(16, 24, 40, .08), 0 1px 2px rgba(16, 24, 40, .04);
    --shadow-md: 0 8px 28px rgba(16, 24, 40, .12);
    --shadow-lg: 0 20px 60px rgba(10, 16, 40, .28);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body { width: 100%; min-height: 100%; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC',
        'Hiragino Sans GB', 'Microsoft YaHei', Roboto, sans-serif;
    color: var(--text);
    line-height: 1.6;
    -webkit-text-size-adjust: 100%;
    background: #16213e;
}

/* ============ 背景（渐变 + 光斑，营造壁纸观感） ============ */
.bg {
    position: fixed;
    inset: 0;
    z-index: -1;
    background: linear-gradient(150deg, #1b2a5e 0%, #2b4a8b 38%, #5b4b96 68%, #7a4a86 100%);
    overflow: hidden;
}
.bg::before, .bg::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    filter: blur(90px);
    opacity: .5;
}
.bg::before {
    width: 620px; height: 620px;
    background: radial-gradient(circle, #6f8dff 0%, transparent 68%);
    top: -180px; left: -140px;
}
.bg::after {
    width: 700px; height: 700px;
    background: radial-gradient(circle, #d67bb8 0%, transparent 68%);
    bottom: -260px; right: -180px;
}

/* ============ 通用控件 ============ */
button {
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    border: none;
    border-radius: 10px;
    padding: 12px 18px;
    cursor: pointer;
    transition: transform .14s, filter .14s, background .16s, box-shadow .16s;
    -webkit-tap-highlight-color: transparent;
    white-space: nowrap;
}
button:active { transform: scale(.975); }
button:disabled { opacity: .55; cursor: not-allowed; }

input {
    font-family: inherit;
    font-size: 16px;                /* 16px 防 iOS 聚焦缩放 */
    color: var(--text);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    outline: none;
    min-width: 0;
}
input:focus { border-color: var(--brand); box-shadow: 0 0 0 4px rgba(74, 108, 247, .14); }

/* ============ 一、密码门禁（锁屏） ============ */
.lock {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 22px;
    background: rgba(12, 18, 42, .55);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
}
.lock[hidden] { display: none; }

.lock-card {
    width: 100%;
    max-width: 380px;
    background: rgba(255, 255, 255, .97);
    border-radius: 22px;
    padding: 34px 28px 28px;
    box-shadow: var(--shadow-lg);
    text-align: center;
    animation: rise .34s cubic-bezier(.2, .8, .3, 1);
}
@keyframes rise { from { opacity: 0; transform: translateY(14px) scale(.98); } }

.lock-logo { font-size: 42px; line-height: 1; margin-bottom: 14px; }
.lock-card h1 { font-size: 20px; font-weight: 700; letter-spacing: .3px; }
.lock-sub { color: var(--muted); font-size: 13px; margin: 7px 0 22px; }

.lock-form { display: flex; flex-direction: column; gap: 12px; }
.lock-form input { padding: 14px 16px; text-align: center; letter-spacing: 1px; }
.lock-form button {
    padding: 14px;
    color: #fff;
    border-radius: var(--radius);
    background: linear-gradient(135deg, var(--brand1), var(--brand2));
    font-size: 15px;
}
.lock-form button:hover:not(:disabled) { filter: brightness(1.08); }

.lock-err {
    margin-top: 14px;
    padding: 11px 14px;
    border-radius: 10px;
    background: #fdecea;
    color: var(--danger);
    font-size: 13px;
    font-weight: 500;
    animation: shake .34s;
}
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-6px); }
    75% { transform: translateX(6px); }
}
.lock-foot { margin-top: 18px; font-size: 11.5px; color: #a8adbd; }

/* ============ 二、主界面 ============ */
.app {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
}
.app[hidden] { display: none; }

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 20px;
}
.brand {
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: .3px;
    text-shadow: 0 1px 8px rgba(0, 0, 0, .25);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.top-actions { display: flex; gap: 8px; flex-shrink: 0; }

.icon-btn {
    width: 40px; height: 40px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    border-radius: 50%;
    color: #fff;
    background: rgba(255, 255, 255, .16);
    border: 1px solid rgba(255, 255, 255, .22);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
}
.icon-btn:hover { background: rgba(255, 255, 255, .3); }

/* 居中 hero */
.hero {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 8vh 20px 12vh;
    width: 100%;
    max-width: 700px;
    margin: 0 auto;
}
.hero-logo {
    color: #fff;
    font-size: 40px;
    font-weight: 700;
    letter-spacing: 1px;
    margin-bottom: 6px;
    text-shadow: 0 4px 24px rgba(0, 0, 0, .3);
    text-align: center;
}
.hero-sub {
    color: rgba(255, 255, 255, .82);
    font-size: 13.5px;
    margin-bottom: 30px;
    text-align: center;
}

/* 搜索框 */
.search {
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
    background: #fff;
    border-radius: 26px;
    box-shadow: var(--shadow-md);
    transition: box-shadow .2s, transform .2s;
}
.search:focus-within {
    box-shadow: 0 12px 40px rgba(0, 0, 0, .26), 0 0 0 3px rgba(255, 255, 255, .35);
}
.search input {
    flex: 1 1 auto;
    width: 100%;
    height: 54px;
    padding: 0 20px;
    border: none;
    border-radius: 26px;
    background: transparent;
    font-size: 16px;
}
.search input:focus { box-shadow: none; }
.search-btn {
    flex-shrink: 0;
    height: 42px;
    margin-right: 6px;
    padding: 0 22px;
    border-radius: 21px;
    color: #fff;
    font-size: 14.5px;
    background: linear-gradient(135deg, var(--brand1), var(--brand2));
}
.search-btn:hover:not(:disabled) { filter: brightness(1.08); }

/* 动作提示（随输入变化：将打开 / 将搜索 / 将下载） */
.action-hint {
    width: 100%;
    margin-top: 12px;
    min-height: 20px;
    font-size: 12.5px;
    color: rgba(255, 255, 255, .8);
    text-align: center;
    line-height: 1.5;
    word-break: break-all;
    padding: 0 6px;
}
.action-hint .k { color: #fff; font-weight: 600; }
.action-hint .dl { color: #b9f6ca; font-weight: 600; }
.action-hint .warn { color: #ffd54f; }

/* 引擎切换 */
.engines {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 18px;
    flex-wrap: wrap;
    justify-content: center;
}
.engines .lbl { color: rgba(255, 255, 255, .7); font-size: 12.5px; }
.engine {
    padding: 7px 15px;
    font-size: 13px;
    font-weight: 500;
    border-radius: 20px;
    color: rgba(255, 255, 255, .9);
    background: rgba(255, 255, 255, .14);
    border: 1px solid rgba(255, 255, 255, .2);
}
.engine:hover { background: rgba(255, 255, 255, .26); }
.engine.on {
    color: #3a3f6b;
    background: #fff;
    border-color: #fff;
    font-weight: 600;
}

/* 常用站点 */
.shortcuts {
    display: flex;
    gap: 10px;
    margin-top: 34px;
    flex-wrap: wrap;
    justify-content: center;
}
.shortcut {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 15px;
    border-radius: 22px;
    font-size: 13px;
    font-weight: 500;
    color: #fff;
    background: rgba(255, 255, 255, .13);
    border: 1px solid rgba(255, 255, 255, .18);
}
.shortcut:hover { background: rgba(255, 255, 255, .25); }

/* 底部 */
.foot {
    padding: 0 20px 22px;
    text-align: center;
    font-size: 11.5px;
    color: rgba(255, 255, 255, .55);
    line-height: 1.8;
}

/* 提示条 */
.toast {
    position: fixed;
    top: 18px;
    left: 50%;
    transform: translateX(-50%) translateY(-10px);
    z-index: 200;
    padding: 11px 20px;
    border-radius: 12px;
    font-size: 13.5px;
    font-weight: 500;
    color: #fff;
    background: rgba(24, 28, 42, .92);
    box-shadow: var(--shadow-md);
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s, transform .2s;
    max-width: calc(100% - 32px);
    word-break: break-word;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.err { background: rgba(190, 40, 40, .95); }
.toast.ok { background: rgba(20, 130, 60, .95); }

/* ============ 三、会话面板 ============ */
.panel {
    position: fixed;
    inset: 0;
    z-index: 150;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    background: rgba(12, 18, 42, .5);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    padding: 0;
}
.panel[hidden] { display: none; }

.panel-card {
    width: 100%;
    max-width: 560px;
    max-height: 82vh;
    overflow-y: auto;
    background: var(--card);
    border-radius: 22px 22px 0 0;
    padding: 22px 20px 28px;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, .3);
    animation: slideUp .28s cubic-bezier(.2, .8, .3, 1);
}
@keyframes slideUp { from { transform: translateY(24px); opacity: .6; } }

.panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
}
.panel-head h2 { font-size: 17px; font-weight: 700; }
.panel-close {
    width: 34px; height: 34px;
    padding: 0;
    border-radius: 50%;
    font-size: 17px;
    color: var(--muted);
    background: #f1f2f7;
}
.panel-close:hover { background: #e6e8f0; }

.sec-title {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .6px;
    margin: 20px 0 10px;
}
.sec-title:first-of-type { margin-top: 0; }

.cur-session {
    display: flex;
    gap: 8px;
    align-items: center;
}
.cur-session input {
    flex: 1 1 auto;
    padding: 11px 13px;
    font-size: 13px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    background: #f6f7fb;
    color: #5a5f72;
}
.mini { padding: 11px 14px; font-size: 13px; background: #eef0f8; color: #454a63; border-radius: 10px; }
.mini:hover { background: #e3e7f5; }

.sess-list { display: flex; flex-direction: column; gap: 9px; }
.sess {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border: 1.5px solid var(--line);
    border-radius: 13px;
    background: #fbfbfe;
}
.sess.current { border-color: var(--brand); background: #f4f6ff; }
.sess .info { flex: 1 1 auto; min-width: 0; }
.sess .sid {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 12.5px;
    color: #3c4157;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.sess .meta { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.sess .ops { display: flex; gap: 6px; flex-shrink: 0; }
.sess .ops button { padding: 8px 12px; font-size: 12.5px; border-radius: 8px; }
.btn-use { background: var(--brand); color: #fff; }
.btn-use:hover { filter: brightness(1.08); }
.btn-del { background: #f1f2f7; color: #6b7086; }
.btn-del:hover { background: #fdeaea; color: var(--danger); }
.badge {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 7px;
    border-radius: 20px;
    font-size: 10.5px;
    font-weight: 600;
    color: #fff;
    background: var(--brand);
    vertical-align: 1px;
}
.empty { font-size: 13px; color: var(--muted); padding: 8px 2px; }

.note {
    margin-top: 18px;
    padding: 12px 14px;
    border-radius: 11px;
    background: #fffaf0;
    border: 1px solid #f4e6c8;
    font-size: 12.5px;
    color: #8a6f2b;
    line-height: 1.75;
}

/* ============ 移动端 ============ */
@media (max-width: 560px) {
    .topbar { padding: 12px 14px; }
    .brand { font-size: 13.5px; }
    .hero { padding: 6vh 16px 10vh; }
    .hero-logo { font-size: 28px; }
    .hero-sub { font-size: 12.5px; margin-bottom: 24px; }
    .search input { height: 50px; padding: 0 16px; font-size: 15px; }
    .search-btn { height: 38px; padding: 0 16px; font-size: 14px; }
    .action-hint { font-size: 12px; margin-top: 10px; }
    .shortcuts { margin-top: 26px; gap: 8px; }
    .shortcut { padding: 8px 13px; font-size: 12.5px; }
    .lock-card { padding: 28px 22px 22px; }
    .sess { flex-wrap: wrap; }
    .sess .ops { width: 100%; }
    .sess .ops button { flex: 1 1 0; }
}
@media (max-width: 360px) {
    .hero-logo { font-size: 24px; }
    .engine { padding: 6px 12px; font-size: 12.5px; }
}
