/* 个人面板 · FreshRSS Origine 风格 */

:root,
[data-scheme="light"] {
  --page-bg: #f0f0f0;
  --card-bg: #ffffff;
  --card-border: #dddddd;
  --title: #333333;
  --text: #333333;
  --muted: #777777;
  --accent: #0084cc;
  --accent-soft: #e6f3ff;
  --radius: 3px;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

[data-scheme="dark"] {
  --page-bg: #1a1a1a;
  --card-bg: #242424;
  --card-border: #3a3a3a;
  --title: #dddddd;
  --text: #cccccc;
  --muted: #999999;
  --accent: #4da6ff;
  --accent-soft: #1e3a52;
  --shadow: none;
}

body {
  background: var(--page-bg) !important;
  background-image: none !important;
  font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial,
    "PingFang SC", "Microsoft YaHei", sans-serif !important;
  color: var(--text) !important;
}

.page-columns {
  max-width: 1320px;
  margin: 0 auto;
  gap: 12px !important;
}

/* 卡片：白底、细灰边、3px 圆角，接近 FreshRSS 的 box */
.widget {
  background: var(--card-bg) !important;
  border: 1px solid var(--card-border) !important;
  border-radius: var(--radius) !important;
  box-shadow: var(--shadow);
  padding: 14px 16px !important;
}

.widget::before {
  content: none !important;
}

.widget:hover {
  border-color: #c8c8c8 !important;
  box-shadow: var(--shadow);
}

/* 标题：普通无衬线，深灰加粗 */
.widget-header h2 {
  display: block;
  font-family: inherit !important;
  font-size: 15px !important;
  font-weight: 700 !important;
  line-height: 1.35 !important;
  letter-spacing: 0 !important;
  color: var(--title) !important;
  text-transform: none !important;
}

.widget-header h2::before {
  content: none !important;
}

/* 数字与强调：常规字体 */
.size-h2,
.size-h3,
.size-h4,
.color-highlight,
.monitor-site-status-icon + * {
  font-family: inherit !important;
  font-variant-numeric: normal;
}

.color-highlight,
a.color-highlight {
  color: var(--accent) !important;
}

.color-base,
.size-h6 {
  color: var(--muted) !important;
}

/* 状态点不做动画 */
.monitor-site-status-icon svg {
  animation: none !important;
}

/* 列表行距 */
.list-gap-10 > li {
  padding: 3px 0;
}

/* 滚动条 */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 3px;
}
::-webkit-scrollbar-track { background: #f0f0f0; }

/* 手机 */
@media (max-width: 640px) {
  .widget { padding: 12px 14px !important; }
  .page-columns { gap: 10px !important; }
}

/* 主题切换按钮 */
.theme-picker {
  width: 34px;
  height: 34px;
  padding: 4px;
  border-radius: 3px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  box-shadow: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.theme-picker:hover { border-color: var(--accent); }
.theme-picker .current-theme-preview {
  width: 24px;
  height: 24px;
  border-radius: 2px;
  overflow: hidden;
}

/* 手机底部导航：FreshRSS 式蓝色选中块 */
.mobile-navigation-icons { gap: 4px; }
.mobile-navigation-icons .mobile-navigation-label {
  width: auto;
  max-width: none;
  min-width: 0;
  flex: 0 0 auto;
  height: 34px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 3px;
  font-family: inherit !important;
  font-size: 14px !important;
  font-weight: 400 !important;
  letter-spacing: 0;
  color: var(--text);
}
.mobile-navigation-icons .mobile-navigation-pill { display: none; }
.mobile-navigation-icons label:nth-of-type(1)::after { content: "总览"; }
.mobile-navigation-icons label:nth-of-type(2)::after { content: "日程"; }
.mobile-navigation-icons label:nth-of-type(3)::after { content: "分析"; }
.mobile-navigation-icons label:has(input:checked) {
  background: var(--accent);
  color: #ffffff;
  font-weight: 600;
}
.mobile-navigation-icons label:nth-of-type(4) {
  width: 34px !important;
  padding: 0 !important;
}

/* 去掉卡片内的浅色内框，贴近 FreshRSS 的扁平列表 */
.widget-content {
  background: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  padding: 0 !important;
  box-shadow: none !important;
}

/* 站点图标：固定尺寸，失败也不塌陷 */
.monitor-site-icon {
  width: 18px !important;
  height: 18px !important;
  object-fit: contain;
  flex: 0 0 18px;
}

/* 站点可用性热力条 */
.uptime-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 3px 0;
}
.uptime-name {
  flex: 0 0 64px;
  font-size: 12px;
  color: var(--text);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.uptime-bars {
  flex: 1 1 auto;
  display: flex;
  gap: 2px;
  height: 16px;
  min-width: 0;
}
.uptime-cell {
  flex: 1 1 0;
  min-width: 2px;
  border-radius: 1px;
  background: #e6e8eb;
}
.uptime-cell.ok { background: #3fb950; }
.uptime-cell.warn { background: #d29922; }
.uptime-cell.bad { background: #f85149; }
.uptime-cell.none { background: #eceff2; }
[data-scheme="dark"] .uptime-cell { background: #333a42; }
[data-scheme="dark"] .uptime-cell.none { background: #2b3138; }
.uptime-pct {
  flex: 0 0 42px;
  text-align: right;
  font-size: 12px;
  color: var(--muted);
}

/* 站点状态行：图标 + 名称 + 24h 小格 + 耗时 */
.site-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 0;
}
.site-icon {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  object-fit: contain;
}
.site-name {
  flex: 0 0 auto;
  max-width: 78px;
  font-size: 13px;
  color: var(--accent);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  text-decoration: none;
}
.site-bars {
  flex: 1 1 auto;
  display: flex;
  gap: 2px;
  height: 14px;
  min-width: 0;
}
.site-cell {
  flex: 1 1 0;
  min-width: 2px;
  border-radius: 1px;
  background: #e6e8eb;
}
.site-cell.ok { background: #3fb950; }
.site-cell.warn { background: #d29922; }
.site-cell.bad { background: #f85149; }
.site-cell.none { background: #eceff2; }
.site-status {
  flex: 0 0 44px;
  text-align: right;
  font-size: 12px;
  color: var(--muted);
}
.site-status.bad { color: #d1242f; }
[data-scheme="dark"] .site-cell { background: #333a42; }
[data-scheme="dark"] .site-cell.none { background: #2b3138; }

/* 状态勾：保留原来的对号/叉号 */
.site-flag {
  flex: 0 0 14px;
  width: 14px;
  height: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
}
.site-flag.ok { color: #2da44e; }
.site-flag.bad { color: #d1242f; }
.site-flag.ok::before { content: "✓"; }
.site-flag.bad::before { content: "✕"; }

/* Worker 用量 */
.quota-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-top: 8px;
}
.quota-row:first-child { margin-top: 0; }
.quota-label {
  flex: 0 0 auto;
  font-size: 13px;
  color: var(--text);
}
.quota-num {
  flex: 1 1 auto;
  text-align: right;
  font-size: 12px;
  color: var(--muted);
}
.quota-pct {
  flex: 0 0 46px;
  text-align: right;
  font-size: 12px;
  font-weight: 600;
  color: #2da44e;
}
.quota-pct.warn { color: #b7791f; }
.quota-pct.bad { color: #d1242f; }
.quota-bar {
  height: 6px;
  margin: 4px 0 2px;
  background: #e6e8eb;
  border-radius: 3px;
  overflow: hidden;
}
.quota-fill {
  display: block;
  height: 100%;
  background: #2da44e;
  border-radius: 3px;
}
.quota-fill.warn { background: #d29922; }
.quota-fill.bad { background: #d1242f; }
[data-scheme="dark"] .quota-bar { background: #333a42; }

/* 刷新控件 */
.panel-refresh {
  position: fixed;
  right: 12px;
  bottom: 74px;
  z-index: 40;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 11px;
  border: 1px solid var(--card-border);
  border-radius: 999px;
  background: var(--card-bg);
  color: var(--muted);
  font-family: inherit;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  transition: color 0.15s ease, border-color 0.15s ease;
}
.panel-refresh:hover {
  color: var(--accent);
  border-color: var(--accent);
}
.panel-refresh.is-loading svg {
  animation: panel-spin 0.8s linear infinite;
}
@keyframes panel-spin {
  to { transform: rotate(360deg); }
}
@media (min-width: 900px) {
  .panel-refresh { bottom: 16px; right: 16px; }
}

/* FreshRSS 最新文章 */
.rss-item {
  display: flex;
  gap: 9px;
  padding: 9px 0;
  border-bottom: 1px solid var(--card-border);
  text-decoration: none;
  color: inherit;
}
.rss-item:last-child {
  border-bottom: 0;
  padding-bottom: 2px;
}
.rss-dot {
  flex: 0 0 6px;
  width: 6px;
  height: 6px;
  margin-top: 7px;
  border-radius: 50%;
  background: transparent;
}
.rss-item.is-unread .rss-dot { background: var(--accent); }
.rss-body {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.rss-title {
  font-size: 13.5px;
  line-height: 1.45;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.rss-item.is-unread .rss-title {
  font-weight: 600;
  color: var(--title);
}
.rss-item:hover .rss-title { color: var(--accent); }
.rss-meta {
  display: flex;
  gap: 8px;
  font-size: 11.5px;
  color: var(--muted);
}
.rss-feed {
  max-width: 60%;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

/* FreshRSS 未读 */
.unread-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--card-border);
}
.unread-num {
  font-size: 30px;
  font-weight: 700;
  line-height: 1;
  color: var(--accent);
}
.unread-label {
  font-size: 12px;
  color: var(--muted);
}
.unread-feeds {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: 10px;
}
.unread-feed {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 13px;
}
.unread-feed-name {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.unread-pill {
  flex: 0 0 auto;
  min-width: 20px;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 11.5px;
  font-weight: 600;
  text-align: center;
}
.unread-empty {
  font-size: 12.5px;
  color: var(--muted);
}

/* 刷新完成提示 */
.panel-refresh.is-done {
  color: #2da44e;
  border-color: #2da44e;
}

/* FreshRSS 无未读 */
.rss-empty {
  padding: 14px 0 6px;
  font-size: 13px;
  color: var(--muted);
}

/* 收藏夹：图标 + 文字的网格 */
.bookmarks-group ul {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}
.bookmarks-group li {
  margin: 0;
}
.bookmarks-group li > .flex {
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 78px;
  padding: 8px 4px;
  border: 1px solid var(--card-border);
  border-radius: 6px;
  background: var(--card-bg);
  transition: border-color 0.15s ease, background 0.15s ease;
}
.bookmarks-group li > .flex:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.bookmarks-group .bookmarks-icon-container {
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
}
.bookmarks-group .bookmarks-icon {
  width: 28px;
  height: 28px;
  object-fit: contain;
}
.bookmarks-group .bookmarks-link {
  font-size: 12px;
  line-height: 1.2;
  text-align: center;
  color: var(--text);
  text-decoration: none;
  max-width: 100%;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
@media (max-width: 420px) {
  .bookmarks-group .bookmarks-link { font-size: 11px; }
}

/* 收藏夹细节修正 */
.bookmarks-group .bookmarks-icon-container {
  background: transparent !important;
  box-shadow: none !important;
  border: 0 !important;
}
.bookmarks-group .bookmarks-link {
  color: var(--text) !important;
  font-size: 11px !important;
  font-weight: 500 !important;
}
.bookmarks-group .bookmarks-link::after {
  font-size: 9px !important;
  opacity: 0.4;
  margin-left: 2px;
}
.bookmarks-group li > .flex {
  height: 74px;
}

/* 邮件卡片 */
.widget:has(.mail-gear) { position: relative; }
.mail-head {
  display: flex;
  align-items: baseline;
  gap: 6px;
  padding-right: 26px;
}
.mail-unread {
  font-size: 28px;
  font-weight: 700;
  line-height: 1;
  color: var(--accent);
}
.mail-unread-label {
  font-size: 12px;
  color: var(--muted);
}
.mail-gear {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 26px;
  height: 26px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 5px;
  background: transparent;
  color: var(--muted);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
}
.mail-gear:hover {
  border-color: var(--card-border);
  color: var(--accent);
}
.mail-cats {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 10px 0 4px;
}
.mail-cat {
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 11.5px;
}
.mail-cat b { font-weight: 700; }
.mail-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 7px 0;
  border-top: 1px solid var(--card-border);
}
.mail-subject {
  font-size: 13px;
  line-height: 1.4;
  color: var(--text);
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
}
.mail-meta {
  font-size: 11.5px;
  color: var(--muted);
}
.mail-empty {
  padding: 8px 0 2px;
  font-size: 12.5px;
  color: var(--muted);
}
.mail-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  font-size: 11.5px;
}
.mail-foot a { color: var(--accent); text-decoration: none; }
.mail-model { color: var(--muted); }

/* 模型设置浮层 */
.mail-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(17, 24, 39, 0.35);
  padding: 20px;
}
.mail-modal {
  width: 100%;
  max-width: 320px;
  padding: 16px;
  border-radius: 8px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.18);
}
.mail-modal-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--title);
}
.mail-modal-desc {
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted);
}
.mail-modal-select {
  width: 100%;
  margin-top: 12px;
  padding: 8px 10px;
  border: 1px solid var(--card-border);
  border-radius: 5px;
  background: var(--card-bg);
  color: var(--text);
  font-size: 14px;
}
.mail-modal-msg {
  min-height: 16px;
  margin-top: 8px;
  font-size: 12px;
  color: var(--muted);
}
.mail-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 6px;
}
.mail-btn {
  padding: 7px 14px;
  border-radius: 5px;
  border: 1px solid var(--card-border);
  background: var(--card-bg);
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
}
.mail-btn-save {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}
.mail-btn:disabled { opacity: 0.6; cursor: default; }

.mail-today {
  margin-left: auto;
  font-size: 11.5px;
  color: var(--muted);
}
