html, body {
    height: 100%;
    margin: 0;
    padding: 0;
}
body {
    min-height: 100vh;
    background: #f5f6f8;
    font-family: 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Arial', sans-serif;
    color: #1f2937;
}
ul, ol { list-style: none; }
ins, a { text-decoration: none; }

/* ── Top header ── */
.top-header {
    width: 100%;
    /*background: #fff;*/
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    /*box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);*/
    background: #3A6EA5;
    color: #fff;
    text-shadow: 1px 1px rgba(0, 0, 0, .5);
}
.top-header-inner {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    box-sizing: border-box;
}
.top-logo {
    font-size: 18px;
    font-weight: 700;
    /*color: #1e90ff;*/
    color: #bdcedf;
}
.top-nav nav { display: inline-block; }
.top-nav ul {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin: 0;
    padding: 0;
}
.top-nav li { list-style: none; }
.top-nav a {
    /*color: #4b5563;*/
    color: #bdcedf;
    font-size: 13px;
    padding: 6px 10px;
    border-radius: 8px;
    transition: background 0.15s, color 0.15s;
}
.top-nav a:hover,
.top-nav a.active {
    background: rgba(30, 144, 255, 0.08);
    /*color: #1e90ff;*/
    color: #ffffff;
}

/* ── 顶栏导航行 + 语言切换 ── */
.top-nav-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    width: 100%;
}
.top-nav-links {
    display: flex;
    gap: 0;
    list-style: none;
    margin: 0;
    padding: 0;
}
.lang-switch { position: relative; flex-shrink: 0; }
.lang-switch-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border: 1px solid rgba(189, 206, 223, 0.35);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    color: #bdcedf;
    font-size: 13px;
    cursor: pointer;
    line-height: 1.2;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.lang-switch-btn:hover,
.lang-switch.open .lang-switch-btn {
    background: rgba(30, 144, 255, 0.12);
    color: #fff;
    border-color: rgba(30, 144, 255, 0.35);
}
.lang-switch-icon { font-size: 14px; opacity: 0.9; }
.lang-switch-caret { font-size: 10px; opacity: 0.7; transition: transform 0.15s; }
.lang-switch.open .lang-switch-caret { transform: rotate(180deg); }
.lang-switch-menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 168px;
    max-height: 280px;
    overflow-y: auto;
    margin: 0;
    padding: 6px;
    list-style: none;
    background: #1f2937;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
    z-index: 200;
}
.lang-switch-menu[hidden] { display: none; }
.lang-switch-item {
    display: block;
    width: 100%;
    text-align: left;
    padding: 8px 12px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: #e5e7eb;
    font-size: 13px;
    cursor: pointer;
}
.lang-switch-item:hover { background: rgba(255, 255, 255, 0.08); }
.lang-switch-item.is-active {
    background: rgba(30, 144, 255, 0.2);
    color: #93c5fd;
    font-weight: 600;
}
[dir="rtl"] .lang-switch-menu { right: auto; left: 0; }
[dir="rtl"] .lang-switch-item { text-align: right; }
@media (max-width: 640px) {
    .lang-switch-current,
    .lang-switch-caret { display: none; }
    .lang-switch-btn { padding: 8px 10px; border-radius: 10px; }
}

/* ── App shell：Dock 贴左 + 主内容区 ── */
.app-shell {
    display: flex;
    min-height: calc(100vh - 49px);
    width: 100%;
}

.app-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.main-layout {
    flex: 1;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 12px 20px 24px;
    box-sizing: border-box;
}

/* ── Sidebar Dock（贴左缘全高） ── */
.sidebar {
    width: 76px;
    min-width: 76px;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px 0 8px;
    box-sizing: border-box;
    border-right: 1px solid rgba(0, 0, 0, 0.06);
    box-shadow: 2px 0 12px rgba(0, 0, 0, 0.04);
    position: sticky;
    top: 49px;
    align-self: flex-start;
    height: calc(100vh - 49px);
    border-radius: 0;
    max-height: none;
}
.sidebar .nav {
    flex: 1;
    width: 100%;
    overflow-y: auto;
    overflow-x: hidden;
}
.sidebar .nav-item {
    width: 100%;
    color: #6b7280;
    text-align: center;
    padding: 10px 4px 6px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    font-size: 11px;
    border-left: 3px solid transparent;
    box-sizing: border-box;
}
.sidebar .nav-item.active {
    background: rgba(30, 144, 255, 0.08);
    color: #1e90ff;
    border-left-color: #1e90ff;
    font-weight: 600;
}
.sidebar .nav-item:hover:not(.active) {
    background: rgba(0, 0, 0, 0.03);
    color: #374151;
}
.sidebar .nav-item i {
    display: block;
    font-size: 17px;
    margin-bottom: 3px;
}
.sidebar .sidebar-bottom {
    width: 100%;
    padding-top: 6px;
    display: flex;
    flex-direction: column;
    align-items: center;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}
.sidebar .sidebar-bottom button {
    width: 36px;
    height: 36px;
    margin: 4px 0;
    border: none;
    border-radius: 10px;
    background: rgba(30, 144, 255, 0.08);
    color: #1e90ff;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.15s;
}
.sidebar .sidebar-bottom button:hover {
    background: rgba(30, 144, 255, 0.16);
}

/* ── Content ── */
.content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.content-main {
    display: flex;
    flex-direction: column;
    align-items: center;
    /*background: rgba(255, 255, 255, 0.75);*/
    /*border-radius: 16px;*/
    /*padding: 16px 16px 20px;*/
    /*box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);*/
    /*border: 1px solid rgba(0, 0, 0, 0.04);*/
}
.content-extra {
    width: 100%;
    margin: 16px auto 0;
    padding: 14px 16px;
    box-sizing: border-box;
    background: rgba(255, 255, 255, 0.85);
    border-radius: 14px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(0, 0, 0, 0.04);
}
.content-extra dl { margin: 0 0 8px 0; }
.content-extra dt {
    font-weight: 600;
    margin-bottom: 4px;
    color: #374151;
    font-size: 14px;
}
.content-extra dd {
    margin: 0;
    color: #6b7280;
    font-size: 13px;
}
.content-extra a { color: #1e90ff; }

/* ── Clock & search ── */
.clock {
    color: #111827;
    font-size: 28px;
    font-weight: 600;
    margin-top: 8px;
    letter-spacing: 1px;
}
.date {
    color: #6b7280;
    font-size: 14px;
    margin-bottom: 16px;
}
.search-bar {
    width: 100%;
    max-width: 100%;
    background: #fff;
    border-radius: 16px;
    display: flex;
    align-items: flex-start;
    padding: 8px 12px 8px 16px;
    margin: 0 auto 20px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(0, 0, 0, 0.06);
    box-sizing: border-box;
}
.search-bar textarea {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    font-size: 16px;
    padding: 8px 0;
    font-family: inherit;
    min-height: 56px;
    line-height: 1.5;
    color: #1f2937;
    resize: vertical;
}
.search-bar textarea::placeholder {
    font-size: 14px;
    color: #9ca3af;
}
.search-bar .search-btn {
    background: none;
    border: none;
    font-size: 22px;
    color: #1e90ff;
    cursor: pointer;
    padding: 8px 4px 0;
    flex-shrink: 0;
}

/* ── Site panels (home groups) ── */
.site-list {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
}
.site-panel {
    margin-bottom: 6px;
    padding: 8px 12px;
    background: #fff;
    border-radius: 10px;
    border: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.03);
}
.site-panel-row {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    padding: 6px 10px;
    margin-bottom: 5px;
}
.site-panel-ai {
    background: linear-gradient(135deg, #faf8ff 0%, #f3f0ff 100%);
    border-color: rgba(99, 102, 241, 0.12);
}
.site-panel-title {
    font-size: 12px;
    font-weight: 600;
    color: #6b7280;
    margin: 0;
    padding: 0 10px 0 0;
    border-bottom: none;
    letter-spacing: 0.02em;
    line-height: 1.35;
    flex-shrink: 0;
    width: 4.5em;
    text-align: right;
    align-self: center;
    border-right: 1px solid rgba(0, 0, 0, 0.06);
}
.site-panel-row .site-panel-title {
    padding-top: 6px;
    padding-bottom: 6px;
}
.site-panel-ai .site-panel-title {
    color: #6366f1;
}
.site-panel-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    flex: 1;
    min-width: 0;
    padding-left: 10px;
    align-items: center;
}

/* ── Site cards v2 ── */
.site-card {
    width: 72px;
    min-height: 76px;
    /*background: #fff;*/
    /*border: 1px solid rgba(0, 0, 0, 0.07);*/
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    transition: box-shadow 0.15s, transform 0.15s, border-color 0.15s;
    user-select: none;
    padding: 8px 4px 6px;
    box-sizing: border-box;
}
.site-card:hover {
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
    border-color: rgba(30, 144, 255, 0.25);
}
.site-card .site-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 6px;
    overflow: hidden;
    flex-shrink: 0;
}
.site-card .site-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.site-card .site-icon-letter {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    border-radius: 8px;
}
.site-card .site-name {
    font-size: 11px;
    color: #374151;
    text-align: center;
    line-height: 1.25;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}
.site-card.add {
    /*background: rgba(30, 144, 255, 0.04);*/
    /*border: 1px dashed rgba(30, 144, 255, 0.35);*/
    color: #1e90ff29;
    min-height: 66px;
}
.site-card.add:hover {
    background: rgba(30, 144, 255, 0.08);
}
.site-card.add.site-card-add-light {
    background: rgba(30, 144, 255, 0.02);
    border: 1px dashed rgba(30, 144, 255, 0.2);
    color: rgba(30, 144, 255, 0.55);
}
.site-card.add.site-card-add-light:hover {
    background: rgba(30, 144, 255, 0.06);
    color: #1e90ff;
}
.site-card-sm {
    width: 52px;
    min-height: 46px;
    padding: 4px 2px 3px;
    border-radius: 10px;
}
.site-card-sm .site-icon {
    width: 26px;
    height: 26px;
    margin-bottom: 3px;
    border-radius: 6px;
}
.site-card-sm .site-icon-letter {
    font-size: 12px;
}
.site-card-sm .site-name {
    font-size: 10px;
    line-height: 1.15;
    -webkit-line-clamp: 2;
}
.site-card-sm.add {
    min-height: 46px;
}
.site-card-md {
    width: 64px;
    min-height: 58px;
    padding: 6px 4px 4px;
    border-radius: 11px;
}
.site-card-md .site-icon {
    width: 30px;
    height: 30px;
    margin-bottom: 4px;
    border-radius: 7px;
}
.site-card-md .site-icon-letter {
    font-size: 14px;
}
.site-card-md .site-name {
    font-size: 11px;
    line-height: 1.25;
    -webkit-line-clamp: 2;
}
.site-card-md.add {
    min-height: 58px;
}
.site-card-lg {
    width: 72px;
    min-height: 76px;
    padding: 8px 6px 6px;
}
.site-card-lg .site-icon {
    width: 36px;
    height: 36px;
    margin-bottom: 6px;
}
.site-card-lg .site-icon-letter {
    font-size: 16px;
}
.site-card-lg .site-name {
    font-size: 12px;
}
.site-card-lg.add {
    min-height: 76px;
}

.setting-section-more {
    margin: 12px 0;
    padding: 10px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: #fafafa;
}
.setting-section-more > summary {
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    color: #374151;
    user-select: none;
}
.setting-section-more[open] > summary {
    margin-bottom: 10px;
}

.home-panels-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.home-panel-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 4px 0;
}
.home-panel-btns {
    display: flex;
    gap: 4px;
}
.home-panel-btns .btn-secondary {
    padding: 4px 10px;
    min-width: 32px;
}
.home-panel-btns .btn-panel-edit,
.home-panel-btns .btn-panel-del {
    padding: 4px 8px;
    min-width: 28px;
}
.home-panel-btns .btn-panel-del {
    color: #dc2626;
}
.home-panel-btns .btn-panel-del:hover {
    background: #fef2f2;
}
.home-panel-add-btn {
    margin-top: 8px;
    width: 100%;
}
.site-card.custom-bg .site-name {
    color: inherit;
}

/* Enter 默认搜索：极浅高亮，与其它卡片可区分但不抢眼 */
.site-card.site-card-enter-default {
    background: rgba(30, 144, 255, 0.04);
    box-shadow: inset 0 0 0 1px rgba(30, 144, 255, 0.13);
}
.site-card.site-card-enter-default:hover {
    background: rgba(30, 144, 255, 0.06);
    box-shadow: inset 0 0 0 1px rgba(30, 144, 255, 0.2), 0 6px 16px rgba(0, 0, 0, 0.08);
}
.site-card.site-card-enter-default.custom-bg {
    /* 若用户自定义整卡背景，仍保留 Enter 默认的浅描边 */
    box-shadow: inset 0 0 0 1px rgba(30, 144, 255, 0.18);
}

/* Non-home category flat grid */
.site-list-flat {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-start;
    max-width: 680px;
    margin: 0 auto;
}

/* ── Skills hub（导入导出 AI Skills） ── */
.skills-hub {
    width: 100%;
    box-sizing: border-box;
}
.content-extra .skills-hub {
    margin: 14px 0 0;
    padding: 14px 0 0;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 0;
    background: none;
}
.skills-hub-title {
    margin: 0 0 8px;
    font-size: 14px;
    font-weight: 700;
    color: #111827;
}
.skills-hub-title i {
    color: #1e90ff;
    margin-right: 6px;
}
.skills-hub-intro {
    margin: 0 0 10px;
    font-size: 13px;
    line-height: 1.65;
    color: #6b7280;
}
.skills-hub-steps {
    margin: 0 0 12px 18px;
    padding: 0;
    font-size: 12px;
    color: #6b7280;
    line-height: 1.6;
}
.skills-hub-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
}
.skills-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 10px;
    font-size: 13px;
    cursor: pointer;
    border: 1px solid rgba(0, 0, 0, 0.08);
    background: #fff;
    color: #374151;
    text-decoration: none;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
    box-sizing: border-box;
}
.skills-btn:hover {
    border-color: rgba(30, 144, 255, 0.25);
    color: #1e90ff;
}
.skills-btn-primary {
    background: #1e90ff;
    border-color: #1e90ff;
    color: #fff;
}
.skills-btn-primary:hover {
    background: #1873cc;
    border-color: #1873cc;
    color: #fff;
}
.skills-hub-note {
    margin: 0;
    font-size: 11px;
    color: #9ca3af;
    line-height: 1.5;
}

.skills-doc-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(0, 0, 0, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}
.skills-doc-dialog {
    width: min(720px, 100%);
    max-height: min(80vh, 640px);
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.skills-doc-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 1px solid #eee;
}
.skills-doc-header h4 {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: #374151;
}
.skills-doc-close {
    border: none;
    background: none;
    font-size: 22px;
    line-height: 1;
    color: #9ca3af;
    cursor: pointer;
    padding: 4px 8px;
}
.skills-doc-close:hover {
    color: #374151;
}
.skills-doc-body {
    margin: 0;
    padding: 16px 18px;
    overflow: auto;
    font-size: 12px;
    line-height: 1.6;
    color: #374151;
    white-space: pre-wrap;
    word-break: break-word;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    background: #fafafa;
}

/* ── Service hub（保留供其它页引用） ── */
.service-hub {
    width: 100%;
    max-width: 100%;
    margin: 8px auto 0;
    padding-top: 16px;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}
.service-hub-title {
    font-size: 12px;
    font-weight: 600;
    color: #9ca3af;
    margin: 0 0 10px 2px;
}
.service-hub-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}
.service-card {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: #fff;
    border-radius: 12px;
    border: 1px solid rgba(0, 0, 0, 0.06);
    color: #374151;
    font-size: 13px;
    transition: box-shadow 0.15s, border-color 0.15s;
    box-sizing: border-box;
}
.service-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
    border-color: rgba(30, 144, 255, 0.2);
    color: #1e90ff;
}
.service-card i {
    font-size: 16px;
    color: #1e90ff;
    width: 20px;
    text-align: center;
}

/* ── PS bar ── */
.ps-bar {
    width: 100%;
    padding: 8px 12px 4px;
    font-size: 12px;
}
.ps-bar-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 10px 14px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: 12px;
}
.ps-text {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    line-height: 1.45;
    color: #6b7280;
}
.ps-icon { color: #1e90ff; font-size: 14px; }
.ps-text span + span::before {
    content: "•";
    color: #d1d5db;
    margin: 0 8px 0 2px;
}
.ps-close {
    border: none;
    background: rgba(0, 0, 0, 0.04);
    color: #6b7280;
    cursor: pointer;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.ps-close:hover { background: rgba(0, 0, 0, 0.08); }

/* ── Dialog overlay ── */
.dialog-overlay {
    position: fixed;
    left: 0;
    top: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 16px;
    box-sizing: border-box;
}
.setting-dialog {
    background: #fff;
    padding: 20px 22px 16px;
    border-radius: 16px;
    min-width: 320px;
    max-width: 420px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    gap: 12px;
    box-sizing: border-box;
}
.setting-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.setting-header h3 { margin: 0; font-size: 18px; }
.setting-close {
    border: none;
    background: transparent;
    cursor: pointer;
    color: #9ca3af;
    font-size: 18px;
    padding: 4px;
}
.setting-close:hover { color: #374151; }
.setting-section {
    padding: 10px 0;
    border-top: 1px solid #f3f4f6;
}
.setting-section:first-of-type { border-top: none; }
.setting-section-title {
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 8px;
    font-weight: 600;
}
.setting-note {
    font-size: 12px;
    color: #9ca3af;
    line-height: 1.5;
    margin: 0;
}
.setting-note + .setting-note {
    margin-top: 6px;
}
.setting-note-muted {
    font-size: 11px;
    color: #b0b7c3;
}
.home-panel-lock {
    font-size: 10px;
    color: #b0b7c3;
    font-weight: 400;
}
.setting-radio {
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 4px 0;
    cursor: pointer;
}
.setting-form label {
    display: block;
    font-size: 13px;
    color: #374151;
    margin-bottom: 10px;
}
.setting-form input[type="text"] {
    width: 100%;
    padding: 8px 10px;
    font-size: 14px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-sizing: border-box;
    margin-top: 4px;
}
.setting-form input[type="text"]:focus {
    outline: none;
    border-color: #1e90ff;
}
.setting-form-advanced {
    border-top: 1px dashed #e5e7eb;
    padding-top: 10px;
    margin-top: 4px;
}
.setting-form-advanced summary {
    cursor: pointer;
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 8px;
}
.bg-thumb-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    max-height: 80px;
    overflow: auto;
}
.bg-thumb {
    width: 60px;
    height: 36px;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    position: relative;
}
.bg-thumb-checked {
    position: absolute;
    right: 2px;
    top: 2px;
    background: #1e90ff;
    color: #fff;
    font-size: 11px;
    border-radius: 50%;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.setting-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 4px;
}
.setting-footer-left,
.setting-footer-right {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.btn-primary, .btn-secondary, .btn-danger-light {
    padding: 7px 14px;
    border-radius: 8px;
    font-size: 13px;
    cursor: pointer;
    border: none;
    white-space: nowrap;
}
.btn-primary { background: #1e90ff; color: #fff; }
.btn-secondary { background: #f3f4f6; color: #374151; }
.btn-danger-light { background: #fef2f2; color: #dc2626; }
.btn-primary:hover { background: #1875cc; }
.btn-secondary:hover { background: #e5e7eb; }
.btn-danger-light:hover { background: #fee2e2; }

/* ── Context menu ── */
.ctx-menu {
    position: fixed;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.15);
    padding: 6px 0;
    z-index: 10001;
    min-width: 160px;
    border: 1px solid rgba(0, 0, 0, 0.06);
}
.ctx-menu button {
    width: 100%;
    background: none;
    border: none;
    padding: 10px 16px;
    text-align: left;
    font-size: 14px;
    cursor: pointer;
    color: #374151;
    display: flex;
    align-items: center;
    gap: 10px;
}
.ctx-menu button i { width: 16px; color: #6b7280; }
.ctx-menu button:hover { background: #f9fafb; }
.ctx-menu button.ctx-del { color: #dc2626; }
.ctx-menu button.ctx-del i { color: #dc2626; }

/* ── Onboarding ── */
.onboard-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 20000;
}
.onboard-spotlight {
    position: fixed;
    border-radius: 12px;
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.45);
    z-index: 20001;
    pointer-events: none;
    transition: all 0.25s ease;
}
.onboard-tooltip {
    position: fixed;
    z-index: 20002;
    background: #fff;
    border-radius: 14px;
    padding: 16px 18px;
    max-width: 280px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
}
.onboard-tooltip h4 {
    margin: 0 0 8px;
    font-size: 15px;
    color: #111827;
}
.onboard-tooltip p {
    margin: 0 0 12px;
    font-size: 13px;
    color: #6b7280;
    line-height: 1.5;
}
.onboard-tooltip .onboard-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}
.onboard-tooltip .onboard-step {
    font-size: 12px;
    color: #9ca3af;
}
.onboard-tooltip a {
    font-size: 12px;
    color: #1e90ff;
}

/* ── Mobile bottom nav ── */
.mobile-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    z-index: 9000;
    padding: 6px 0 calc(6px + env(safe-area-inset-bottom));
    box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.06);
}
.mobile-bottom-nav-inner {
    display: flex;
    justify-content: space-around;
    max-width: 500px;
    margin: 0 auto;
}
.mobile-bottom-nav button {
    background: none;
    border: none;
    padding: 4px 8px;
    font-size: 10px;
    color: #9ca3af;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}
.mobile-bottom-nav button i { font-size: 18px; }
.mobile-bottom-nav button.active { color: #1e90ff; }

footer {
    width: 100%;
    margin-top: 8px;
    font-size: 12px;
    color: #9ca3af;
    padding-bottom: 8px;
}
footer > div { text-align: center; margin: 4px 0; }
footer a { color: #9ca3af; }
footer a:hover { color: #1e90ff; }

@media (max-width: 700px) {
    .app-shell {
        flex-direction: column;
    }
    .main-layout {
        padding: 8px 8px 64px;
    }
    .sidebar {
        display: none;
    }
    .site-panel-row {
        flex-direction: column;
        align-items: stretch;
    }
    .site-panel-row .site-panel-title {
        width: auto;
        text-align: left;
        border-right: none;
        border-bottom: 1px solid rgba(0, 0, 0, 0.05);
        padding: 0 0 6px;
        margin-bottom: 4px;
    }
    .site-panel-grid {
        padding-left: 0;
    }
    .mobile-bottom-nav {
        display: block;
    }
    .content-main {
        padding: 12px 10px 16px;
        border-radius: 12px;
    }
    .clock { font-size: 24px; }
    .search-bar textarea {
        font-size: 15px;
        min-height: 48px;
    }
    .site-card {
        width: 64px;
        min-height: 68px;
    }
    .service-hub-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .service-card {
        font-size: 12px;
        padding: 8px 10px;
    }
    .top-nav a { font-size: 12px; padding: 4px 6px; }
}

@media (min-width: 701px) {
    .sidebar .logo { display: none; }
}
