/*
Theme Name: 看过剧
Theme URI: https://kanguoju.com/
Author: kanguoju.com
Author URI: https://kanguoju.com/
Description: 面向体育热点与短剧行业资讯的轻量阅读主题。兼容区块编辑器，不依赖页面构建器或第三方主题框架。
Version: 1.0.2
Requires at least: 6.3
Tested up to: 7.1
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: kanguoju
Domain Path: /languages
Tags: news, blog, one-column, custom-logo, custom-menu, featured-images, threaded-comments, translation-ready, editor-style
*/

:root {
  --bg: #f3f0e8;
  --surface: #fffcf7;
  --ink: #1b1714;
  --muted: #3f3a35;
  --line: #ddd4c6;
  --accent: #8f1d2c;
  --accent-hover: #6d1220;
  --focus: #1b1714;
  --wrap: 68rem;
  --reading: 40rem;
  --sans: "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", "Noto Sans SC", "Source Han Sans SC", "WenQuanYi Micro Hei", sans-serif;
  color-scheme: light;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 100%;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.7;
  line-break: strict;
  overflow-wrap: break-word;
  word-break: normal;
}

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

iframe {
  max-width: 100%;
  border: 0;
}

figure {
  margin: 0;
}

p,
h1,
h2,
h3,
h4,
ul,
ol {
  overflow-wrap: break-word;
}

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.16em;
}

a:visited {
  color: var(--accent-hover);
}

a:hover {
  color: var(--accent-hover);
}

:focus {
  outline: none;
}

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
  box-shadow: 0 0 0 5px var(--bg), 0 0 0 7px var(--accent);
}

::selection {
  background: var(--accent);
  color: #fff;
}

.skip-link {
  position: absolute;
  left: 0.75rem;
  top: 0.75rem;
  z-index: 1000;
  transform: translateY(-150%);
  background: var(--ink);
  color: #fff;
  text-decoration: none;
  padding: 0.7rem 1rem;
  min-height: 44px;
}

.skip-link:focus,
.skip-link:focus-visible {
  transform: none;
  color: #fff;
  outline: 2px solid #fff;
  outline-offset: 2px;
  box-shadow: 0 0 0 4px var(--accent);
}

.screen-reader-text {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.screen-reader-text:focus {
  position: static !important;
  width: auto;
  height: auto;
  margin: 0;
  clip: auto;
  white-space: normal;
  overflow: visible;
}

.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.masthead {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 1rem 1.15rem 0.9rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.25rem;
  border-bottom: 3px solid var(--ink);
}

.branding {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
  flex: 1 1 16rem;
}

.custom-logo-link {
  display: inline-flex;
  align-items: center;
  line-height: 0;
  flex: 0 0 auto;
}

.custom-logo {
  width: auto;
  height: auto;
  max-height: 3.5rem;
  max-width: 10rem;
}

.branding-text {
  min-width: 0;
}

.site-title {
  margin: 0;
  font-size: clamp(1.7rem, 3.4vw, 2.45rem);
  line-height: 1.05;
  font-weight: 800;
  letter-spacing: 0;
}

.site-title a {
  color: inherit;
  text-decoration: none;
}

.site-title a:hover,
.site-title a:focus-visible {
  color: var(--accent);
}

.site-description {
  margin: 0.3rem 0 0;
  color: var(--muted);
  font-size: 0.9375rem;
  line-height: 1.45;
}

.masthead-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  flex: 1 1 16rem;
  justify-content: flex-end;
}

.search-form {
  display: flex;
  align-items: stretch;
  gap: 0.4rem;
  flex: 1 1 14rem;
  max-width: 22rem;
  margin-left: auto;
}

.search-field,
.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea,
.post-password-form input[type="password"] {
  font: inherit;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--ink);
  border-radius: 0;
  min-height: 44px;
  padding: 0.45rem 0.7rem;
  width: 100%;
  min-width: 0;
}

.search-field::placeholder {
  color: var(--muted);
  opacity: 1;
}

.search-submit,
button,
input[type="submit"],
.comment-form .submit {
  font: inherit;
  font-weight: 700;
  color: #fff;
  background: var(--ink);
  border: 1px solid var(--ink);
  border-radius: 0;
  min-height: 44px;
  padding: 0.45rem 0.9rem;
  cursor: pointer;
  touch-action: manipulation;
  white-space: nowrap;
}

.search-submit {
  flex: 0 0 auto;
  padding-inline: 1rem;
}

.search-submit:hover,
button:hover,
input[type="submit"]:hover,
.comment-form .submit:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.nav-disclosure {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 1.15rem;
}

.menu-toggle {
  display: none;
  list-style: none;
  cursor: pointer;
  touch-action: manipulation;
  align-items: center;
  gap: 0.45rem;
  min-height: 44px;
  padding: 0.4rem 0.15rem;
  font-weight: 700;
  color: var(--ink);
}

.menu-toggle::-webkit-details-marker {
  display: none;
}

.menu-toggle::marker {
  content: "";
}

.menu-toggle::after {
  content: "";
  width: 0.5rem;
  height: 0.5rem;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(-0.15rem) rotate(45deg);
}

.nav-disclosure[open] > .menu-toggle::after {
  transform: translateY(0.15rem) rotate(-135deg);
}

.menu {
  list-style: none;
  margin: 0;
  padding: 0.15rem 0 0.4rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.1rem 0.15rem;
}

.menu a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0.35rem 0.75rem;
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
  touch-action: manipulation;
}

.menu a:hover,
.menu a:focus-visible {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.35em;
}

.menu .current-menu-item > a,
.menu .current-menu-ancestor > a,
.menu .current_page_item > a {
  color: var(--accent);
  box-shadow: inset 0 -2px 0 var(--accent);
}

.menu .sub-menu {
  list-style: none;
  margin: 0;
  padding: 0 0 0.25rem 0.8rem;
}

.site-main {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 1.4rem 1.15rem 2.5rem;
}

.page-header {
  margin-bottom: 1.25rem;
}

.page-title,
.entry-title {
  margin: 0;
  line-height: 1.28;
  font-weight: 800;
  text-wrap: pretty;
}

.page-title {
  font-size: clamp(1.45rem, 2.4vw, 1.85rem);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.page-title::after {
  content: "";
  flex: 1 1 auto;
  height: 1px;
  background: var(--ink);
}

.archive-description,
.result-count,
.empty-state,
.entry-content,
.story-excerpt,
.comment-content {
  font-size: 1.0625rem;
  line-height: 1.75;
}

.archive-description {
  margin-top: 0.75rem;
  max-width: var(--reading);
  color: var(--ink);
}

.archive-description > :first-child {
  margin-top: 0;
}

.breadcrumbs {
  margin: 0 0 0.85rem;
}

.breadcrumbs ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 0.15rem 0;
  font-size: 0.875rem;
  line-height: 1.5;
}

.breadcrumbs a {
  color: var(--muted);
  text-decoration: underline;
}

.breadcrumbs [aria-current="page"] {
  color: var(--ink);
  font-weight: 700;
}

.breadcrumbs-sep {
  margin: 0 0.4rem;
  color: var(--muted);
}

.story-list {
  display: grid;
  gap: 0;
}

.story {
  padding: 1.15rem 0;
  border-bottom: 1px solid var(--line);
  min-width: 0;
}

.story-lead {
  padding-top: 0.35rem;
  padding-bottom: 1.4rem;
}

.story-lead.has-media,
.story-card.has-media {
  display: grid;
  gap: 0.85rem;
}

.story-media-link {
  display: block;
  background: #e6e0d4;
  line-height: 0;
}

.story-media-link img,
.entry-media img {
  display: block;
  width: 100%;
  height: auto;
  background: #e6e0d4;
}

.story-media-link img {
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.entry-media {
  margin: 1.1rem 0 1.35rem;
}

.entry-media img {
  object-fit: contain;
  background: transparent;
}

.story-kicker {
  margin: 0;
  font-size: 0.8125rem;
  font-weight: 700;
  line-height: 1.4;
}

.story-kicker a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0.4rem 0.15rem;
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid currentColor;
}

.story-title {
  margin: 0;
  font-size: 1.2rem;
  line-height: 1.35;
  font-weight: 700;
}

.story-lead .story-title {
  font-size: clamp(1.55rem, 3vw, 2.35rem);
  line-height: 1.25;
}

.story-title a {
  color: inherit;
  text-decoration: none;
}

.story-title a:hover,
.story-title a:focus-visible {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

.story-excerpt {
  margin: 0.55rem 0 0;
  color: var(--ink);
}

.story-meta,
.entry-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem 0.35rem;
  align-items: baseline;
  margin: 0.6rem 0 0;
  color: var(--muted);
  font-size: 0.875rem;
  line-height: 1.5;
}

.story-meta a,
.entry-meta a {
  color: var(--muted);
  font-weight: 600;
}

.meta-sep {
  color: var(--muted);
}

.entry-single,
.entry-page,
.attachment-single,
.comments-area,
.empty-state,
.not-found {
  max-width: var(--reading);
  margin-left: auto;
  margin-right: auto;
}

.entry-title {
  font-size: clamp(1.7rem, 3.2vw, 2.4rem);
}

.entry-content {
  margin-top: 1.15rem;
}

.entry-content > *:first-child {
  margin-top: 0;
}

.entry-content > * + * {
  margin-top: 1em;
}

.entry-content h2,
.entry-content h3,
.entry-content h4 {
  line-height: 1.35;
  margin-top: 1.5em;
  text-wrap: pretty;
}

.entry-content h2 {
  font-size: 1.4rem;
}

.entry-content h3 {
  font-size: 1.2rem;
}

.entry-content h4 {
  font-size: 1.05rem;
}

.entry-content ul,
.entry-content ol {
  padding-left: 1.35em;
}

.entry-content li + li {
  margin-top: 0.35em;
}

.entry-content blockquote {
  margin: 1.3em 0;
  padding: 0.15em 0 0.15em 0.95em;
  border-left: 3px solid var(--accent);
  color: var(--ink);
}

.entry-content figcaption,
.wp-caption-text {
  margin-top: 0.4rem;
  color: var(--muted);
  font-size: 0.875rem;
  line-height: 1.5;
}

.entry-content a:visited {
  text-decoration-style: dotted;
}

.entry-content table,
.entry-content .wp-block-table {
  width: 100%;
  overflow-x: auto;
  display: block;
}

.entry-content table {
  border-collapse: collapse;
}

.entry-content th,
.entry-content td {
  border: 1px solid var(--ink);
  padding: 0.45rem 0.6rem;
  text-align: left;
  vertical-align: top;
}

.entry-content pre {
  overflow-x: auto;
  padding: 0.9rem 1rem;
  background: #efeae1;
  font-family: ui-monospace, "Sarasa Mono SC", "Noto Sans Mono CJK SC", Consolas, monospace;
  font-size: 0.9rem;
  line-height: 1.55;
}

.entry-content code {
  font-family: ui-monospace, "Sarasa Mono SC", "Noto Sans Mono CJK SC", Consolas, monospace;
  font-size: 0.92em;
}

.entry-content .alignwide,
.entry-content .alignfull {
  max-width: 100%;
}

.entry-content .aligncenter,
.entry-content .alignnone,
.entry-content .alignleft,
.entry-content .alignright {
  max-width: 100%;
  height: auto;
}

.page-links,
.entry-tags {
  margin-top: 1.4rem;
}

.author-bio,
.entry-source {
  margin-top: 1.2rem;
}

.author-bio {
  padding-top: 0.9rem;
  border-top: 1px solid var(--line);
}

.author-bio-title {
  margin: 0 0 0.35rem;
  font-size: 1rem;
}

.entry-source {
  margin-bottom: 0;
}

.entry-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.5rem;
  align-items: center;
  padding-top: 0.9rem;
  border-top: 1px solid var(--line);
}

.entry-tags-label {
  font-weight: 700;
  color: var(--ink);
}

.entry-tags a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0.2rem 0.15rem;
}

.edit-link {
  margin: 0.8rem 0 0;
  font-size: 0.875rem;
}

.related {
  margin: 2rem 0 0;
  padding-top: 0.4rem;
}

.related-title {
  margin: 0 0 0.4rem;
  font-size: 1.25rem;
}

.related .story-list {
  grid-template-columns: 1fr;
}

.pagination,
.comment-navigation .nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
  justify-content: center;
  margin-top: 1.6rem;
}

.pagination .page-numbers,
.comment-navigation a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  padding: 0.35rem 0.7rem;
  border: 1px solid var(--ink);
  color: var(--ink);
  text-decoration: none;
  background: var(--surface);
}

.pagination .page-numbers.current {
  background: var(--ink);
  color: #fff;
  font-weight: 700;
}

.pagination a.page-numbers:hover,
.comment-navigation a:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.empty-state p,
.not-found p {
  margin: 0.7rem 0;
}

.not-found .search-form,
.empty-state .search-form,
.page-header .search-form {
  margin-top: 1rem;
  max-width: 28rem;
  margin-left: 0;
}

.recent-list {
  margin-top: 1.6rem;
}

.recent-list h2 {
  margin: 0 0 0.4rem;
  font-size: 1.15rem;
}

.comments-area {
  margin-top: 2rem;
}

.comments-title,
.comment-reply-title {
  font-size: 1.25rem;
  margin: 0 0 0.8rem;
}

.comment-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.comment-list .children {
  list-style: none;
  margin: 0;
  padding: 0 0 0 0.85rem;
  border-left: 2px solid var(--line);
}

.comment-body {
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--line);
}

.comment-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.7rem;
  align-items: baseline;
  font-size: 0.875rem;
}

.comment-author {
  font-weight: 700;
  color: var(--ink);
}

.comment-author a,
.comment-metadata a {
  color: var(--muted);
}

.comment-content p {
  margin: 0.45rem 0 0;
}

.comment-awaiting {
  color: var(--accent-hover);
  font-weight: 700;
}

.comment-reply-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

.comment-form {
  margin-top: 1rem;
  display: grid;
  gap: 0.85rem;
}

.comment-form p {
  margin: 0;
}

.comment-form label {
  display: block;
  font-weight: 700;
  margin-bottom: 0.3rem;
}

.comment-form textarea {
  min-height: 9rem;
  resize: vertical;
}

.comment-form .required {
  color: var(--accent);
}

.comment-notes {
  color: var(--muted);
  font-size: 0.875rem;
}

.site-footer {
  background: var(--surface);
  border-top: 3px solid var(--ink);
  margin-top: 1rem;
}

.footer-inner {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 1.3rem 1.15rem 2rem;
}

.footer-widgets {
  display: grid;
  gap: 1.2rem;
  margin-bottom: 1rem;
}

.widget-title {
  margin: 0 0 0.45rem;
  font-size: 1rem;
}

.footer-nav .menu {
  padding-top: 0;
}

.colophon {
  margin: 0.8rem 0 0;
  color: var(--muted);
  font-size: 0.875rem;
}

.colophon a {
  color: var(--muted);
}

.post-password-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: end;
}

.post-password-form label {
  font-weight: 700;
  display: grid;
  gap: 0.3rem;
  flex: 1 1 14rem;
}

@media (min-width: 720px) {
  .story-list {
    grid-template-columns: 1fr 1fr;
    column-gap: 2rem;
  }

  .story-lead {
    grid-column: 1 / -1;
  }

  .story-lead.has-media {
    grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
    gap: 1.75rem;
    align-items: center;
  }

  .related .story-list {
    grid-template-columns: 1fr 1fr;
    column-gap: 1.25rem;
  }

  .footer-widgets {
    grid-template-columns: 1fr 1fr;
  }

  .comment-list .children {
    padding-left: 1.4rem;
  }
}

@media (min-width: 960px) {
  .related .story-list {
    grid-template-columns: 1fr 1fr 1fr;
  }
}

@media (max-width: 879px) {
  .menu {
    flex-direction: column;
    align-items: stretch;
  }

  .menu a {
    width: 100%;
  }

  .menu-toggle {
    display: flex;
    flex: 1 0 100%;
  }

  .nav-disclosure:not([open]) > .nav-panel {
    display: none;
  }

  .masthead-tools {
    flex: 1 1 100%;
    justify-content: stretch;
  }

  .search-form {
    max-width: none;
    margin-left: 0;
  }

  .nav-disclosure {
    padding-top: 0.15rem;
  }
}

@media (min-width: 880px) {
  .nav-disclosure > .menu-toggle {
    display: none;
  }

  /*
   * Closed <details> hides its panel in the UA stylesheet.
   * A more specific author rule keeps the primary menu visible
   * on wide screens without JavaScript.
   */
  .nav-disclosure:not([open]) > .nav-panel {
    display: block;
  }

  .menu {
    padding: 0;
  }

  .menu > .menu-item {
    position: relative;
  }

  .menu .sub-menu {
    position: absolute;
    z-index: 30;
    left: 0;
    top: calc(100% - 0.2rem);
    min-width: 12.5rem;
    padding: 0.35rem 0;
    background: var(--surface);
    border: 1px solid var(--ink);
    opacity: 0;
    pointer-events: none;
  }

  .menu li:hover > .sub-menu,
  .menu li:focus-within > .sub-menu {
    opacity: 1;
    pointer-events: auto;
  }

  .menu .sub-menu a {
    width: 100%;
  }
}

@media (forced-colors: active) {
  .masthead,
  .site-footer,
  .search-field,
  .pagination .page-numbers,
  .story,
  .comment-body {
    border-color: CanvasText;
  }

  :focus-visible,
  .skip-link:focus {
    outline: 2px solid Highlight;
    box-shadow: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

@media print {
  .skip-link,
  .masthead-tools,
  .nav-disclosure,
  .site-footer,
  .related,
  .comments-area,
  .edit-link,
  .pagination {
    display: none !important;
  }

  body {
    background: #fff;
    color: #000;
  }

  .site-main,
  .entry-single,
  .entry-page {
    max-width: none;
  }

  a {
    text-decoration: underline;
  }
}
