/* ===================== 主题变量（10 套） ===================== */
:root {
  --radius: 14px;
  --gap: 16px;
  --topbar-h: 68px;
  --per-row: 3;
  --panel-opacity: .9;
  --p-alpha: .5;
}

/* 1 暗夜紫 */
html[data-theme="aurora"] {
  --bg: radial-gradient(1200px 800px at 15% -10%, #2b2a55 0%, transparent 60%),
        radial-gradient(1000px 700px at 110% 10%, #12325e 0%, transparent 55%),
        linear-gradient(160deg, #0d1024 0%, #131735 45%, #0b0e20 100%);
  --panel: rgba(22, 26, 52, .72);
  --panel-border: rgba(255, 255, 255, .08);
  --text: #e8eaf6; --text-dim: #9aa0c3;
  --accent: #7c6cff; --accent-2: #4dd0e1;
  --card-hover: rgba(124, 108, 255, .12);
  --input-bg: rgba(255, 255, 255, .06);
  --shadow: 0 8px 32px rgba(0, 0, 0, .45);
  --glow: 0 0 24px rgba(124, 108, 255, .35);
}
/* 2 极夜黑 */
html[data-theme="night"] {
  --bg: linear-gradient(180deg, #05070d 0%, #0a0f1a 100%);
  --panel: rgba(16, 20, 30, .8);
  --panel-border: rgba(255, 255, 255, .06);
  --text: #e6e9ef; --text-dim: #8b93a7;
  --accent: #00e5a0; --accent-2: #37b6ff;
  --card-hover: rgba(0, 229, 160, .1);
  --input-bg: rgba(255, 255, 255, .05);
  --shadow: 0 8px 32px rgba(0, 0, 0, .6);
  --glow: 0 0 24px rgba(0, 229, 160, .25);
}
/* 3 赛博朋克 */
html[data-theme="cyber"] {
  --bg: radial-gradient(1000px 700px at 80% -10%, rgba(0, 136, 255, .25) 0%, transparent 55%),
        radial-gradient(900px 600px at 0% 110%, rgba(191, 0, 255, .18) 0%, transparent 55%),
        linear-gradient(160deg, #030b1a 0%, #061224 50%, #040a18 100%);
  --panel: rgba(6, 18, 36, .78);
  --panel-border: rgba(0, 240, 255, .14);
  --text: #d9f6ff; --text-dim: #6f93b8;
  --accent: #00f0ff; --accent-2: #bf00ff;
  --card-hover: rgba(0, 240, 255, .1);
  --input-bg: rgba(0, 240, 255, .05);
  --shadow: 0 8px 32px rgba(0, 10, 30, .6);
  --glow: 0 0 24px rgba(0, 240, 255, .35);
}
/* 4 霓虹夜 */
html[data-theme="neon"] {
  --bg: radial-gradient(1000px 700px at 20% -10%, rgba(255, 45, 149, .2) 0%, transparent 55%),
        radial-gradient(900px 700px at 105% 100%, rgba(191, 0, 255, .2) 0%, transparent 55%),
        linear-gradient(160deg, #14061f 0%, #1d0a2e 50%, #0f0518 100%);
  --panel: rgba(29, 12, 46, .78);
  --panel-border: rgba(255, 45, 149, .14);
  --text: #ffe3f2; --text-dim: #b58bb0;
  --accent: #ff2d95; --accent-2: #bf00ff;
  --card-hover: rgba(255, 45, 149, .1);
  --input-bg: rgba(255, 45, 149, .05);
  --shadow: 0 8px 32px rgba(20, 0, 30, .6);
  --glow: 0 0 24px rgba(255, 45, 149, .35);
}
/* 5 矩阵绿 */
html[data-theme="matrix"] {
  --bg: radial-gradient(1000px 700px at 50% -20%, rgba(0, 255, 136, .12) 0%, transparent 60%),
        linear-gradient(180deg, #010a05 0%, #03170c 55%, #010a05 100%);
  --panel: rgba(4, 26, 14, .8);
  --panel-border: rgba(0, 255, 136, .13);
  --text: #d8ffe9; --text-dim: #6fae8b;
  --accent: #00ff88; --accent-2: #00e5ff;
  --card-hover: rgba(0, 255, 136, .08);
  --input-bg: rgba(0, 255, 136, .05);
  --shadow: 0 8px 32px rgba(0, 20, 8, .6);
  --glow: 0 0 24px rgba(0, 255, 136, .3);
}
/* 6 落日余晖 */
html[data-theme="sunset"] {
  --bg: radial-gradient(1100px 700px at 50% -20%, rgba(255, 122, 24, .22) 0%, transparent 55%),
        radial-gradient(900px 700px at 100% 110%, rgba(255, 45, 85, .16) 0%, transparent 55%),
        linear-gradient(165deg, #160a08 0%, #241009 50%, #120705 100%);
  --panel: rgba(38, 18, 12, .78);
  --panel-border: rgba(255, 159, 67, .15);
  --text: #ffe9d9; --text-dim: #c09377;
  --accent: #ff9f43; --accent-2: #ff2d55;
  --card-hover: rgba(255, 159, 67, .1);
  --input-bg: rgba(255, 159, 67, .06);
  --shadow: 0 8px 32px rgba(30, 10, 0, .55);
  --glow: 0 0 24px rgba(255, 159, 67, .3);
}
/* 7 奢华黑金 */
html[data-theme="gold"] {
  --bg: radial-gradient(1000px 700px at 50% -20%, rgba(246, 196, 83, .14) 0%, transparent 55%),
        linear-gradient(180deg, #0b0a06 0%, #17130a 55%, #0b0a06 100%);
  --panel: rgba(28, 23, 12, .8);
  --panel-border: rgba(246, 196, 83, .15);
  --text: #f7ecd2; --text-dim: #ab9a70;
  --accent: #f6c453; --accent-2: #ff8c42;
  --card-hover: rgba(246, 196, 83, .09);
  --input-bg: rgba(246, 196, 83, .05);
  --shadow: 0 8px 32px rgba(20, 15, 0, .6);
  --glow: 0 0 24px rgba(246, 196, 83, .28);
}
/* 8 海洋蓝 */
html[data-theme="ocean"] {
  --bg: linear-gradient(180deg, #4a90d9 0%, #6fb3e8 40%, #a8d4f0 100%);
  --panel: rgba(255, 255, 255, .82);
  --panel-border: rgba(255, 255, 255, .65);
  --text: #1d2b45; --text-dim: #5b6b8c;
  --accent: #2f7de1; --accent-2: #12b5cb;
  --card-hover: rgba(47, 125, 225, .1);
  --input-bg: rgba(255, 255, 255, .75);
  --shadow: 0 8px 28px rgba(30, 80, 160, .25);
  --glow: 0 0 20px rgba(255, 255, 255, .35);
  --p-alpha: .25;
}
/* 9 樱花粉 */
html[data-theme="sakura"] {
  --bg: linear-gradient(180deg, #ffeef4 0%, #ffdfe9 55%, #fff5f8 100%);
  --panel: rgba(255, 255, 255, .85);
  --panel-border: rgba(255, 255, 255, .7);
  --text: #55283c; --text-dim: #a86f88;
  --accent: #ff5e8a; --accent-2: #b388ff;
  --card-hover: rgba(255, 94, 138, .1);
  --input-bg: rgba(255, 255, 255, .8);
  --shadow: 0 8px 26px rgba(220, 110, 150, .2);
  --glow: 0 0 20px rgba(255, 94, 138, .25);
  --p-alpha: .25;
}
/* 10 薄荷绿 */
html[data-theme="mint"] {
  --bg: linear-gradient(180deg, #ebfaf2 0%, #d8f4e6 55%, #f2fcf7 100%);
  --panel: rgba(255, 255, 255, .85);
  --panel-border: rgba(255, 255, 255, .7);
  --text: #14432e; --text-dim: #5f8a74;
  --accent: #12b76a; --accent-2: #0ea5e9;
  --card-hover: rgba(18, 183, 106, .1);
  --input-bg: rgba(255, 255, 255, .8);
  --shadow: 0 8px 26px rgba(40, 140, 100, .18);
  --glow: 0 0 20px rgba(18, 183, 106, .22);
  --p-alpha: .25;
}
/* 11 简约白 */
html[data-theme="light"] {
  --bg: linear-gradient(180deg, #f2f4fa 0%, #e8ecf6 100%);
  --panel: rgba(255, 255, 255, .9);
  --panel-border: rgba(0, 0, 0, .06);
  --text: #23283b; --text-dim: #7a8199;
  --accent: #5a6cff; --accent-2: #00b3c8;
  --card-hover: rgba(90, 108, 255, .08);
  --input-bg: rgba(0, 0, 0, .04);
  --shadow: 0 6px 24px rgba(60, 70, 120, .12);
  --glow: none;
  --p-alpha: .2;
}

/* ===================== 基础 ===================== */
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  font-family: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  background-attachment: fixed;
  overflow-x: hidden;
}
.bg-layer { position: fixed; inset: 0; z-index: -2; background-size: cover; background-position: center; }
#particleCanvas { position: fixed; inset: 0; z-index: -1; pointer-events: none; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

.glass {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
}

/* ===================== 顶栏 ===================== */
.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  height: var(--topbar-h); padding: 0 22px;
  border-radius: 0; border-left: none; border-right: none; border-top: none;
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 220px; }
.brand-link { display: flex; align-items: center; gap: 10px; text-decoration: none; transition: .2s; }
.brand-link:hover { opacity: .85; transform: translateY(-1px); }
.brand-logo { font-size: 26px; display: flex; align-items: center; }
.brand-logo img { width: 30px; height: 30px; border-radius: 8px; object-fit: cover; }
.brand-name {
  font-size: 19px; font-weight: 800;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  max-width: 340px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.brand-slogan {
  font-size: 12px; color: var(--accent-2); font-weight: 600;
  animation: sloganFlash 2.5s ease-in-out infinite; white-space: nowrap;
}
@keyframes sloganFlash { 0%,100% { opacity: .55; } 50% { opacity: 1; } }

.clock-box { text-align: center; line-height: 1.25; }
.clock-time {
  font-size: 26px; font-weight: 800; letter-spacing: 2px;
  font-variant-numeric: tabular-nums;
  text-shadow: var(--glow);
}
.clock-date { font-size: 12.5px; color: var(--text-dim); }
.clock-date b { color: var(--accent-2); font-weight: 600; }

.top-actions { display: flex; align-items: center; gap: 10px; min-width: 220px; justify-content: flex-end; }
/* 提交网址按钮 */
.submit-btn {
  padding: 7px 14px; border: none; border-radius: 10px; cursor: pointer;
  font-size: 13px; font-weight: 700; color: #fff; white-space: nowrap;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  transition: .18s;
}
.submit-btn:hover { transform: translateY(-2px); box-shadow: var(--glow); }
.icon-btn {
  width: 42px; height: 42px; border-radius: 12px; font-size: 19px;
  background: var(--input-bg); color: var(--text);
  border: 1px solid var(--panel-border); transition: .2s;
}
.icon-btn:hover { transform: translateY(-2px); box-shadow: var(--glow); }

/* 主题选择面板 */
.theme-panel {
  display: none; position: fixed; top: calc(var(--topbar-h) + 6px); right: 18px; z-index: 90;
  width: 240px; padding: 12px;
  background: var(--panel); border: 1px solid var(--panel-border);
  border-radius: var(--radius); backdrop-filter: blur(16px); box-shadow: var(--shadow);
}
.theme-panel.open { display: block; }
.theme-panel .tp-title { font-size: 12px; color: var(--text-dim); font-weight: 700; padding: 2px 6px 10px; }
.tp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.tp-item {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px; border-radius: 10px; cursor: pointer;
  background: var(--input-bg); border: 1px solid transparent;
  font-size: 12.5px; transition: .15s;
}
.tp-item:hover { border-color: var(--accent); }
.tp-item.active { border-color: var(--accent); color: var(--accent); font-weight: 700; }
.tp-dot {
  width: 16px; height: 16px; border-radius: 50%; flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, .25);
}

/* ===================== 搜索区 ===================== */
.hero { display: flex; justify-content: center; padding: 34px 20px 8px; position: relative; z-index: 60; }
.search-wrap {
  position: relative; display: flex; align-items: center;
  width: min(680px, 92vw); height: 54px; padding: 0 6px 0 0; overflow: visible;
}
.search-engine {
  position: relative; display: flex; align-items: center; gap: 4px;
  height: 100%; padding: 0 14px; cursor: pointer; user-select: none;
  color: var(--accent); font-weight: 700; font-size: 14px; white-space: nowrap;
  border-right: 1px solid var(--panel-border);
}
.search-engine .caret { font-size: 11px; color: var(--text-dim); }
.engine-menu {
  display: none; position: absolute; top: calc(100% + 8px); left: 0; z-index: 60;
  background: var(--panel); border: 1px solid var(--panel-border);
  border-radius: 10px; overflow: hidden; min-width: 120px;
  backdrop-filter: blur(14px); box-shadow: var(--shadow);
}
.engine-menu.open { display: block; }
.engine-item { padding: 10px 16px; font-size: 13.5px; color: var(--text); font-weight: 500; }
.engine-item:hover { background: var(--card-hover); }
.engine-item.active { color: var(--accent); }

#searchInput {
  flex: 1; height: 100%; border: none; outline: none; background: transparent;
  color: var(--text); font-size: 15px; padding: 0 12px;
}
#searchInput::placeholder { color: var(--text-dim); }
.search-btn {
  width: 44px; height: 44px; border: none; border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff; font-size: 17px; transition: .2s;
}
.search-btn:hover { transform: scale(1.06); }

.search-results {
  display: none; position: absolute; top: calc(100% + 10px); left: 0; right: 0; z-index: 55;
  max-height: 380px; overflow-y: auto;
  background: var(--panel); border: 1px solid var(--panel-border);
  border-radius: var(--radius); backdrop-filter: blur(16px); box-shadow: var(--shadow);
}
.search-results.open { display: block; }
.sr-item { display: flex; align-items: center; gap: 12px; padding: 11px 16px; transition: .15s; }
.sr-item:hover, .sr-item.active { background: var(--card-hover); }
.sr-item img, .sr-item .sr-letter {
  width: 30px; height: 30px; border-radius: 8px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700; color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  overflow: hidden;
}
.sr-item .sr-letter.has-img { background: transparent; border-radius: 0; }
.sr-item .sr-letter.has-img img { width: 100%; height: 100%; object-fit: contain; }
.sr-item .sr-name { font-size: 14px; font-weight: 600; }
.sr-item .sr-name mark { background: none; color: #ff4d4f; font-weight: 800; }
.sr-item .sr-url { font-size: 12px; color: var(--text-dim); margin-top: 2px; }
.sr-empty { padding: 16px; text-align: center; color: var(--text-dim); font-size: 13px; }

/* ===================== 主体布局 ===================== */
.main {
  display: flex; gap: var(--gap); align-items: flex-start;
  max-width: 1400px; margin: 18px auto 40px; padding: 0 20px;
  position: relative; z-index: 1;
}
.sidebar { width: 230px; flex-shrink: 0; padding: 14px 10px; position: sticky; top: calc(var(--topbar-h) + 14px); }
.side-title { font-size: 13px; font-weight: 700; color: var(--text-dim); padding: 4px 12px 10px; }
.folder-list { list-style: none; max-height: calc(100vh - 190px); overflow-y: auto; }
.folder-list li {
  display: flex; align-items: center; gap: 9px;
  padding: 9px 12px; margin: 2px 4px; border-radius: 10px;
  cursor: pointer; font-size: 14px; transition: .18s;
}
.folder-list li:hover { background: var(--card-hover); }
.folder-list li.active {
  background: linear-gradient(90deg, var(--card-hover), transparent);
  color: var(--accent); font-weight: 700;
  box-shadow: inset 3px 0 0 var(--accent);
}
.folder-list .f-icon { font-size: 15px; width: 20px; text-align: center; display: inline-flex; align-items: center; justify-content: center; }
.folder-list .f-icon svg { width: 16px; height: 16px; display: block; }
.folder-list .f-icon .f-img { width: 16px; height: 16px; object-fit: contain; border-radius: 4px; display: block; }
.folder-list .f-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.folder-list .f-count {
  font-size: 11px; color: var(--text-dim);
  background: var(--input-bg); border-radius: 20px; padding: 1px 8px;
}

.content { flex: 1; min-width: 0; }

/* ===================== 小部件 ===================== */
.widget-row { display: grid; grid-template-columns: 1.4fr 1fr; gap: var(--gap); margin-bottom: var(--gap); }
.widget { padding: 16px 18px; min-height: 130px; }
.widget-loading { color: var(--text-dim); font-size: 13px; padding: 20px 0; text-align: center; }

.weather-widget .w-head { display: flex; align-items: center; justify-content: center; gap: 14px; }
.weather-widget .w-city { font-size: 15px; font-weight: 700; }
.weather-widget .w-temp { font-size: 40px; font-weight: 800; line-height: 1; text-shadow: var(--glow); }
.weather-widget .w-cond { font-size: 13px; color: var(--text-dim); text-align: center; }
.weather-widget .w-cond .w-icon { font-size: 22px; display: block; }
.w-days { display: flex; gap: 4px; margin-top: 14px; }
.w-day { flex: 1; text-align: center; font-size: 12px; color: var(--text-dim); padding: 6px 2px; border-radius: 8px; }
.w-day:hover { background: var(--card-hover); }
.w-day .d-icon { font-size: 17px; display: block; margin: 4px 0; }
.w-day .d-temp { color: var(--text); font-size: 11.5px; }

.holiday-widget .h-main { display: flex; align-items: center; justify-content: center; gap: 14px; text-align: center; }
.holiday-widget .h-count {
  display: flex; align-items: baseline; justify-content: center; gap: 7px;
  margin: 6px 0 2px; font-variant-numeric: tabular-nums;
}
.holiday-widget .h-big {
  font-size: 40px; font-weight: 900; line-height: 1;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.holiday-widget .h-unit { font-size: 16px; font-weight: 700; color: var(--text-dim); }
.holiday-widget .h-label { font-size: 13.5px; font-weight: 700; text-align: center; }
.holiday-widget .h-range { font-size: 12px; color: var(--text-dim); font-weight: 500; }
.holiday-widget .h-range2 { text-align: center; font-size: 12.5px; color: var(--text-dim); margin-top: 2px; letter-spacing: 0.5px; }
.h-list { margin-top: 12px; border-top: 1px dashed var(--panel-border); padding-top: 8px; }
.h-row { display: flex; justify-content: space-between; font-size: 12.5px; padding: 4px 2px; color: var(--text-dim); }
.h-row b { color: var(--text); font-variant-numeric: tabular-nums; }
.h-row .h-days { color: var(--accent-2); font-weight: 700; }

/* ===================== 书签区 ===================== */
.folder-section { margin-bottom: 26px; }
.fs-title {
  display: flex; align-items: center; gap: 9px;
  font-size: 19px; font-weight: 800; margin: 6px 2px 14px;
}
.fs-title .fs-icon { font-size: 20px; display: inline-flex; align-items: center; justify-content: center; }
.fs-title .fs-icon svg { width: 21px; height: 21px; display: block; }
.fs-title .fs-icon .f-img { width: 21px; height: 21px; object-fit: contain; border-radius: 5px; display: block; }
.fs-title .fs-count { font-size: 12px; color: var(--text-dim); font-weight: 500; }

.cards {
  display: grid; gap: 14px;
  grid-template-columns: repeat(var(--per-row), 1fr);
}
.card {
  display: flex; align-items: center; gap: 13px;
  padding: 15px 16px; border-radius: var(--radius);
  background: var(--panel); border: 1px solid var(--panel-border);
  backdrop-filter: blur(12px); box-shadow: var(--shadow);
  transition: transform .18s, box-shadow .18s, border-color .18s;
  overflow: hidden;
}
.card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: var(--glow), var(--shadow);
}
.card-icon {
  width: 42px; height: 42px; border-radius: 11px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 19px; font-weight: 800; color: #fff; overflow: hidden;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}
/* 抓到真实图标后：透明背景，原样显示 */
.card-icon.has-img { background: transparent; border-radius: 6px; }
.card-icon img { width: 100%; height: 100%; object-fit: contain; }
.card-body { min-width: 0; flex: 1; }
.card-name { font-size: 14.5px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.full-title .card-name { white-space: normal; }
.card-desc {
  font-size: 12px; color: var(--text-dim); margin-top: 4px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.card-time { font-size: 11px; color: var(--text-dim); margin-top: 3px; }
.empty-tip { text-align: center; color: var(--text-dim); padding: 60px 0; font-size: 14px; }

.footer { text-align: center; color: var(--text-dim); font-size: 12px; padding: 24px 0 30px; position: relative; z-index: 1; }

/* ===================== 友情链接 ===================== */
.friend-wrap {
  max-width: 1400px; margin: 0 auto; padding: 0 20px;
  position: relative; z-index: 1;
}
.friend-title {
  font-size: 17px; font-weight: 800; margin: 4px 2px 12px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  display: inline-block;
}
/* 电脑端一行 10 个；主标题在上、副标题在下 */
.friend-list { display: grid; grid-template-columns: repeat(10, 1fr); gap: 10px; }
.friend-chip {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; min-width: 0; padding: 10px 6px 9px; border-radius: 12px; text-decoration: none;
  background: var(--panel); border: 1px solid var(--panel-border);
  color: var(--text); font-size: 13px; transition: .18s; text-align: center;
  backdrop-filter: blur(12px);
}
.friend-chip:hover { transform: translateY(-2px); border-color: var(--accent); box-shadow: var(--glow); }
.friend-chip img { width: 20px; height: 20px; object-fit: contain; border-radius: 4px; margin-bottom: 2px; }
.friend-chip .fc-ico { font-size: 15px; line-height: 1.2; margin-bottom: 2px; }
.friend-chip b {
  font-weight: 600; max-width: 100%;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.friend-chip i {
  font-style: normal; font-size: 11px; color: var(--text-dim);
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  line-height: 1.3;
}

/* ===================== 每日一言 ===================== */
.quote-box {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  max-width: min(860px, 92vw); margin: 0 auto; padding: 10px 18px;
  border-radius: 14px; background: var(--panel);
  border: 1px solid var(--panel-border); backdrop-filter: blur(12px);
  transition: border-color .2s, box-shadow .2s;
}
.quote-box:hover { border-color: var(--accent); box-shadow: var(--glow); }
.quote-text { font-size: 14px; color: var(--text); letter-spacing: .3px; }
.quote-author { font-size: 12px; color: var(--text-dim); white-space: nowrap; }
.quote-ops { display: inline-flex; align-items: center; gap: 4px; margin-left: 4px; opacity: 0; transition: opacity .2s; }
.quote-box:hover .quote-ops { opacity: 1; }
.quote-op {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: 8px; cursor: pointer;
  border: 1px solid var(--panel-border); background: transparent;
  color: var(--text-dim); transition: .18s; padding: 0;
}
.quote-op:hover { color: var(--accent); border-color: var(--accent); background: rgba(124,108,255,.08); }
.quote-op svg { width: 15px; height: 15px; }
.quote-anim .quote-text, .quote-anim .quote-author { animation: quoteFade .5s ease; }
@keyframes quoteFade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
/* 触屏设备没有 hover，操作按钮常显 */
@media (hover: none) {
  .quote-ops { opacity: 1; }
}

/* ===================== 提交网址弹窗 ===================== */
.subm-mask {
  display: none; position: fixed; inset: 0; z-index: 200;
  background: rgba(0, 0, 0, .55); backdrop-filter: blur(5px);
  align-items: center; justify-content: center; padding: 18px;
}
.subm-mask.open { display: flex; }
.subm-box {
  width: min(520px, 94vw); max-height: 88vh; overflow-y: auto;
  border-radius: 18px; padding: 20px 22px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .45);
  animation: smPop .2s ease;
}
@keyframes smPop { from { transform: scale(.94); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.subm-head {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 17px; font-weight: 800; margin-bottom: 14px;
}
.subm-close { cursor: pointer; color: var(--text-dim); padding: 2px 8px; border-radius: 6px; font-size: 15px; }
.subm-close:hover { color: #ff5b6a; }
.subm-tabs { display: flex; gap: 8px; justify-content: center; margin-bottom: 16px; }
.subm-tab {
  padding: 7px 20px; border-radius: 20px; cursor: pointer; font-size: 13px; font-weight: 700;
  border: 1px solid var(--panel-border); background: var(--input-bg); color: var(--text-dim);
  transition: .15s;
}
.subm-tab.active {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff; border-color: transparent;
}
.sm-row { margin-bottom: 13px; }
.sm-row label { display: block; font-size: 12.5px; font-weight: 600; color: var(--text-dim); margin-bottom: 6px; }
.sm-row label i { color: #ff5b6a; font-style: normal; }
.sm-row input[type="text"], .sm-row textarea {
  width: 100%; padding: 10px 13px; border-radius: 10px; resize: none;
  background: var(--input-bg); border: 1px solid var(--panel-border);
  color: var(--text); font-size: 13.5px; outline: none; font-family: inherit;
}
.sm-row input:focus, .sm-row textarea:focus { border-color: var(--accent); }
.sm-group { display: flex; gap: 8px; align-items: center; }
.sm-group input { flex: 1; }
.sm-btn {
  padding: 9px 13px; border-radius: 10px; cursor: pointer; flex-shrink: 0;
  border: 1px solid var(--panel-border); background: var(--input-bg);
  color: var(--text); font-size: 12.5px; font-weight: 600; white-space: nowrap;
  transition: .15s;
}
.sm-btn:hover { border-color: var(--accent); color: var(--accent); }
.sm-icon-preview {
  width: 38px; height: 38px; border-radius: 9px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 17px;
  background: var(--input-bg); border: 1px solid var(--panel-border); overflow: hidden;
}
.sm-icon-preview img { width: 100%; height: 100%; object-fit: contain; }
.sm-submit {
  width: 100%; padding: 11px; margin-top: 4px; border: none; border-radius: 11px;
  cursor: pointer; font-size: 14.5px; font-weight: 800; color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  transition: .18s;
}
.sm-submit:hover { transform: translateY(-2px); box-shadow: var(--glow); }
.sm-tip { font-size: 11.5px; color: var(--text-dim); text-align: center; margin-top: 10px; }
.sm-empty { text-align: center; color: var(--text-dim); font-size: 13px; padding: 30px 0; }
.sm-rec {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 13px; border-radius: 11px; margin-bottom: 9px;
  background: var(--input-bg); border: 1px solid var(--panel-border);
}
.sm-rec-body { flex: 1; min-width: 0; }
.sm-rec-body a { color: var(--text); text-decoration: none; font-size: 13.5px; }
.sm-rec-body a:hover { color: var(--accent); }
.sm-rec-meta { font-size: 11px; color: var(--text-dim); margin-top: 3px; word-break: break-all; }
.sm-st { font-size: 11.5px; font-weight: 700; padding: 3px 10px; border-radius: 12px; flex-shrink: 0; }
.sm-st.ok { color: #3ddc84; background: rgba(61, 220, 132, .12); }
.sm-st.no { color: #ff5b6a; background: rgba(255, 91, 106, .12); }
.sm-st.wait { color: #ffc442; background: rgba(255, 196, 66, .12); }

/* 返回顶部 */
.back-top {
  position: fixed; right: 22px; bottom: 28px; z-index: 95;
  width: 52px; height: 52px; border-radius: 50%; border: none;
  display: flex; align-items: center; justify-content: center;
  background: var(--panel); backdrop-filter: blur(12px);
  opacity: 0; pointer-events: none; transform: translateY(16px);
  transition: opacity .3s, transform .3s;
}
.back-top::before {
  content: ''; position: absolute; inset: -2px; border-radius: 50%;
  background: conic-gradient(var(--accent), var(--accent-2), var(--accent));
  z-index: -1; animation: spinRing 3s linear infinite;
}
.back-top::after {
  content: ''; position: absolute; inset: 2px; border-radius: 50%;
  background: var(--panel); z-index: -1;
}
@keyframes spinRing { to { transform: rotate(360deg); } }
.back-top.show { opacity: 1; pointer-events: auto; transform: translateY(0); }
.back-top svg { width: 22px; height: 22px; stroke: var(--accent); }
.back-top:hover { transform: translateY(-3px); }

/* 滚动条 */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: var(--input-bg); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* ===================== 响应式 ===================== */
@media (max-width: 1000px) {
  .widget-row { grid-template-columns: 1fr; }
  .cards { grid-template-columns: repeat(2, 1fr) !important; }
}

@media (max-width: 760px) {
  :root { --topbar-h: 58px; --hero-h: 72px; }
  .topbar { padding: 0 12px; }
  .brand { min-width: 0; }
  .brand-slogan { display: none; }
  .brand { flex: 1; min-width: 0; }
  .brand-name { font-size: 15px; max-width: 30vw; }
  .brand-logo { font-size: 20px; }
  .brand-logo img { width: 24px; height: 24px; }
  .clock-box { line-height: 1.1; flex-shrink: 0; }
  .clock-time { font-size: 18px; letter-spacing: 1px; }
  .clock-date { display: none; }
  .top-actions { flex: 1; min-width: 0; gap: 6px; }
  .icon-btn { width: 36px; height: 36px; font-size: 16px; flex-shrink: 0; }
  .submit-btn { padding: 6px 10px; font-size: 12px; flex-shrink: 0; }
  .friend-wrap { padding: 0 10px; }
  /* 移动端友情链接一行 4 个 */
  .friend-list { grid-template-columns: repeat(4, 1fr); gap: 8px; }
  .friend-chip { padding: 8px 4px 7px; font-size: 12px; border-radius: 10px; }
  .friend-chip b { font-size: 12px; }
  .friend-chip i { font-size: 10px; }
  .theme-panel { right: 10px; width: 210px; }

  /* 每日一言：句子可换行，按钮常显（触屏） */
  .quote-box { flex-wrap: wrap; gap: 4px 8px; padding: 10px 14px; }
  .quote-text { font-size: 13px; }
  .quote-ops { opacity: 1; }

  /* 搜索框吸顶 */
  .hero {
    position: sticky; top: var(--topbar-h); z-index: 48;
    padding: 10px 10px 8px;
    backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  }
  .search-wrap { width: 100%; height: 50px; }

  /* 注意：桌面端 .main 是 align-items:flex-start，纵向排列时必须让子项横向拉伸，
     否则 .content 会按内容收缩，导致不同文件夹下小部件宽度不一致、不居中 */
  .main { flex-direction: column; align-items: stretch; margin-top: 6px; padding: 0 10px; gap: 10px; }
  .content { width: 100%; }

  /* 文件夹：去掉标题，一行 4 个全部展示，不吸顶（只保留顶栏+搜索框吸顶） */
  .sidebar {
    width: 100%; padding: 8px 6px;
    position: static;
  }
  .side-title { display: none; }
  .folder-list {
    display: grid; grid-template-columns: repeat(4, 1fr);
    gap: 3px; max-height: none; overflow: visible;
  }
  .folder-list li {
    flex-direction: column; gap: 2px; margin: 0;
    padding: 6px 1px; border-radius: 8px;
    font-size: 11px; text-align: center;
  }
  .folder-list li.active { box-shadow: none; background: var(--card-hover); }
  .folder-list .f-icon { font-size: 15px; width: auto; }
  .folder-list .f-icon svg { width: 19px; height: 19px; }
  .folder-list .f-icon .f-img { width: 19px; height: 19px; }
  .folder-list .f-name { max-width: 100%; }
  .folder-list .f-count { display: none; }

  /* 小部件单列 */
  .widget-row { grid-template-columns: 1fr; gap: 10px; margin-bottom: 12px; }
  .weather-widget .w-temp { font-size: 34px; }
  .w-day { font-size: 10.5px; }

  /* 书签一行 2 个：统一竖排卡片（图标在上，文字整宽排列，任何文件夹显示一致） */
  .cards { grid-template-columns: repeat(2, 1fr) !important; gap: 9px; align-items: stretch; }
  .card {
    flex-direction: column; align-items: flex-start; gap: 8px;
    padding: 12px 11px; height: 100%;
  }
  .card-icon { width: 34px; height: 34px; font-size: 15px; border-radius: 9px; }
  .card-icon.has-img { border-radius: 5px; }
  .card-body { width: 100%; }
  .card-name {
    font-size: 13px; line-height: 1.35;
    white-space: normal; display: -webkit-box;
    -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  }
  body.full-title .card-name { display: block; -webkit-line-clamp: unset; }
  .card-desc { font-size: 10.5px; margin-top: 3px; }
  .card-time {
    font-size: 10px; margin-top: 3px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .fs-title { font-size: 16px; }

  /* 抬高到每日一言上方，避免挡住底部句子 */
  .back-top { right: 14px; bottom: 96px; width: 46px; height: 46px; }
}
