.appearance-choices{display:grid;grid-template-columns:repeat(auto-fit,minmax(160px,1fr));gap:16px;margin:20px 0}.appearance-choice{display:flex;flex-direction:column;gap:12px;padding:18px;text-align:left;border:2px solid transparent;border-radius:18px;background:var(--primary-soft,#f1f5f9);color:var(--text,#172337)}.appearance-choice[aria-pressed=true]{border-color:var(--primary,#2563eb);box-shadow:0 8px 24px #2563eb15}.appearance-choice small{line-height:1.5;color:var(--muted)}.layout-miniature{height:72px;width:100%;border-radius:8px;background:repeating-linear-gradient(0deg,#9babc333 0 14px,transparent 14px 19px);border-left:26px solid #7f91b066}.appearance-choice[data-preview=focus] .layout-miniature{border:0;border-top:30px solid #7f91b066}.appearance-choice[data-preview=board] .layout-miniature{border:0;background:repeating-linear-gradient(90deg,#7f91b066 0 26%,transparent 26% 33%)}.appearance-choice[data-preview=compact] .layout-miniature{border-left:12px solid #7f91b066;background:repeating-linear-gradient(0deg,#9babc333 0 5px,transparent 5px 10px)}.appearance-current img,.appearance-current video{width:100%;max-height:260px;object-fit:contain;margin-top:20px;border-radius:14px}.appearance-check{display:flex;gap:10px;align-items:center;margin:14px 0}.appearance-check input{width:auto}
.layout-dropdown>#layoutBtn{height:42px;min-width:112px;padding:0 14px;font:inherit;font-size:13px}.layout-dropdown .dropdown-menu{min-width:150px}.layout-dropdown .dropdown-menu button{width:100%;text-align:left}.layout-dropdown .dropdown-menu button.active{color:var(--primary);background:color-mix(in srgb,var(--primary) 12%,transparent);font-weight:700}.user-menu-header{display:block!important;padding:16px!important}.user-head-row{display:flex;align-items:flex-start;gap:13px}.user-head-avatar{width:68px;flex:0 0 68px;text-align:center}.user-head-text{min-width:0;flex:1;padding-top:3px}.user-menu-header .avatar{width:64px!important;height:64px!important}.user-menu-header .uaffiliation{font-size:11px;line-height:1.5;margin-top:3px;color:var(--primary);white-space:normal;overflow-wrap:anywhere}.user-menu-header .ubio{font-size:12px;line-height:1.5;margin-top:10px;white-space:normal;overflow-wrap:anywhere;color:var(--muted)}
#personalBackdrop{position:fixed;inset:0;z-index:-1;width:100%;height:100%;object-fit:cover;pointer-events:none}body.has-personal-backdrop{background:transparent}body.has-personal-backdrop .content{background:transparent}body.has-personal-backdrop .section{background:color-mix(in srgb,var(--card-bg,#fff) 92%,transparent);backdrop-filter:blur(14px)}
body[data-layout=focus] .cards-sections{max-width:1320px;margin:34px auto 0}body[data-layout=focus] .carousel-area{height:380px}body[data-layout=focus] .cards-sections>.section{padding:28px;border:0;border-radius:28px;margin-bottom:28px}body[data-layout=focus] #cards .cards{grid-template-columns:repeat(4,minmax(0,1fr));gap:18px}
body[data-layout=board] .cards-sections{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:22px;align-items:start;padding-top:28px}body[data-layout=board] .cards-sections>.section{min-width:0;padding:20px;margin:0;border:0;border-radius:22px;box-shadow:0 8px 30px #1a2c4c0a;overflow:hidden}body[data-layout=board] #cards .cards{display:grid;grid-template-columns:1fr;gap:10px}body[data-layout=board] #cards .card{width:auto;min-width:0;max-width:none}body[data-layout=board] .cat-tabs{overflow:auto;flex-wrap:nowrap}body[data-layout=board] .cat-tabs>*{flex-shrink:0}
body[data-layout=compact] .cards-sections{max-width:1500px;margin:20px auto}body[data-layout=compact] #cards .cards{grid-template-columns:repeat(2,minmax(0,1fr));gap:7px 16px}body[data-layout=compact] #cards .card{display:grid;grid-template-columns:48px minmax(0,1fr);padding:10px 13px;min-height:0;border-radius:10px;align-items:center}body[data-layout=compact] .card .card-logo{grid-column:1;grid-row:1}body[data-layout=compact] .card .card-content{grid-column:2;min-width:0}body[data-layout=compact] .card .card-desc{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}body[data-layout=compact] .card .card-actions{margin-top:5px;border:0;padding:0;justify-content:flex-start}body[data-layout=compact] .cards-sections>.section{padding:15px;margin-bottom:12px}body[data-layout=compact] .carousel-area{height:210px}
.quick-add-main{max-width:720px;margin:32px auto;padding:20px}.quick-add-main label{display:grid;gap:8px}.quick-add-main .panel{border:0;border-radius:24px;box-shadow:0 14px 50px #1b294315}
.account-switch-row{padding:10px;border-radius:12px;background:var(--primary-soft);align-items:center}.account-switch-row img{width:38px;height:38px;object-fit:cover;border-radius:50%}.account-switch-row small{display:block;color:var(--muted);margin-top:3px}
.profile-panel{max-width:880px}.profile-hero{display:grid;grid-template-columns:150px minmax(0,1fr);gap:28px;align-items:start;margin:22px 0}.profile-avatar-edit{position:relative;width:132px;height:132px;border-radius:50%;overflow:hidden;cursor:pointer;display:block}.profile-avatar-edit img{width:100%;height:100%;object-fit:cover}.profile-avatar-edit span{position:absolute;left:50%;top:50%;min-width:34px;height:28px;padding:0 8px;display:grid;place-items:center;transform:translate(-50%,-50%);border-radius:7px;background:#a85814e8;color:#fff;text-align:center;font-size:17px;box-shadow:0 3px 12px #30150055;opacity:.94;transition:.18s}.profile-avatar-edit:hover span,.profile-avatar-edit:focus-within span{transform:translate(-50%,-50%) scale(1.08);background:#c56a18;opacity:1}.profile-summary{display:grid;gap:7px;padding-top:10px;color:var(--muted);font-size:13px}.profile-summary strong{font-size:20px;color:var(--text)}.profile-summary .profile-affiliation,.security-account-meta .profile-affiliation{color:var(--primary);font-weight:600}.profile-fields{gap:18px}.profile-name-grid{max-width:720px}.profile-name-grid input{border:1px solid var(--border);box-shadow:none}.security-account-summary{display:flex;align-items:center;gap:16px;flex-wrap:wrap}.security-account-summary>img{width:72px;height:72px;border-radius:50%;object-fit:cover;border:2px solid var(--border)}.security-account-meta{display:grid;gap:5px;flex:1;color:var(--muted);font-size:13px}.security-account-meta strong{font-size:18px;color:var(--text)}.location-picker-field{display:flex;gap:8px;align-items:center}.location-picker-field>input{flex:1}.location-picker-shade{position:fixed;inset:0;z-index:10050;background:#0d162d99;display:grid;place-items:center;padding:16px}.location-picker-modal{width:min(620px,96vw);max-height:86vh;overflow:auto;background:var(--card-bg,#ffffff);color:var(--text,#1f2937);border:1px solid var(--border,#e5e7eb);border-radius:20px;padding:20px;box-shadow:0 24px 80px #07122566}.location-picker-head{display:flex;justify-content:space-between;align-items:center;margin-bottom:14px}.location-picker-head strong{font-size:18px}.location-picker-tree{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin:12px 0}.location-picker-tree label{display:grid;gap:7px}.location-search-results{display:grid;gap:5px;max-height:170px;overflow:auto;margin-top:6px}.location-result{border:1px solid var(--border,#e5e7eb);background:var(--bg,#f6f8fb);color:var(--text,#1f2937);padding:8px 10px;text-align:left;border-radius:9px;cursor:pointer}.location-result:hover{background:var(--primary-soft,rgba(37,99,235,.1));border-color:var(--primary,#2563eb)}
@media(max-width:1200px){body[data-layout=board] .cards-sections{grid-template-columns:repeat(2,minmax(0,1fr))}body[data-layout=focus] #cards .cards{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:767px){.layout-dropdown>#layoutBtn{min-width:66px;max-width:76px;padding:0 7px;height:36px;font-size:11px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.info.top-info{gap:4px!important}.info.top-info #themeDropdown{display:none}.cards-sections>.section{padding:18px 12px!important;border:0!important;border-radius:20px;box-shadow:0 6px 24px #1d324809}body[data-layout=board] .cards-sections{display:block}body[data-layout=board] .cards-sections>.section{margin-bottom:16px}body[data-layout=compact] #cards .cards{grid-template-columns:1fr}body[data-layout=compact] #cards .card{display:block;padding:10px!important}body[data-layout=focus] .carousel-area{height:300px!important}body[data-layout=focus] #cards .cards{grid-template-columns:1fr}.quick-add-main{margin:0;padding:12px}.quick-add-main .panel{border-radius:18px;padding:18px}.profile-hero{grid-template-columns:1fr;justify-items:center}.profile-summary{width:100%}.profile-fields .grid-2{grid-template-columns:1fr}.profile-avatar-edit{width:116px;height:116px}}
.location-picker-modal>[data-search]{width:100%}.location-picker-tree [hidden]{display:none!important}

/* ===== 头像更换按钮：鼠标悬浮时铺满整个头像框 ===== */
.profile-avatar-edit span{position:absolute;inset:0;display:grid;place-items:center;border-radius:50%;background:rgba(15,23,42,.45);color:#fff;font-size:30px;line-height:1;opacity:0;transition:opacity .18s ease;min-width:0;height:auto;padding:0;transform:none;box-shadow:none;pointer-events:none}
.profile-avatar-edit:hover span,.profile-avatar-edit:focus-within span{opacity:1;background:rgba(15,23,42,.5);transform:none}
/* 头像下拉菜单：长邮箱自动换行完整显示 */
#userMenu .uemail,.user-menu-header .uemail{white-space:normal!important;overflow:visible!important;text-overflow:clip!important;overflow-wrap:anywhere;word-break:break-all;max-width:100%!important;line-height:1.45}
.user-menu-header .uaffiliation{white-space:normal;overflow-wrap:anywhere}

/* ===========================================================================
   移动端横向溢出加固（2026-09-10）
   背景：窄屏下顶栏（☰ / 🌐中文 / 布局 / 主题 / 头像）在 768–1000px 区间仍走桌面宽度，
   加上各控件 min-width 相加超屏宽 → 整页被撑宽，右侧内容被裁掉（用户截图）。
   这里放在**最后加载**的样式表里，做兜底收敛。
=========================================================================== */
html { overflow-x: hidden; }
/* body 上不能再写 overflow-x:hidden —— 它会把 body 变成「滚动容器」（overflow-y 被算成 auto），
   导致 body 内所有 position:sticky 的子孙（.sidebar 左侧导航、.info.top-info 顶部栏）
   改为相对 body 的滚动端口定位，而真正滚动的是 html —— 表现就是「粘不住、跟着整页滚」。
   横向裁剪统一交给 html（其 overflow 会传播到视口）。 */
body { max-width: 100%; }

/* 顶栏改为自动高度：flex-wrap:wrap 生效后不会被固定 60px 裁掉第二行 */
.info.top-info { height: auto !important; min-height: 60px; row-gap: 6px; padding-top: 6px; padding-bottom: 6px; }
.infotop, .info.top-info > * { min-width: 0; }

@media (max-width: 1000px) {
  /* 这一区间 desktop 规则仍在生效：把三个宽控件一起收窄，避免相加超屏 */
  .info.top-info #langBtn   { width: auto !important; min-width: 0 !important; max-width: 104px; }
  .info.top-info #pageBtn   { width: auto !important; min-width: 0 !important; max-width: 96px; }
  .info.top-info #themeSwitch { width: auto !important; min-width: 0 !important; max-width: 96px; }
  .info.top-info > #toggleSidebar { width: 38px !important; min-width: 38px !important; }
  .layout-dropdown > #layoutBtn { width: auto !important; min-width: 0 !important; max-width: 108px; }
  /* 内容容器一律不得超出视口 */
  #app, .content, .container, .cards-sections, .carousel-area, .search-area, #mainSearchWrap { max-width: 100%; box-sizing: border-box; }
}

@media (max-width: 767px) {
  /* 顶栏在小屏允许换行，各控件不再保底宽度 */
  .info.top-info { flex-wrap: wrap !important; gap: 6px !important; padding-left: 8px !important; padding-right: 8px !important; }
  .info.top-info > #toggleSidebar,
  .info.top-info > .dropdown > .ghost { width: auto !important; min-width: 34px !important; padding: 0 9px !important; }
  .info.top-info #langBtn,
  .info.top-info #pageBtn,
  .info.top-info #themeSwitch,
  .layout-dropdown > #layoutBtn { min-width: 0 !important; max-width: 92px !important; }
  /* 小屏隐藏次要入口，给搜索/头像让位（与既有 responsive 规则保持一致） */
  .info.top-info #themeDropdown { display: none !important; }
  /* 轮播 / 天气卡按容器宽度收缩 */
  .carousel-area, .carousel-area > *, .cw-forecast { max-width: 100% !important; box-sizing: border-box; }
  /* 宽表格统一在自身容器内滚动，不撑破页面 */
  .table-wrap, .data-table, table { max-width: 100%; }
  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  /* 万能兜底：所有多媒体与长文本不得溢出 */
  img, video, canvas, iframe, svg { max-width: 100%; }
  pre, code { overflow-wrap: anywhere; white-space: pre-wrap; }
}
