/* 
Theme Name:Dasiwo
Theme URI:
Author:Dasiwo
Description:wordpress.org like theme
Version:1.0
Text Domain:dasiwo
*/

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}
html,body {
    height: 100%;
    margin:0;
}
body {
  background: #fff;
  color: #222;
  font-family: system-ui, -apple-system, sans-serif;
}


/*导航外层通栏容器*/
.nav-wrap {
  width: 100%;
  border-bottom:1px solid #ccc;
}

/*顶部导航菜单*/
.site-nav {
  display: flex;
  align-items: center;
  min-height: 60px;
  gap:24px;
  padding: 0 24px;
  max-width: 1160px;
  margin: 0 auto;
  width: 100%;
}
.site-nav .menu {
  list-style: none;
  padding-left: 0;
  display: flex;
  gap: 24px;
}
.site-nav .menu a {
  color: #222;
  text-decoration: none;
}
.site-nav .menu a:hover {
  text-decoration: underline;
}
.site-logo {
  width: 60px;
  height: 60px;
  display: block;
}
.site-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 4px;
}

/*页面内容居中：与导航同宽（1160px），左右 24px 内边距 */
.container {
  max-width: 1160px;
  margin: 48px auto;
  padding: 0 24px;
}

/* 页面标题区（列表页 / 卡片页统一） */
.page-head {
  margin: 0 0 32px;
}
.page-head__title {
  font-size: 36px;
  font-weight: 400;
  line-height: 1.2;
  color: #1e1e1e;
  margin: 0 0 10px;
  text-wrap: balance;
}
.page-head__desc {
  font-size: 16px;
  line-height: 1.625;
  color: #656a71;
  margin: 0;
}

/*博客文章列表页面*/
.post-list {
    list-style: none;
    padding:0;
}
.post-list li {
    padding: 8px 0;
    font-size:18px;
}
.post-list li a {
    color:#222;
    text-decoration:none;
}
.post-list li a:hover {
    text-decoration: underline;
}
/*页脚*/
.footer-wrap {

}
.allbox {
    min-height: 100%;
    display: flex;
    flex-direction: column;
}
.mainpart {
    flex-grow: 1;
}

/* ===== 标签页区块：wordpress.org 同款（桌面布局） ===== */
.wp-block-tabs-is-layout-flow {
  margin: 30px 0 0 !important;
}

/* 标签行：整行一条 1px 底线 */
.wp-block-tabs-is-layout-flow .wp-block-tab-list {
  display: flex !important;
  flex-wrap: nowrap !important;
  gap: 0 !important;
  border-bottom: 1px solid #d9d9d9 !important;
  border-radius: 0 !important;
  background: none !important;
  padding: 0 !important;
  margin: 0 !important;
}

/* 单个标签：透明边框占位，往上顶 1px */
.wp-block-tabs-is-layout-flow .wp-block-tab-list button {
  background: #fff !important;
  background-clip: padding-box !important;  /* ★关键：不然白底会盖住底线 */
  border: 1px solid transparent !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  color: #1e1e1e !important;
  cursor: pointer !important;
  display: block !important;
  font-family: inherit !important;
  font-size: 16px !important;
  font-weight: 400 !important;
  line-height: 1.875 !important;
  padding: 0.64rem 1.25rem !important;
  margin: 0 0 -1px !important;
  transition: background 0.2s ease !important;
  text-align: left !important;
  outline: none !important;
}

/* 干掉古腾堡自带的黑色指示线 */
.wp-block-tabs-is-layout-flow .wp-block-tab-list button::before,
.wp-block-tabs-is-layout-flow .wp-block-tab-list button::after {
  content: none !important;
  display: none !important;
}

/* hover：浅灰底 + 补齐边框 */
.wp-block-tabs-is-layout-flow .wp-block-tab-list button:hover {
  background: #f6f6f6 !important;
  border-color: #d9d9d9 !important;
}

/* ★选中：上左右有边框、下边框清零，底部多 1px 白底压住底线 */
.wp-block-tabs-is-layout-flow .wp-block-tab-list button[aria-selected="true"] {
  background: #fff !important;
  background-clip: padding-box !important;
  border: 1px solid #d9d9d9 !important;
  border-bottom: 0 !important;
  box-shadow: none !important;
  padding-bottom: calc(0.64rem + 1px) !important;
  position: relative !important;
  z-index: 2 !important;
}

.wp-block-tabs-is-layout-flow .wp-block-tab-panels {
  padding-top: 1.25rem !important;
}



/* ===== WordPress 手风琴区块：wordpress.org FAQ 同款（桌面布局） ===== */
.wp-block-accordion-item {
  border-bottom: 1px solid #d9d9d9;
  margin: 0;
}
.wp-block-accordion-item:first-child {
  border-top: 1px solid #d9d9d9;
}

.wp-block-accordion-heading {
  margin: 0;
}

/* 标题行：上下内边距 16px，标题左、箭头右 */
.wp-block-accordion-heading__toggle {
  background: transparent;
  border: 0;
  box-shadow: none;
  color: #1e1e1e;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  padding: 1rem 0;
  font-family: inherit;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.875;
  text-align: left;
  outline: none;
}
.wp-block-accordion-heading__toggle:hover {
  text-decoration: underline;
}

/* 干掉古腾堡自带图标，换成自绘细箭头 */
.wp-block-accordion-heading__toggle-icon {
  display: none !important;
}

/* 收起：1px 细 V 形箭头朝下 */
.wp-block-accordion-heading__toggle::after {
  content: "";
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-right: 1px solid #1e1e1e;
  border-bottom: 1px solid #1e1e1e;
  transform: rotate(45deg);
  transition: transform 0.22s ease;
  margin-right: 16px;
}

/* 展开：箭头翻转朝上（is-open 挂在 item 上，这点很关键） */
.wp-block-accordion-item.is-open .wp-block-accordion-heading__toggle::after {
  transform: rotate(-135deg);
}

.wp-block-accordion-panel {
  padding: 0 0 1rem;
}
.wp-block-accordion-panel p {
  margin: 0;
}


/* ===== 区块间距：主题没有 theme.json，古腾堡间距规则不会输出 ===== */
.container > * + * {
  margin-block-start: 20px;
}

.wp-block-tabs-is-layout-flow .wp-block-tab-panel > * + * {
  margin-block-start: 1rem;
}

.wp-block-accordion-panel > * + * {
  margin-block-start: 1rem;
}


/* ==========================================================================
   分类总览页卡片（page-categories.php）
   复刻 wordpress.org/support/forums/ 的真实尺寸：
   卡片 padding 20px / border 1px #d9d9d9 / radius 2px / 行列等高
   标题 #3858e9 16px 600，正文 14px/1.625，hover 底色 #f6f6f6
   ========================================================================== */

/* 区块标题（一级分类名），对应 screenshot 里的「Forums」 */
.cat-section {
  margin-bottom: 32px;
}
.cat-section__title {
  font-size: 20px;
  font-weight: 600;
  line-height: 1.2;
  color: #1e1e1e;
  margin: 0 0 20px;
}
.cat-section__title a {
  color: inherit;
  text-decoration: none;
}
.cat-section__title a:hover {
  text-decoration: underline;
}

/* 卡片网格：3 列，行列等高 */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-auto-rows: 1fr;
  gap: 10px;
  margin: 0 0 32px;
}

/* 单张卡片 */
.cat-card {
  display: block;
  background: #fff;
  border: 1px solid #d9d9d9;
  border-radius: 2px;
  padding: 20px;
  color: #1e1e1e;
  text-decoration: none;
  transition: background 0.2s ease;
}
.cat-card:hover {
  background: #f6f6f6;
  text-decoration: none;
}

/* 卡片标题（二级分类名） */
.cat-card__title {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.875;
  color: #3858e9;
  margin: 0 0 5px;
}

/* 卡片描述 */
.cat-card__desc {
  font-size: 14px;
  font-weight: 400;
  line-height: 1.625;
  color: #1e1e1e;
  margin: 0;
}


/* ==========================================================================
   文章列表（template-parts/post-list.php）
   复刻 wordpress.org/support/forum 的话题列表：
   行 padding 8px、行间 1px #d9d9d9、标题 #3858e9 16px、时间右对齐 14px
   ========================================================================== */
.topic-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border: 1px solid #d9d9d9;
}
.topic-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 8px;
  border-bottom: 1px solid #d9d9d9;
}
.topic-item:last-child {
  border-bottom: 0;
}
.topic-item__title {
  font-size: 16px;
  line-height: 1.625;
  color: #3858e9;
  text-decoration: none;
  min-width: 0;
}
.topic-item__title:hover {
  text-decoration: underline;
}
.topic-item__time {
  flex: 0 0 auto;
  font-size: 14px;
  line-height: 1.625;
  color: #656a71;
  white-space: nowrap;
}


/* ==========================================================================
   文章详情页（single.php）
   单栏：标题 + 作者 + 正文 + 文末分类/标签胶囊
   宽度跟随 .container，所有页面内容宽度一致
   ========================================================================== */
.post-single {
  width: 100%;
}
.post-single__title {
  font-size: 36px;
  font-weight: 400;
  line-height: 1.2;
  color: #1e1e1e;
  margin: 0 0 20px;
}
.post-single__main {
  border: 1px solid #d9d9d9;
  border-radius: 2px;
  padding: 20px;
}
.post-single__author {
  font-size: 16px;
  line-height: 1.625;
  color: #3858e9;
  margin: 0 0 20px;
}
.post-single__content {
  font-size: 16px;
  line-height: 1.875;
  color: #1e1e1e;
}

/* 文末：分类 / 标签，用胶囊样式 */
.post-single__terms {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px solid #d9d9d9;
}
.post-terms {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.post-terms__label {
  font-size: 14px;
  line-height: 1.625;
  color: #656a71;
  margin-right: 2px;
}

/* 胶囊（分类与标签共用） */
.post-tag {
  display: inline-block;
  background: #eff2ff;
  border-radius: 2px;
  padding: 3px 6px;
  font-size: 12px;
  line-height: 1.67;
  color: #1e1e1e;
  text-decoration: none;
}
.post-tag:hover {
  text-decoration: underline;
}


/* ==========================================================================
   正文基础区块排版
   数值来源：wordpress.org 主题 global-styles（wporg-parent-2021 / wporg-plugins-2024）
   + requirements 页与 developer 文档页的实测计算样式
   正文：Inter 16px / 行高 1.875 / #1e1e1e
   ========================================================================== */
.post-single__content p,
.post-single__content li,
.post-single__content td,
.post-single__content th {
  font-size: 16px;
  line-height: 1.875;
  color: #1e1e1e;
}
.post-single__content p {
  margin: 20px 0;
}

/* 标题：h2 24px/600，h3 20px/600，h4 18px/600，h5 18px/400，h6 18px/400 */
.post-single__content h2,
.post-single__content h3,
.post-single__content h4,
.post-single__content h5,
.post-single__content h6 {
  line-height: 1.2;
  color: #1e1e1e;
  margin: 32px 0 20px;
  text-wrap: balance;
}
.post-single__content h2 {
  font-size: 24px;
  font-weight: 600;
}
.post-single__content h3 {
  font-size: 20px;
  font-weight: 600;
}
.post-single__content h4 {
  font-size: 18px;
  font-weight: 600;
}
.post-single__content h5 {
  font-size: 18px;
  font-weight: 400;
}
.post-single__content h6 {
  font-size: 18px;
  font-weight: 400;
}

/* 链接：蓝莓蓝 + 下划线，hover 去掉下划线（原站就是反过来） */
.post-single__content a {
  color: #3858e9;
  text-decoration: underline;
}
.post-single__content a:hover {
  text-decoration: none;
}

/* 加粗 / 斜体 */
.post-single__content strong,
.post-single__content b {
  font-weight: 700;
}
.post-single__content em,
.post-single__content i {
  font-style: italic;
}

/* 列表：左边距 30px，条目上下 4px */
.post-single__content ul,
.post-single__content ol {
  margin: 20px 0;
  padding-left: 30px;
}
.post-single__content li {
  margin: 4px 0;
}

/* 手风琴标题本身是 h2/h3，不能吃到正文标题的上下间距（否则每项都被撑开） */
.post-single__content .wp-block-accordion-heading {
  margin: 0;
}

/* 引用块：灰字 + 左侧 3px 深蓝竖线 + 左缩进 30px */
.post-single__content .wp-block-quote,
.post-single__content blockquote {
  margin: 30px 0;
  padding: 0 0 0 30px;
  border-left: 3px solid #213fd4;
  color: #656a71;
  font-size: 16px;
  line-height: 1.875;
}
.post-single__content .wp-block-quote cite,
.post-single__content blockquote cite {
  display: block;
  margin-top: 10px;
  font-size: 14px;
  font-style: normal;
  color: #656a71;
}

/* 分隔线：150px 居中（原站 separator 宽度就是 150px） */
.post-single__content .wp-block-separator,
.post-single__content hr {
  border: 0;
  border-top: 1px solid #d9d9d9;
  max-width: 150px;
  margin: 30px auto;
}

/* 行内代码 */
.post-single__content code {
  display: inline-block;
  background: #f6f6f6;
  border-radius: 2px;
  padding: 0 3px;
  font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 15px;
  line-height: 1.67;
  color: #1e1e1e;
  max-width: 100%;
}

/* 代码块：#f7f7f7 底、1px #d9d9d9 边、20px 内边距、2px 圆角 */
.post-single__content .wp-block-code,
.post-single__content pre {
  background: #f7f7f7;
  border: 1px solid #d9d9d9;
  border-radius: 2px;
  padding: 20px;
  margin: 20px 0;
  overflow-x: auto;
  font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 15px;
  line-height: 1.875;
  color: #1e1e1e;
  white-space: pre;
}
/* 代码块里的 code 不要再套一层灰底 */
.post-single__content .wp-block-code code,
.post-single__content pre code {
  display: block;
  background: none;
  border: 0;
  border-radius: 0;
  padding: 0;
  font-size: inherit;
  line-height: inherit;
  white-space: inherit;
}

/* 表格：单元格 1px #d9d9d9 边、10px 内边距、顶端对齐、表头加粗加浅灰底 */
.post-single__content .wp-block-table {
  margin: 20px 0;
  overflow-x: auto;
}
.post-single__content .wp-block-table table,
.post-single__content table {
  border-collapse: collapse;
  width: 100%;
  font-size: 16px;
}
.post-single__content .wp-block-table th,
.post-single__content .wp-block-table td,
.post-single__content table th,
.post-single__content table td {
  border: 1px solid #d9d9d9;
  padding: 10px;
  vertical-align: top;
  text-align: left;
  line-height: 1.875;
}
.post-single__content .wp-block-table th,
.post-single__content table th {
  font-weight: 700;
  background: #f6f6f6;
}
.post-single__content .wp-block-table figcaption,
.post-single__content figure figcaption {
  color: #656a71;
  font-size: 14px;
  margin: 10px 0;
}

/* 图片 */
.post-single__content img {
  max-width: 100%;
  height: auto;
}

/* 按钮：蓝莓蓝实底，14px 32px 内边距，2px 圆角，字重 600 */
.post-single__content .wp-block-button__link {
  display: inline-block;
  background: #3858e9;
  border: 0;
  border-radius: 2px;
  color: #fff;
  font-family: inherit;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.3;
  padding: 14px 32px;
  text-decoration: none;
}
.post-single__content .wp-block-button__link:hover {
  background: #213fd4;
  text-decoration: none;
}

/* 文件下载块 */
.post-single__content .wp-block-file {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  background: #f6f6f6;
  border: 1px solid #d9d9d9;
  border-radius: 2px;
  padding: 15px;
  margin: 20px 0;
  font-size: 16px;
}
.post-single__content .wp-block-file a {
  text-decoration: none;
}
.post-single__content .wp-block-file .wp-block-file__button {
  background: #3858e9;
  border-radius: 2px;
  color: #fff;
  font-size: 14px;
  padding: 8px 16px;
  text-decoration: none;
}


/* ==========================================================================
   响应式：参照 wordpress.org 的做法
   平板 ≤960px：文章页两栏上下堆叠，卡片两列
   手机 ≤600px：容器内边距收到 16px、标题降到 26px、卡片单列、导航横向滚动
   （内容宽度统一跟随 .container，正文行高保持 1.875）
   ========================================================================== */
@media (max-width: 960px) {
  .container {
    margin: 32px auto;
  }
  /* 卡片网格：3 列 → 2 列 */
  .cat-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  /* 导航：不再换行，横向可滑动 */
  .site-nav {
    min-height: 56px;
    gap: 16px;
    padding: 0 16px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .site-nav .menu {
    gap: 16px;
    flex-shrink: 0;
    font-size: 14px;
    white-space: nowrap;
  }
  .site-logo {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
  }

  /* 容器边距收紧 */
  .container {
    margin: 24px auto;
    padding: 0 16px;
  }

  /* 标题字号下调 */
  .page-head__title,
  .post-single__title {
    font-size: 26px;
  }
  .post-single__content h2 {
    font-size: 22px;
  }
  .post-single__content h3 {
    font-size: 18px;
  }

  /* 正文内边距与字号 */
  .post-single__main {
    padding: 16px;
  }
  .post-single__content {
    font-size: 16px;
    line-height: 1.75;
  }
  .post-single__content p {
    margin: 16px 0;
  }

  /* 卡片单列 */
  .cat-grid {
    grid-template-columns: 1fr;
  }

  /* 列表行 */
  .topic-item {
    padding: 10px 8px;
    gap: 10px;
  }
  .topic-item__title {
    font-size: 15px;
  }
  .topic-item__time {
    font-size: 13px;
  }

  /* 表格 / 代码块横向滚动，不撑破页面 */
  .post-single__content .wp-block-table,
  .post-single__content .wp-block-code,
  .post-single__content pre {
    max-width: 100%;
    -webkit-overflow-scrolling: touch;
  }
  .post-single__content .wp-block-code,
  .post-single__content pre {
    padding: 16px;
    font-size: 14px;
  }
}
