﻿/* ====== 个人博客前台公共样式（四季主题通过CSS变量注入） ====== */
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: "Microsoft YaHei", Arial, sans-serif; background: var(--theme-bg); color: #333; font-size: 14px; }
a { color: #333; text-decoration: none; }
a:hover { color: var(--theme); }
img { border: 0; vertical-align: middle; }
ul { list-style: none; }
.blog-wrap { width: 1200px; margin: 0 auto; }

/* 顶部导航 */
.blog-top { background: var(--theme); }
.blog-top .blog-wrap { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.blog-logo { display: flex; align-items: center; color: #fff; font-size: 28px; font-weight: bold; letter-spacing: 2px; }
.blog-logo .logo-icon { width: 44px; height: 44px; margin-right: 10px; object-fit: contain; }
.blog-logo span { font-size: 15px; font-weight: normal; margin-left: 10px; opacity: .85; }
.blog-nav li { display: inline-block; }
.blog-nav li a { display: block; padding: 0 22px; line-height: 64px; color: #fff; font-size: 16px; }
.blog-nav li a:hover, .blog-nav li.on a { background: var(--theme-dark); color: #fff; }

/* 主体 */
.blog-main { display: flex; gap: 16px; margin: 18px auto; align-items: flex-start; }
.blog-side-left { width: 230px; flex-shrink: 0; }
.blog-center { flex: 1; min-width: 0; }
.blog-side-right { width: 250px; flex-shrink: 0; }

.blog-box { background: #fff; border: 1px solid #e6e6e6; border-top: 3px solid var(--theme); margin-bottom: 16px; }
.blog-box h3 { padding: 10px 14px; border-bottom: 1px solid #eee; font-size: 16px; color: var(--theme-dark); background: var(--theme-light); }
.blog-box .box-bd { padding: 12px 14px; }

/* 主页中间两列 */
.blog-cols { display: flex; gap: 16px; }
.blog-cols .col { flex: 1; min-width: 0; }

/* 列表通用 */
.blog-list li { padding: 9px 2px; border-bottom: 1px dashed #e8e8e8; line-height: 20px; }
.blog-list li:last-child { border-bottom: 0; }
.blog-list .t { font-weight: bold; }
.blog-list .t a { color: var(--theme-dark); }
.blog-list .t a:hover { text-decoration: underline; }
.blog-list .m { color: #999; font-size: 12px; margin-top: 2px; }

/* 三列表格（文章列表/精选图文/留言） */
.blog-table { width: 100%; border-collapse: collapse; background: #fff; }
.blog-table th { background: var(--theme-light); color: var(--theme-dark); padding: 10px 12px; border: 1px solid #e6e6e6; font-size: 14px; }
.blog-table td { padding: 10px 12px; border: 1px solid #e6e6e6; vertical-align: top; line-height: 22px; }
.blog-table tr:nth-child(even) td { background: #fafafa; }
.blog-table .td-title { font-weight: bold; width: 26%; }
.blog-table .td-title a { color: var(--theme-dark); }
.blog-table .td-title a:hover { text-decoration: underline; }
.blog-table .td-meta { color: #999; width: 22%; font-size: 13px; }

/* 分页 */
.blog-pager { text-align: center; padding: 16px 0; }
.blog-pager a, .blog-pager span { display: inline-block; padding: 5px 12px; margin: 0 3px; border: 1px solid #ddd; background: #fff; }
.blog-pager span.cur { background: var(--theme); color: #fff; border-color: var(--theme); }
.blog-pager a:hover { border-color: var(--theme); color: var(--theme); }

/* 图片展示（位于最新文章下方，每行4张随栏宽自适应） */
.pic-grid { display: flex; flex-wrap: wrap; gap: 12px; }
.pic-grid .pic-item { width: calc(25% - 9px); box-sizing: border-box; text-align: center; }
.pic-grid img { width: 100%; height: 130px; object-fit: cover; border: 1px solid #eee; }
.pic-grid .pic-item span { display: block; font-size: 12px; color: #888; margin-top: 4px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; max-width: 100%; }
.pic-thumbs img { width: 120px; height: 160px; object-fit: cover; border: 1px solid #e5e5e5; margin-right: 8px; }

/* 图文详情页 9 宫格图片布局 */
.img-grid { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; padding: 16px 0; }
.img-grid .img-grid-item { width: calc(33.333% - 8px); box-sizing: border-box; text-align: center; }
.img-grid .img-grid-item img { width: 100%; height: 250px; object-fit: cover; border: 1px solid #eee; cursor: pointer; transition: transform 0.2s; }
.img-grid .img-grid-item img:hover { transform: scale(1.03); }

/* 左栏时间卡片：蓝紫渐变、实时时钟、日落倒计时、日出日落轨迹 */
.time-card { background: linear-gradient(135deg, #4f6ef7 0%, #7a5cf0 55%, #9a55e8 100%); border-radius: 10px; padding: 16px 18px; color: #fff; box-shadow: 0 4px 14px rgba(90, 90, 220, 0.25); }
.time-card .tc-head { display: flex; justify-content: space-between; align-items: center; font-size: 13px; }
.time-card .tc-city { font-weight: 700; font-size: 14px; }
.time-card .tc-city::before { content: "📍 "; font-size: 12px; }
.time-card .tc-zone { opacity: 0.85; font-size: 12px; }
.time-card .tc-clock { text-align: center; font-family: Consolas, "Courier New", monospace; font-size: 30px; font-weight: 700; letter-spacing: 1px; padding: 10px 0 4px; text-shadow: 0 2px 6px rgba(0,0,0,0.18); white-space: nowrap; overflow: hidden; }
.time-card .tc-clock i { font-style: normal; padding: 0 6px; opacity: 0.9; }
.time-card .tc-count { text-align: center; font-size: 11px; opacity: 0.92; padding-bottom: 10px; border-bottom: 1px solid rgba(255,255,255,0.25); white-space: nowrap; }
.time-card .tc-sun { display: flex; align-items: center; justify-content: space-between; padding-top: 10px; }
.time-card .tc-sun-item { text-align: center; flex-shrink: 0; }
.time-card .tc-sun-num { display: block; font-size: 13px; font-weight: 700; }
.time-card .tc-sun-lab { display: block; font-size: 11px; opacity: 0.8; margin-top: 2px; }
.time-card .tc-arc { flex: 1; text-align: center; min-width: 0; overflow: hidden; }
.time-card .tc-arc svg { max-width: 100%; height: auto; }
.time-card .tc-date { text-align: center; font-size: 12px; opacity: 0.85; margin-top: 8px; }

/* 搜索框 */
.search-box { padding: 14px; }
.search-box input[type=text] { width: 100%; padding: 8px 10px; border: 1px solid #ddd; outline: none; }
.search-box input[type=text]:focus { border-color: var(--theme); }
.search-box button { width: 100%; margin-top: 8px; padding: 8px 0; background: var(--theme); color: #fff; border: 0; cursor: pointer; font-size: 15px; }
.search-box button:hover { background: var(--theme-dark); }

/* 留言表单 */
.msg-form { padding: 14px; }
.msg-form table { width: 100%; }
.msg-form td { padding: 6px 4px; }
.msg-form .lbl { width: 90px; text-align: right; color: #666; }
.msg-form input[type=text] { width: 280px; padding: 7px 9px; border: 1px solid #ddd; outline: none; }
.msg-form textarea { width: 560px; height: 100px; padding: 8px; border: 1px solid #ddd; outline: none; resize: vertical; }
.msg-form input:focus, .msg-form textarea:focus { border-color: var(--theme); }
.msg-form .btn { padding: 8px 34px; background: var(--theme); color: #fff; border: 0; cursor: pointer; font-size: 15px; }
.msg-form .btn:hover { background: var(--theme-dark); }

/* 文章分类Tab切换 */
.article-tabs { display: flex; border-bottom: 2px solid #eee; }
.article-tabs .tab { padding: 10px 20px; cursor: pointer; font-size: 15px; color: #666; border-bottom: 2px solid transparent; margin-bottom: -2px; user-select: none; }
.article-tabs .tab.active { color: var(--theme); border-bottom-color: var(--theme); font-weight: 600; }
.article-tabs .tab:hover { color: var(--theme); }

/* 分类标签 */
.cat-tag { display: inline-block; padding: 1px 8px; border-radius: 3px; font-size: 12px; margin-right: 6px; vertical-align: middle; }
.cat-tag.daily { background: #e8f5e9; color: #2e7d32; }
.cat-tag.tech { background: #e3f2fd; color: #1565c0; }

/* 文章列表页分类筛选链接 */
.cat-filter { margin-right: 14px; font-size: 13px; }
.cat-filter:hover { color: var(--theme); }

/* 详情页 */
.detail-box { background: #fff; border: 1px solid #e6e6e6; border-top: 3px solid var(--theme); padding: 24px 30px; }
.detail-box h1 { font-size: 24px; text-align: center; color: #222; }
.detail-box .meta { text-align: center; color: #999; padding: 12px 0; border-bottom: 1px solid #eee; margin-bottom: 18px; font-size: 13px; }
.detail-box .content { line-height: 1.9; font-size: 15px; min-height: 120px; }
.detail-box .content img { max-width: 100%; }

/* 文章附件下载区 */
.att-box { margin-top: 20px; padding: 14px 16px; background: #f8faff; border: 1px solid #d8e4f0; border-radius: 6px; }
.att-box h3 { font-size: 15px; color: #333; margin-bottom: 10px; padding-bottom: 8px; border-bottom: 1px dashed #d8e4f0; }
.att-box ul { list-style: none; }
.att-box li { padding: 6px 0; border-bottom: 1px dotted #e8e8e8; font-size: 14px; line-height: 1.6; }
.att-box li:last-child { border-bottom: 0; }
.att-box li a { color: var(--theme-dark); font-weight: 500; }
.att-box li a:hover { color: var(--theme); text-decoration: underline; }
.att-box .att-size { color: #999; font-size: 12px; margin-left: 4px; }

/* 底部 */
.blog-footer { background: #2f3238; color: #bbb; margin-top: 24px; padding: 18px 0; }
.blog-links { padding-bottom: 10px; border-bottom: 1px solid #444; margin-bottom: 10px; }
.blog-links b { color: #ddd; margin-right: 6px; }
.blog-links a { color: #bbb; margin-right: 14px; font-size: 13px; }
.blog-links a:hover { color: #fff; }
.blog-links img { width: 16px; height: 16px; margin-right: 4px; }
.blog-copy { text-align: center; font-size: 13px; }

/* 造价小计算器（右栏内联模块） */
.calc-select { width: 100%; padding: 7px 8px; border: 1px solid #ddd; border-radius: 3px; font-size: 13px; outline: none; background: #fff; margin-bottom: 10px; }
.calc-select:focus { border-color: var(--theme); }
.calc-row { display: flex; align-items: center; margin-bottom: 8px; }
.calc-row label { width: 60px; font-size: 12px; color: #555; flex-shrink: 0; }
.calc-row input { flex: 1; padding: 5px 6px; border: 1px solid #ddd; border-radius: 3px; font-size: 12px; outline: none; min-width: 0; }
.calc-row input:focus { border-color: var(--theme); }
.calc-row span { margin-left: 4px; font-size: 11px; color: #999; width: 24px; flex-shrink: 0; }
.calc-result { margin-top: 10px; padding: 8px 10px; background: #f0f7ff; border-radius: 4px; font-size: 13px; color: #333; min-height: 20px; word-break: break-all; }
.calc-result b { color: var(--theme); font-size: 14px; }
.calc-calc-btn { display: block; width: 100%; margin-top: 10px; padding: 7px 0; background: var(--theme); color: #fff; border: 0; border-radius: 3px; cursor: pointer; font-size: 13px; font-weight: 600; }
.calc-calc-btn:hover { background: var(--theme-dark); }

/* 独立双列模块：日常分享 / 技术分享各最新5条 */
.recent-split { display: flex; gap: 16px; margin-bottom: 16px; }
.recent-col { flex: 1; min-width: 0; background: #fff; border: 1px solid #e6e6e6; border-top: 3px solid var(--theme); }
.recent-head { padding: 10px 14px; font-size: 15px; font-weight: 600; color: var(--theme-dark); display: flex; align-items: center; }
.recent-head .dot { width: 8px; height: 8px; border-radius: 50%; margin-right: 8px; flex-shrink: 0; }
.recent-head.daily .dot { background: #4caf50; }
.recent-head.tech .dot { background: #1976d2; }
.recent-head .more { margin-left: auto; font-size: 12px; font-weight: normal; color: #999; }
.recent-head .more:hover { color: var(--theme); }
.recent-list { padding: 6px 14px 10px; }
.recent-list li { display: flex; align-items: baseline; padding: 7px 0; border-bottom: 1px dashed #eee; font-size: 13px; }
.recent-list li:last-child { border-bottom: 0; }
.recent-list li a { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #333; }
.recent-list li a:hover { color: var(--theme); }
.recent-list li .r-date { margin-left: 8px; font-size: 12px; color: #bbb; flex-shrink: 0; }

/* ====== 响应式：手机端适配（max-width: 768px） ====== */

/* 汉堡菜单按钮（默认隐藏，仅手机端显示） */
.nav-toggle { display: none; cursor: pointer; font-size: 26px; color: #fff; padding: 0 10px; line-height: 64px; user-select: none; }
#nav-check { display: none; }

@media (max-width: 768px) {
  /* 容器 */
  .blog-wrap { width: 100%; padding: 0 10px; }

  /* 顶部导航 */
  .blog-top .blog-wrap { height: 50px; }
  .blog-logo { font-size: 20px; }
  .blog-logo .logo-icon { width: 32px; height: 32px; }
  .blog-logo span { font-size: 12px; margin-left: 6px; }

  /* 汉堡菜单 */
  .nav-toggle { display: block; line-height: 50px; }
  .blog-nav { display: none; position: absolute; top: 50px; left: 0; right: 0; background: var(--theme); z-index: 999; box-shadow: 0 4px 8px rgba(0,0,0,0.15); }
  .blog-nav li { display: block; border-top: 1px solid rgba(255,255,255,0.15); }
  .blog-nav li a { padding: 0 20px; line-height: 44px; font-size: 15px; }
  #nav-check:checked ~ .blog-nav { display: block; }
  .blog-top .blog-wrap { position: relative; flex-wrap: wrap; }

  /* 主体三栏变单列 */
  .blog-main { flex-direction: column; gap: 12px; margin: 10px auto; }
  .blog-side-left { width: 100%; order: 2; }
  .blog-center { width: 100%; order: 1; }
  .blog-side-right { width: 100%; order: 3; }

  /* 主页双列变单列 */
  .blog-cols { flex-direction: column; }
  .recent-split { flex-direction: column; }

  /* 图片展示：每行2张 */
  .pic-grid .pic-item { width: calc(50% - 6px); }
  .pic-grid img { height: 100px; }

  /* 图文详情九宫格：每行2张 */
  .img-grid .img-grid-item { width: calc(50% - 6px); }
  .img-grid .img-grid-item img { height: 150px; }

  /* 表格横向滚动 */
  .blog-table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; white-space: nowrap; }
  .blog-table th, .blog-table td { font-size: 13px; padding: 8px 8px; }

  /* 详情页 */
  .detail-box { padding: 16px 14px; }
  .detail-box h1 { font-size: 20px; }
  .detail-box .meta { font-size: 12px; padding: 8px 0; margin-bottom: 12px; }
  .detail-box .content { font-size: 14px; line-height: 1.8; }

  /* 附件区 */
  .att-box { padding: 10px 12px; }
  .att-box h3 { font-size: 14px; }

  /* 留言表单 */
  .msg-form input[type=text] { width: 100%; }
  .msg-form textarea { width: 100%; height: 80px; }
  .msg-form .lbl { width: 70px; font-size: 13px; }
  .msg-form table { width: 100%; }
  .msg-form td { padding: 4px 2px; }

  /* 搜索框 */
  .search-box { padding: 10px; }

  /* 分页 */
  .blog-pager { padding: 10px 0; }
  .blog-pager a, .blog-pager span { padding: 4px 8px; margin: 0 2px; font-size: 13px; }

  /* 底部 */
  .blog-footer { padding: 14px 0; margin-top: 16px; }
  .blog-links a { display: inline-block; margin-right: 10px; font-size: 12px; margin-bottom: 4px; }
  .blog-copy { font-size: 12px; }

  /* 时间卡片 */
  .time-card .tc-clock { font-size: 24px; }
  .time-card .tc-count { font-size: 10px; }
  .time-card { padding: 12px 14px; }

  /* 造价计算器 */
  .calc-row { flex-wrap: wrap; }
  .calc-row label { width: 100%; margin-bottom: 2px; }
  .calc-row input { flex: 1; }

  /* 分类标签 */
  .cat-filter { display: inline-block; margin-bottom: 6px; }

  /* 文章Tab */
  .article-tabs .tab { padding: 8px 14px; font-size: 14px; }

  /* box标题 */
  .blog-box h3 { font-size: 15px; padding: 8px 12px; }
  .blog-box .box-bd { padding: 10px 12px; }

  /* 缩略图 */
  .pic-thumbs img { width: 80px; height: 110px; }
}

@media (max-width: 480px) {
  .pic-grid .pic-item { width: calc(50% - 6px); }
  .pic-grid img { height: 80px; }
  .img-grid .img-grid-item { width: calc(50% - 6px); }
  .img-grid .img-grid-item img { height: 120px; }
  .blog-logo span { display: none; }
  .detail-box h1 { font-size: 18px; }
  .time-card .tc-clock { font-size: 20px; }
}

/* ====== 小游戏板块 ====== */
.games-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}
.game-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 8px;
    background: var(--theme-light);
    border: 1px solid var(--theme);
    border-radius: 6px;
    text-decoration: none;
    color: var(--theme-dark);
    transition: all 0.2s;
}
.game-item:hover {
    background: var(--theme);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(62,175,224,0.3);
}
.game-icon {
    font-size: 22px;
    line-height: 1;
}
.game-name {
    font-size: 13px;
    font-weight: bold;
}
