/* ========================================
   7kyy 博客美化 - Modern Tech Style v1.1
   ======================================== */

/* --- CSS 变量 --- */
:root {
  --accent: #6366f1;
  --accent-light: #818cf8;
  --accent-dark: #4f46e5;
  --accent-gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a855f7 100%);
  --text: #2d3748;
  --text-muted: #718096;
  --bg: #f8fafc;
  --card-bg: #fff;
  --card-hover: #fafafa;
  --border: #e2e8f0;
  --shadow: 0 1px 3px rgba(0,0,0,.04), 0 1px 2px rgba(0,0,0,.03);
  --shadow-md: 0 4px 6px rgba(0,0,0,.04), 0 2px 4px rgba(0,0,0,.03);
  --shadow-lg: 0 12px 28px rgba(0,0,0,.06), 0 4px 12px rgba(0,0,0,.04);
  --radius: 14px;
  --radius-sm: 8px;
}

/* --- 全局 --- */
body {
  background: #f0f2f5;
  background-image: 
    radial-gradient(ellipse at 20% 0%, rgba(99,102,241,.03) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 100%, rgba(139,92,246,.03) 0%, transparent 50%);
  color: var(--text);
  line-height: 1.75;
  font-size: 15px;
}

/* --- 顶栏 --- */
#header {
  background: rgba(255,255,255,.8);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border-bottom: 1px solid rgba(226,232,240,.6);
  box-shadow: 0 1px 12px rgba(0,0,0,.04);
}
.head-fixed #header {
  background: rgba(255,255,255,.88);
}

/* --- 站点标题 --- */
#logo {
  color: var(--text);
  font-weight: 800;
  letter-spacing: -0.5px;
}
#logo:hover {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* --- 导航菜单 --- */
.nav-menu a {
  color: var(--text-muted);
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 6px;
}
.nav-menu a:hover {
  color: var(--accent);
  background: rgba(99,102,241,.06);
}
.nav-menu .menu-parent ul {
  background: rgba(255,255,255,.98);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-top: 6px;
}
.nav-menu .menu-parent ul:before {
  border-bottom-color: rgba(255,255,255,.98);
}
.menu-parent ul a {
  padding: 8px 20px;
  border-radius: 0;
}

/* --- 文章卡片（列表页） --- */
.post {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 32px 36px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
  transition: transform .25s cubic-bezier(.4,0,.2,1), box-shadow .25s cubic-bezier(.4,0,.2,1);
  border: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}
.post::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--accent-gradient);
  opacity: 0;
  transition: opacity .3s;
}
.post:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-3px);
}
.post:hover::before {
  opacity: 1;
}
.post-title {
  margin: 0 0 12px;
  font-size: 1.3em;
  line-height: 1.45;
}
.post-title a {
  color: var(--text);
  font-weight: 700;
}
.post-title a:hover {
  color: var(--accent);
}
.post-meta {
  color: var(--text-muted);
  font-size: .82em;
  margin-bottom: 14px;
}
.post-meta li {
  border-left-color: var(--border);
}

/* --- 文章内容 --- */
.post-content {
  color: #4a5568;
  line-height: 1.85;
}
.post-content a {
  color: var(--accent);
  border-bottom: 1px solid rgba(99,102,241,.25);
  transition: all .2s;
}
.post-content a:hover {
  color: var(--accent-dark);
  border-bottom-color: var(--accent);
}

/* --- 单篇文章页 --- */
.one-col .post {
  padding: 40px 48px;
  box-shadow: var(--shadow-md);
}
.one-col .post:last-of-type {
  border-bottom: 1px solid var(--border);
}

/* --- 「阅读全文」按钮 --- */
.post-content .more a {
  display: inline-block;
  padding: 10px 28px;
  background: var(--accent-gradient);
  color: #fff !important;
  border-radius: 24px;
  font-weight: 600;
  font-size: .9em;
  letter-spacing: .5px;
  box-shadow: 0 4px 14px rgba(99,102,241,.35);
}
.post-content .more a:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(99,102,241,.45);
}

/* --- 代码块 --- */
pre {
  background: #1a1a2e;
  border-radius: var(--radius-sm);
  padding: 24px;
  border: 1px solid #2d2d44;
  position: relative;
}
pre::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 28px;
  background: #16213e;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  border-bottom: 1px solid #2d2d44;
}
pre code {
  color: #e2e8f0;
  background: transparent;
  padding-top: 8px;
}
code {
  background: #f1f5f9;
  color: #e11d48;
  padding: 2px 8px;
  border-radius: 5px;
  font-size: .88em;
  font-weight: 500;
}
pre code {
  color: #cdd6f4;
  padding: 0;
}

/* --- 引用块 --- */
blockquote {
  background: linear-gradient(135deg, #faf5ff, #eef2ff);
  border-left: 4px solid var(--accent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 18px 24px;
  color: #5b5f7a;
  margin: 1.2em 0;
}

/* --- 标题 --- */
h1, h2, h3, h4, h5 {
  color: var(--text);
  font-weight: 700;
  letter-spacing: -0.3px;
}
h2 {
  padding-bottom: 10px;
  border-bottom: 2px solid var(--border);
  margin-top: 2em;
}
h3 {
  color: var(--accent);
}

/* --- 分割线 --- */
.post-content hr {
  border: none;
  height: 1px;
  background: linear-gradient(to right, transparent, #cbd5e1, transparent);
  width: 70%;
  margin: 2.5em auto;
}

/* --- 标签 --- */
.post .tags a {
  display: inline-block;
  padding: 4px 14px;
  background: #eef2ff;
  color: var(--accent);
  border-radius: 20px;
  font-size: .8em;
  margin: 3px 5px 3px 0;
  font-weight: 500;
}
.post .tags a:hover {
  background: var(--accent-gradient);
  color: #fff;
  box-shadow: 0 2px 8px rgba(99,102,241,.3);
}

/* --- 分页 --- */
.page-navigator {
  margin: 40px 0;
}
.page-navigator li {
  margin: 0 4px;
}
.page-navigator a {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 8px;
  color: var(--text-muted);
  font-weight: 500;
}
.page-navigator .current a {
  background: var(--accent);
  color: #fff;
  border: none;
}
.page-navigator a:hover {
  background: #eef2ff;
  color: var(--accent);
  border: none;
}

/* --- 侧边栏 --- */
.widget {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  margin-bottom: 20px;
}
#secondary .widget-title {
  font-size: .95em;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--border);
  letter-spacing: .5px;
  text-transform: uppercase;
}
.widget a {
  color: var(--text-muted);
}
.widget a:hover {
  color: var(--accent);
  padding-left: 3px;
}
.widget-list li {
  padding: 6px 0;
  border-bottom: 1px dotted var(--border);
}
.widget-list li:last-child {
  border-bottom: none;
}
.widget-tile li {
  background: #f1f5f9;
  padding: 5px 14px;
  border-radius: 20px;
  font-size: .83em;
  margin: 3px 4px 3px 0;
}
.widget-tile li:hover {
  background: var(--accent-gradient);
  color: #fff;
  box-shadow: 0 2px 8px rgba(99,102,241,.25);
}

/* --- 关于我 Widget 特殊样式 --- */
.widget .about-widget {
  text-align: center;
}
.widget .about-widget img {
  border-radius: 50%;
  margin-bottom: 12px;
}

/* --- 评论 --- */
#comments {
  border-top: 2px solid var(--border);
}
.comment-list li {
  background: var(--card-bg);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  padding: 24px;
  margin-top: 16px;
}
.comment-list li:hover {
  box-shadow: var(--shadow-md);
}
.comment-author a {
  color: var(--accent);
  font-weight: 600;
}
.comment-by-author {
  border-left: 3px solid var(--accent) !important;
}
.author-icon {
  background: linear-gradient(135deg, transparent 30%, rgba(99,102,241,.15) 0) left,
              linear-gradient(-135deg, transparent 30%, rgba(99,102,241,.15) 0) right;
  background-size: 50% 100%;
  background-repeat: no-repeat;
}

/* --- 搜索框 --- */
#search input {
  border-bottom-color: var(--border);
}
#search input:focus {
  border-bottom-color: var(--accent);
}

/* --- 按钮 --- */
button, input[type=submit] {
  background: var(--accent-gradient);
  color: #fff;
  border-radius: var(--radius-sm);
  font-weight: 600;
  letter-spacing: .3px;
}
button:hover, input[type=submit]:hover {
  opacity: .92;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(99,102,241,.35);
}

/* --- 表单 --- */
input, textarea {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color .2s, box-shadow .2s;
}
input:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(99,102,241,.12);
}

/* --- 页脚 --- */
#footer {
  background: var(--card-bg);
  border-top: 2px solid var(--border);
  color: var(--text-muted);
  padding: 3em 0 2em;
}
#footer a, #footer .links a {
  color: var(--text-muted);
  font-weight: 500;
}
#footer a:hover, #footer .links a:hover {
  color: var(--accent);
}

/* --- 面包屑 --- */
.breadcrumbs {
  padding: 14px 0;
  font-size: .85em;
  color: var(--text-muted);
}
.breadcrumbs a {
  color: var(--accent);
}

/* --- 归档页面 --- */
#archives li {
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  margin: 4px 0;
}
#archives li:hover {
  background: #f1f5f9;
}

/* --- 友链卡片 --- */
.post-content .links a {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  color: var(--text);
  font-weight: 500;
}
.post-content .links a:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}
.l_logo img, .l_logo i {
  border-radius: 6px 0 0 6px;
}

/* --- 图片 --- */
.post-content img {
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
}

/* --- 表格 --- */
table {
  border-radius: var(--radius-sm);
  overflow: hidden;
  box-shadow: var(--shadow);
  border: none;
}
table th {
  background: var(--accent-gradient);
  color: #fff;
  font-weight: 600;
  padding: 12px 16px;
}
table td {
  background: var(--card-bg);
  padding: 10px 16px;
}

/* --- 滚动条 --- */
::-webkit-scrollbar{width:8px;height:8px}
::-webkit-scrollbar-track{background:#f1f5f9}
::-webkit-scrollbar-thumb{background:#cbd5e1;border-radius:4px}
::-webkit-scrollbar-thumb:hover{background:var(--accent-light)}

/* --- 回到顶部按钮 --- */
#cornertool li {
  border-radius: 10px;
  background: rgba(99,102,241,.85);
  box-shadow: 0 2px 12px rgba(99,102,241,.25);
}
#cornertool li:hover {
  background: var(--accent);
}

/* --- 页面入场动画 --- */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}
.post {
  animation: fadeInUp .5s ease-out both;
}
.post:nth-child(1) { animation-delay: 0s; }
.post:nth-child(2) { animation-delay: .06s; }
.post:nth-child(3) { animation-delay: .12s; }
.post:nth-child(4) { animation-delay: .18s; }
.post:nth-child(5) { animation-delay: .24s; }

/* --- 响应式 --- */
@media (max-width: 768px) {
  .post {
    padding: 20px 16px;
    border-radius: 0;
    margin-bottom: 12px;
    border-left: none;
    border-right: none;
  }
  .one-col .post {
    padding: 24px 18px;
  }
  .post-content .more a {
    padding: 8px 22px;
  }
}
