/* ====== 设计变量与基础 ====== */
:root {
  --bg: #ffffff;
  --text: #202124;
  --muted: #5f6368;
  --border: #dadce0;
  --shadow: 0 1px 6px rgba(32, 33, 36, 0.28);
  --shadow-soft: 0 1px 2px rgba(60, 64, 67, 0.14), 0 2px 6px rgba(60, 64, 67, 0.16);
  --radius-lg: 24px;
  --radius-md: 16px;
  --focus: #1a73e8;
  --danger: #d93025;
  --font-sans: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei UI",
    "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", "Noto Sans CJK SC", "Noto Sans SC", Roboto, Helvetica,
    Arial, "Apple Color Emoji", "Segoe UI Emoji";
  --font-display: ui-rounded, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "Microsoft YaHei UI", "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", "Noto Sans CJK SC", "Noto Sans SC",
    Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  text-rendering: optimizeLegibility;
}

html,
body {
  height: 100%;
  margin: 0;
  padding: 0;
  font-family: var(--font-sans);
  font-feature-settings: "kern" 1, "liga" 1;
  font-kerning: normal;
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  color: var(--text);
  background: var(--bg);
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
}

/* ====== 顶部工具栏 ====== */
.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0 16px;
  z-index: 10;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.6));
  backdrop-filter: blur(10px);
}

.icon-btn {
  position: relative;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  border: 1px solid transparent;
  background: transparent;
  cursor: pointer;
  color: var(--muted);
  transition: background 120ms ease, border-color 120ms ease, transform 120ms ease;
}

.icon-btn:hover {
  background: rgba(60, 64, 67, 0.08);
}

.icon-btn:active {
  transform: translateY(1px);
}

.icon-btn:focus-visible {
  outline: none;
  border-color: var(--focus);
  box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.18);
}

.badge {
  position: absolute;
  top: 7px;
  right: 7px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-size: 11px;
  line-height: 16px;
  font-weight: 600;
  display: none;
  justify-content: center;
}

.badge[data-show="true"] {
  display: inline-flex;
}

/* ====== 页面主区 ====== */
.wrap {
  min-height: 100%;
  display: grid;
  place-items: center;
  padding: 56px 16px 56px;
}

.content {
  width: min(980px, 100%);
  display: grid;
  justify-items: center;
  gap: 18px;
}

.logo {
  margin-top: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(8px, 1.4vw, 12px);
  --brand-size: clamp(40px, 5.2vw, 58px);
  user-select: none;
}

.brand-logo {
  width: calc(var(--brand-size) * 1.6);
  height: calc(var(--brand-size) * 1.6);
  object-fit: contain;
  display: block;
}

.logo-text {
  font-size: calc(var(--brand-size) * 0.92);
  line-height: 1;
  letter-spacing: -0.04em;
  font-weight: 800;
  font-family: var(--font-display);
  display: inline-flex;
  align-items: center;
}

.logo .c1 {
  color: #1a73e8;
}
.logo .c2 {
  color: #d93025;
}
.logo .c3 {
  color: #f9ab00;
}
.logo .c4 {
  color: #1e8e3e;
}

/* ====== 搜索框 ====== */
.search {
  width: min(640px, 100%);
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #fff;
  display: grid;
  grid-template-columns: 46px 1fr 58px;
  align-items: center;
  transition: box-shadow 140ms ease, border-color 140ms ease;
}

.search:focus-within {
  border-color: transparent;
  box-shadow: var(--shadow);
}

.search .slot {
  display: grid;
  place-items: center;
  color: var(--muted);
}

.search .slot-btn {
  appearance: none;
  border: 0;
  padding: 0;
  font: inherit;
  cursor: pointer;
  border-top-right-radius: 999px;
  border-bottom-right-radius: 999px;
  transition: background 120ms ease, color 120ms ease;
  user-select: none;
}

.search .slot-btn span {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: #3c4043;
}

.search .slot-btn:hover {
  background: rgba(60, 64, 67, 0.06);
  color: #3c4043;
}

.search .slot-btn:active {
  background: rgba(60, 64, 67, 0.1);
}

.search .slot-btn:focus-visible {
  outline: none;
  box-shadow: inset 0 0 0 2px rgba(26, 115, 232, 0.65);
}

.search input {
  width: 100%;
  border: 0;
  outline: none;
  font-family: inherit;
  font-size: 16px;
  padding: 12px 4px;
  background: transparent;
  color: var(--text);
}

/* ====== 系统卡片 ====== */
.grid {
  margin-top: 14px;
  width: min(860px, 100%);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

@media (max-width: 860px) {
  .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  .grid {
    grid-template-columns: 1fr;
  }
}

.card {
  border: 1px solid rgba(218, 220, 224, 0.9);
  border-radius: var(--radius-md);
  background: #fff;
  padding: 12px;
  display: grid;
  grid-template-columns: 84px 1fr;
  gap: 12px;
  align-items: center;
  cursor: pointer;
  transition: transform 140ms ease, box-shadow 140ms ease, border-color 140ms ease;
}

.card:hover {
  transform: translateY(-2px);
  border-color: rgba(218, 220, 224, 0.65);
  box-shadow: var(--shadow-soft);
}

.card:focus-visible {
  outline: none;
  border-color: var(--focus);
  box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.18);
}

.card[hidden] {
  display: none;
}

.thumb {
  width: 84px;
  height: 84px;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(218, 220, 224, 0.7);
  background: radial-gradient(circle at 30% 30%, rgba(26, 115, 232, 0.12), rgba(26, 115, 232, 0));
}

.thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.meta {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.name {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.url {
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.grid-empty {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
  text-align: center;
}

/* ====== 通知面板 ====== */
.panel {
  position: fixed;
  top: 62px;
  right: 14px;
  width: min(420px, calc(100vw - 28px));
  border-radius: 14px;
  border: 1px solid rgba(218, 220, 224, 0.9);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
  transform-origin: top right;
  transform: scale(0.98);
  opacity: 0;
  pointer-events: none;
  transition: opacity 120ms ease, transform 120ms ease;
  z-index: 20;
}

.panel[data-open="true"] {
  opacity: 1;
  transform: scale(1);
  pointer-events: auto;
}

.panel-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 12px 10px;
  border-bottom: 1px solid rgba(218, 220, 224, 0.7);
}

.panel-hd .title {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.panel-hd .sub {
  font-size: 12px;
  color: var(--muted);
}

.panel-bd {
  max-height: min(60vh, 520px);
  overflow: auto;
}

.notice {
  padding: 12px;
  display: grid;
  gap: 6px;
  border-bottom: 1px solid rgba(218, 220, 224, 0.5);
  cursor: pointer;
  transition: background 120ms ease;
}

.notice:hover {
  background: rgba(60, 64, 67, 0.05);
}

.notice .t {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.notice .t .heading {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.notice .t strong {
  font-size: 14px;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.notice time {
  font-size: 11px;
  color: var(--muted);
  flex: none;
}

.notice p {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.35;
}

.notice .unread-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--danger);
  display: none;
  flex: none;
}

.notice[data-read="false"] .unread-dot {
  display: inline-block;
}

.empty {
  padding: 18px 12px;
  font-size: 13px;
  color: var(--muted);
}

/* ====== 工具类 ====== */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
