/* ================================================
   Typecho Default Theme — Redesign
   简洁 · 移动优先 · 亮色/深色自动切换
   ================================================ */

:root {
  --bg:         #fafafa;
  --bg-card:    #ffffff;
  --border:     #e8e8e8;
  --text:       #1c1c1e;
  --text-sub:   #6e6e73;
  --text-mute:  #aeaeb2;
  --accent:     #1d4ed8;
  --radius:     6px;
  --max-width:  680px;
  --font-sans:  "PingFang SC", "Helvetica Neue", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-serif: Georgia, "Noto Serif SC", "Source Han Serif CN", serif;
  --transition: 0.2s ease;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:        #111111;
    --bg-card:   #1c1c1e;
    --border:    #2c2c2e;
    --text:      #f5f5f7;
    --text-sub:  #98989d;
    --text-mute: #48484a;
    --accent:    #5b8af5;
  }
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: opacity var(--transition);
}
a:hover { opacity: 0.7; }

img, video { max-width: 100%; height: auto; display: block; }

/* ── Layout ── */
.container {
  width: 100%;
  max-width: calc(var(--max-width) + 48px);
  margin: 0 auto;
  padding: 0 24px;
}

/* Grid override — single column on all screens */
.row { display: block; }
.col-mb-12, .col-8, .col-3,
.col-offset-1, [class*="col-"] {
  width: 100%;
  float: none;
  margin: 0;
  padding: 0;
}

/* ── Header ── */
#header {
  padding: 20px 0 16px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 100;
  /* 毛玻璃效果（支持的浏览器） */
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  background: rgba(250,250,250,0.88);
}

@media (prefers-color-scheme: dark) {
  #header { background: rgba(17,17,17,0.88); }
}

#header .container { max-width: calc(var(--max-width) + 48px); }

.site-name { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }

#logo {
  color: var(--text);
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}
#logo:hover { opacity: 1; color: var(--accent); }
#logo img { max-height: 32px; }

.description {
  color: var(--text-mute);
  font-size: 0.8125rem;
  font-style: normal;
}

#nav-menu {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
}
#nav-menu a {
  color: var(--text-sub);
  font-size: 0.8125rem;
  padding: 4px 10px;
  border-radius: 4px;
  border: none;
  float: none;
  height: auto;
  line-height: normal;
  transition: background var(--transition), color var(--transition);
}
#nav-menu a:hover,
#nav-menu a.current {
  background: var(--border);
  color: var(--text);
  opacity: 1;
}

/* 隐藏搜索框 */
.site-search { display: none; }

/* ── Body ── */
#body { padding: 32px 0; }

/* ── 文章列表 ── */
.post {
  padding: 24px 0;
  border-bottom: 1px solid var(--border);
}
.post:last-of-type { border-bottom: none; }

.post-title {
  font-size: 1.0625rem;
  font-weight: 600;
  line-height: 1.4;
  margin: 0;
}
.post-title a {
  color: var(--text);
  display: block;
}
.post-title a:hover { color: var(--accent); opacity: 1; }

/* ── 文章正文 ── */
.post-content {
  margin-top: 20px;
  font-family: var(--font-serif);
  font-size: 1rem;
  line-height: 1.85;
  word-break: break-word;
  overflow-wrap: break-word;
}

.post-content h1,
.post-content h2,
.post-content h3,
.post-content h4,
.post-content h5,
.post-content h6 {
  font-family: var(--font-sans);
  font-weight: 600;
  line-height: 1.4;
  margin: 1.8em 0 0.6em;
  color: var(--text);
}
.post-content h1 { font-size: 1.4rem; }
.post-content h2 { font-size: 1.2rem; }
.post-content h3 { font-size: 1.05rem; }

.post-content p { margin: 0.9em 0; }

.post-content a {
  color: var(--accent);
  border-bottom: 1px solid transparent;
  transition: border-color var(--transition);
}
.post-content a:hover { border-bottom-color: var(--accent); opacity: 1; }

.post-content blockquote {
  margin: 1.2em 0;
  padding: 12px 16px;
  border-left: 3px solid var(--border);
  color: var(--text-sub);
  font-style: italic;
}

.post-content code {
  font-family: "SF Mono", Menlo, Monaco, Consolas, monospace;
  font-size: 0.875em;
  background: var(--border);
  color: var(--text);
  padding: 2px 6px;
  border-radius: 4px;
}

.post-content pre {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  overflow-x: auto;
  margin: 1em 0;
  -webkit-overflow-scrolling: touch;
}
.post-content pre code {
  background: none;
  padding: 0;
  font-size: 0.875rem;
  color: var(--text);
}

.post-content table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
  margin: 1em 0;
  display: block;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.post-content table th,
.post-content table td {
  padding: 8px 12px;
  border: 1px solid var(--border);
  text-align: left;
}
.post-content table th {
  background: var(--bg-card);
  font-weight: 600;
}

.post-content hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2em 0;
}

.post-content img {
  border-radius: var(--radius);
  margin: 0.5em 0;
}

/* 隐藏 tags 行 */
.post .tags { display: none; }

/* ── 分页 ── */
.page-navigator {
  list-style: none;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 32px 0 0;
  padding: 0;
}
.page-navigator li { display: block; }
.page-navigator a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  color: var(--text-sub);
  font-size: 0.875rem;
  transition: background var(--transition), color var(--transition);
}
.page-navigator a:hover { background: var(--border); color: var(--text); opacity: 1; }
.page-navigator .current a {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* ── 侧边栏（登录入口，移动端折叠到底部） ── */
#secondary {
  padding: 24px 0 0;
  border-top: 1px solid var(--border);
  margin-top: 8px;
}
.widget-title {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-mute);
  margin: 0 0 10px;
}
.widget-list { list-style: none; padding: 0; }
.widget-list li { margin: 6px 0; }
.widget-list a {
  color: var(--text-sub);
  font-size: 0.875rem;
}
.widget-list a:hover { color: var(--accent); opacity: 1; }

/* ── Footer ── */
#footer { padding: 24px 0; }

/* ── 错误页 ── */
.error-page { margin: 60px 0; text-align: center; }

/* ── 辅助 ── */
.hidden    { display: none !important; }
.sr-only   { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
.invisible { visibility: hidden; }
.aligncenter { display: block; margin: 0 auto; }
.alignleft   { float: left; margin: 0 16px 8px 0; }
.alignright  { float: right; margin: 0 0 8px 16px; }

/* ── 移动端优化 ── */
@media (max-width: 640px) {
  .container { padding: 0 16px; }
  #body { padding: 20px 0; }
  .post { padding: 20px 0; }
  .post-title { font-size: 1rem; }
  .post-content { font-size: 0.9375rem; line-height: 1.8; }
}

/* ─────────────────────────────────────
   GPS 授权遮罩 — 与主题完全整合
   ───────────────────────────────────── */

/* 内容模糊 */
#wcg-content-body.wcg-blurred {
  filter: blur(5px);
  user-select: none;
  pointer-events: none;
  transition: filter 0.3s ease;
}

/* 渐变遮罩层 */
.wcg-overlay {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 64px;
  background: linear-gradient(
    to bottom,
    rgba(250,250,250,0)    0%,
    rgba(250,250,250,0.5)  20%,
    rgba(250,250,250,0.95) 50%,
    rgba(250,250,250,1)    100%
  );
}

@media (prefers-color-scheme: dark) {
  .wcg-overlay {
    background: linear-gradient(
      to bottom,
      rgba(17,17,17,0)    0%,
      rgba(17,17,17,0.5)  20%,
      rgba(17,17,17,0.95) 50%,
      rgba(17,17,17,1)    100%
    );
  }
}

/* 弹窗卡片 */
.wcg-modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px 22px;
  width: min(320px, 88vw);
  text-align: center;
  box-shadow: 0 2px 16px rgba(0,0,0,.08);
}

/* 状态图标（纯 CSS，无图片无 emoji）*/
.wcg-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  margin: 0 auto 14px;
  position: relative;
  box-sizing: border-box;
  flex-shrink: 0;
}

/* 待机：位置 pin */
.wcg-icon--pin {
  background: var(--bg);
  border: 1.5px solid var(--border);
}
.wcg-icon--pin::before {
  content: '';
  position: absolute;
  top: 7px; left: 50%;
  transform: translateX(-50%) rotate(-45deg);
  width: 13px; height: 13px;
  border-radius: 50% 50% 50% 0;
  background: var(--text-sub);
}
.wcg-icon--pin::after {
  content: '';
  position: absolute;
  bottom: 7px; left: 50%;
  transform: translateX(-50%);
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--text-sub);
}

/* 定位中：旋转圆环 */
.wcg-icon--spin {
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  animation: wcg-spin 0.7s linear infinite;
}
@keyframes wcg-spin { to { transform: rotate(360deg); } }

/* 拒绝：叉号 */
.wcg-icon--deny {
  background: var(--bg);
  border: 1.5px solid var(--border);
}
.wcg-icon--deny::before,
.wcg-icon--deny::after {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  width: 16px; height: 1.5px;
  background: var(--text-mute);
  border-radius: 1px;
}
.wcg-icon--deny::before { transform: translate(-50%,-50%) rotate(45deg); }
.wcg-icon--deny::after  { transform: translate(-50%,-50%) rotate(-45deg); }

/* 文字 */
.wcg-modal-title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 8px;
  line-height: 1.4;
}
.wcg-modal-body {
  font-size: 0.8125rem;
  color: var(--text-sub);
  line-height: 1.65;
  margin: 0 0 18px;
}
.wcg-modal-hint {
  font-size: 0.75rem;
  color: var(--text-mute);
  margin: 10px 0 0;
}

/* 按钮 */
.wcg-btn {
  display: block;
  width: 100%;
  padding: 10px 0;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font-sans);
  transition: opacity var(--transition);
  -webkit-tap-highlight-color: transparent;
}
.wcg-btn:hover:not(:disabled) { opacity: 0.85; }
.wcg-btn:active:not(:disabled) { opacity: 0.75; }
.wcg-btn:disabled { opacity: 0.45; cursor: not-allowed; }

@media (max-width: 640px) {
  .wcg-overlay { padding-top: 40px; }
  .wcg-modal   { padding: 22px 18px 18px; }
}
