/* ========================================
   简约风格自定义样式 - 随想录
   ======================================== */

/* ---- 亮色模式 ---- */
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color: #333;
  background: #fff;
  line-height: 1.8;
  transition: background 0.3s, color 0.3s;
}

#nav {
  background: #fff !important;
  border-bottom: 1px solid #eee;
  box-shadow: none !important;
  transition: background 0.3s;
}

#nav a,
#nav span.site-page {
  color: #666 !important;
  font-weight: 500;
}

#nav a:hover,
#nav span.site-page:hover {
  color: #333 !important;
}

#nav .site-name {
  color: #333 !important;
  font-weight: 700;
  font-size: 1.1em;
  letter-spacing: 2px;
}

#content-inner {
  max-width: 800px;
  margin: 0 auto;
  padding: 40px 20px;
}

.article-sort {
  margin-bottom: 60px;
}

.article-sort-title {
  font-size: 1.4em;
  font-weight: 600;
  color: #333;
  margin-bottom: 12px;
}

.article-sort-title a {
  color: #333 !important;
}

.article-sort-title a:hover {
  color: #666 !important;
}

.article-meta {
  font-size: 0.9em;
  color: #999;
  margin-bottom: 8px;
}

.article-meta a {
  color: #999 !important;
}

.article-meta a:hover {
  color: #333 !important;
}

.article-text {
  color: #666;
  font-size: 1em;
  line-height: 1.8;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.article-category,
.article-tag {
  display: none;
}

#footer {
  background: #fff !important;
  border-top: 1px solid #eee;
  padding: 30px 20px;
  text-align: center;
  color: #999;
  font-size: 0.9em;
  transition: background 0.3s, color 0.3s;
}

#footer a {
  color: #999 !important;
}

#footer a:hover {
  color: #333 !important;
}

#footer .copyright {
  color: #999;
}

#rightside {
  background: rgba(255,255,255,0.9);
  color: #333;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  line-height: 40px;
  bottom: 30px;
  right: 30px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.1);
  transition: background 0.3s, color 0.3s, box-shadow 0.3s;
}

#rightside button {
  color: #333;
  background: transparent;
  border: none;
  width: 40px;
  height: 40px;
  cursor: pointer;
  transition: color 0.3s;
}

#rightside button:hover {
  color: #666;
}

/* ---- 夜间模式 ---- */
[data-theme='dark'] body {
  color: #c0c0c0;
  background: #1a1a1a;
}

[data-theme='dark'] #nav {
  background: #1a1a1a !important;
  border-bottom: 1px solid #333;
}

[data-theme='dark'] #nav a,
[data-theme='dark'] #nav span.site-page {
  color: #888 !important;
}

[data-theme='dark'] #nav a:hover,
[data-theme='dark'] #nav span.site-page:hover {
  color: #c0c0c0 !important;
}

[data-theme='dark'] #nav .site-name {
  color: #c0c0c0 !important;
}

[data-theme='dark'] #content-inner {
  background: #1a1a1a;
}

[data-theme='dark'] .article-sort-title {
  color: #c0c0c0;
}

[data-theme='dark'] .article-sort-title a {
  color: #c0c0c0 !important;
}

[data-theme='dark'] .article-sort-title a:hover {
  color: #888 !important;
}

[data-theme='dark'] .article-meta {
  color: #666;
}

[data-theme='dark'] .article-meta a {
  color: #666 !important;
}

[data-theme='dark'] .article-meta a:hover {
  color: #888 !important;
}

[data-theme='dark'] .article-text {
  color: #888;
}

[data-theme='dark'] #footer {
  background: #1a1a1a !important;
  border-top: 1px solid #333;
  color: #666;
}

[data-theme='dark'] #footer a {
  color: #666 !important;
}

[data-theme='dark'] #footer a:hover {
  color: #888 !important;
}

[data-theme='dark'] #footer .copyright {
  color: #666;
}

[data-theme='dark'] #rightside {
  background: rgba(30,30,30,0.9);
  color: #c0c0c0;
  box-shadow: 0 2px 12px rgba(0,0,0,0.3);
}

[data-theme='dark'] #rightside button {
  color: #c0c0c0;
}

[data-theme='dark'] #rightside button:hover {
  color: #888;
}

/* 文章页样式 */
.post-content {
  max-width: 720px;
  margin: 0 auto;
  font-size: 1.05em;
}

.post-title {
  font-size: 2em;
  font-weight: 700;
  color: #333;
  border-bottom: 2px solid #333;
  padding-bottom: 15px;
  margin-bottom: 20px;
}

[data-theme='dark'] .post-title {
  color: #c0c0c0;
  border-bottom-color: #333;
}

#post-info {
  font-size: 0.9em;
  color: #999;
}

/* 文章内容 */
.post-content p {
  color: #333;
}

[data-theme='dark'] .post-content p {
  color: #c0c0c0;
}

.post-content h1,
.post-content h2,
.post-content h3,
.post-content h4 {
  color: #333;
  border-bottom: 1px solid #eee;
}

[data-theme='dark'] .post-content h1,
[data-theme='dark'] .post-content h2,
[data-theme='dark'] .post-content h3,
[data-theme='dark'] .post-content h4 {
  color: #c0c0c0;
  border-bottom-color: #333;
}

.post-content a {
  color: #333;
}

[data-theme='dark'] .post-content a {
  color: #888;
}

.post-content code {
  background: #f5f5f5;
  color: #333;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 0.9em;
}

[data-theme='dark'] .post-content code {
  background: #2a2a2a;
  color: #c0c0c0;
}

/* 代码块 - 日间模式使用浅色主题 */
[data-theme='light'] .post-content pre,
[data-theme='light'] .container figure.highlight pre,
[data-theme='light'] figure.highlight {
  background: #f6f8fa !important;
  color: #333333;
}

[data-theme='light'] .post-content pre code,
[data-theme='light'] .container figure.highlight pre code,
[data-theme='light'] figure.highlight code {
  color: #333333;
  background: transparent;
}

[data-theme='light'] .highlight-tools {
  background: #e8ecef;
  color: #666;
}

[data-theme='light'] .highlight-scrollbar {
  --hlscrollbar-bg: #d0d5da;
}

.post-content pre {
  background: #f5f5f5;
  border-radius: 8px;
}

[data-theme='dark'] .post-content pre {
  background: #2a2a2a;
}

/* 引用块 */
.post-content blockquote {
  background: #f5f5f5;
  border-left: 4px solid #ddd;
  color: #666;
}

[data-theme='dark'] .post-content blockquote {
  background: #2a2a2a;
  border-left-color: #444;
  color: #888;
}

/* 分割线 */
.post-content hr {
  border: none;
  border-top: 1px solid #eee;
}

[data-theme='dark'] .post-content hr {
  border-top-color: #333;
}

/* 表格 */
.post-content table {
  border-collapse: collapse;
  width: 100%;
}

.post-content th,
.post-content td {
  border: 1px solid #eee;
  padding: 8px 12px;
  text-align: left;
}

[data-theme='dark'] .post-content th,
[data-theme='dark'] .post-content td {
  border-color: #333;
}

.post-content th {
  background: #f5f5f5;
  font-weight: 600;
}

[data-theme='dark'] .post-content th {
  background: #2a2a2a;
  color: #c0c0c0;
}

[data-theme='dark'] .post-content td {
  color: #c0c0c0;
}

@media (max-width: 768px) {
  #content-inner {
    padding: 20px 15px;
  }
  .article-sort {
    margin-bottom: 40px;
  }
  .article-sort-title {
    font-size: 1.2em;
  }
  .post-title {
    font-size: 1.6em;
  }
}

a {
  color: #333;
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: #666;
}

::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: #fff;
}

::-webkit-scrollbar-thumb {
  background: #ddd;
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: #ccc;
}

[data-theme='dark'] ::-webkit-scrollbar-track {
  background: #1a1a1a;
}

[data-theme='dark'] ::-webkit-scrollbar-thumb {
  background: #444;
}

[data-theme='dark'] ::-webkit-scrollbar-thumb:hover {
  background: #555;
}

/* 夜间模式 - 背景处理 */
[data-theme='dark'] #web_bg {
  background-color: #1a1a1a !important;
}

[data-theme='light']
  --plaintext-color: #333333

[data-theme='light'] #web_bg {
  background-color: #ffffff !important;
}

#web_bg {
  background-color: inherit !important;
}

[data-theme='dark'] body {
  background: #1a1a1a !important;
}
