:root {
  --bg: #f7f7f8;
  --card: #fff;
  --text: #2d2d2d;
  --muted: #6b6b6b;
  --accent: #3d6b8f;
  --border: #e4e4e7;
  --radius: 10px;
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
}

* {
  box-sizing: border-box;
}

html {
  font-size: 16px;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: 1.25rem 1rem 3rem;
}

.site-header {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.site-header .inner {
  max-width: 900px;
  margin: 0 auto;
  padding: 0.75rem 1rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.site-title {
  font-size: 1.15rem;
  font-weight: 600;
  margin: 0;
}

.site-title a {
  color: var(--text);
  text-decoration: none;
}

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

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  font-size: 0.95rem;
}

.nav a {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.nav .nav-icon {
  width: 1em;
  height: 1em;
  flex-shrink: 0;
  opacity: 0.92;
}

.card {
  background: var(--card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  padding: 1.25rem 1.35rem;
  margin-bottom: 1.25rem;
  max-width: 100%;
  box-sizing: border-box;
  overflow-x: hidden;
}

.post-list h2 {
  margin: 0 0 0.35rem;
  font-size: 1.25rem;
}

.post-meta {
  font-size: 0.875rem;
  color: var(--muted);
  margin-bottom: 0.5rem;
}

.post-meta .post-meta-share {
  display: inline;
  margin-left: 0;
  padding: 0;
  border: none;
  background: none;
  font: inherit;
  font-size: inherit;
  color: var(--accent);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.post-meta .post-meta-share:hover {
  opacity: 0.85;
}

.post-excerpt {
  color: var(--muted);
  font-size: 0.95rem;
}

.article-body {
  font-size: 1rem;
  line-height: 1.65;
  min-width: 0;
  overflow-x: hidden;
}

.article-body p {
  margin: 0 0 1rem;
}

.article-body img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 1rem auto;
  border-radius: 8px;
  box-shadow: var(--shadow);
  cursor: zoom-in;
}

.article-body .article-video-embed {
  width: 100%;
  max-width: 100%;
  margin: 1rem 0;
  border-radius: 8px;
  overflow: hidden;
  box-sizing: border-box;
  box-shadow: var(--shadow);
  background: #0f0f10;
}

.article-body .article-video-embed video {
  width: 100%;
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
  box-sizing: border-box;
  object-fit: contain;
}

.article-body video {
  width: 100%;
  max-width: 100%;
  height: auto;
  display: block;
  margin: 1rem auto;
  border-radius: 8px;
  box-shadow: var(--shadow);
  background: #0f0f10;
  box-sizing: border-box;
  object-fit: contain;
}

.article-body figcaption {
  text-align: center;
  font-size: 0.875rem;
  color: var(--muted);
  margin-top: -0.5rem;
  margin-bottom: 1rem;
}

.pagination {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}

.btn {
  display: inline-block;
  padding: 0.45rem 0.9rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  font-size: 0.9rem;
  cursor: pointer;
  text-decoration: none;
}

.btn:hover {
  border-color: var(--accent);
  text-decoration: none;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

input[type="text"]:not(.comment-form-nick__input),
input[type="email"],
input[type="password"],
textarea {
  width: 100%;
  max-width: 100%;
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font: inherit;
}

.comment-form-nick {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  margin: 0.5rem 0 0.35rem;
}

.comment-form-nick__label {
  margin: 0;
  flex: 0 0 auto;
  font-size: 0.9rem;
  color: var(--muted);
}

.comment-form-nick__input {
  width: 11rem;
  min-width: 5rem;
  max-width: 11rem;
  flex: 0 0 11rem;
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font: inherit;
  box-sizing: border-box;
}

.comment-form-nick__ip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  flex: 1 1 auto;
  min-width: 0;
  font-size: 0.85rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.comment-form-nick__ip-icon {
  flex-shrink: 0;
  opacity: 0.92;
}

@media (max-width: 520px) {
  .comment-form-nick__input {
    width: 6.25rem;
    min-width: 4rem;
    max-width: 6.25rem;
    flex: 0 0 6.25rem;
  }
}

textarea {
  min-height: 120px;
  resize: vertical;
}

label {
  display: block;
  margin: 0.5rem 0 0.25rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.comments h3 {
  margin-top: 0;
}

.comment {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
  margin-bottom: 0.65rem;
  background: #fafafa;
}

.comment .nick {
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.comment .body {
  margin-top: 0;
  white-space: pre-wrap;
  word-break: break-word;
}

.comment-bottom {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  margin-top: 0.6rem;
}

.comment-footer {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0 0.15rem;
  font-size: 0.8rem;
  color: var(--muted);
  text-align: right;
}

.comment-footer .comment-ip-line {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.comment-footer .comment-ip-icon {
  flex-shrink: 0;
  opacity: 0.92;
}

.comment-footer .comment-time-line {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.comment-footer .comment-time-icon {
  flex-shrink: 0;
  opacity: 0.92;
}

.comment-footer .comment-meta-sep {
  user-select: none;
}

.comment-footer .comment-ip,
.comment-footer .time {
  font-size: inherit;
  color: inherit;
}

.comment-nested {
  margin-left: 0.75rem;
  padding-left: 0.75rem;
  border-left: 2px solid var(--border);
}

.admin-wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1rem;
}

.admin-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--card);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
}

.admin-table th,
.admin-table td {
  padding: 0.5rem 0.65rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
  font-size: 0.9rem;
}

.admin-table tr:last-child td {
  border-bottom: none;
}

#chart-visits {
  width: 100%;
  height: 320px;
  background: var(--card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  margin-top: 1rem;
}

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 1rem;
}

.lightbox img {
  max-width: 100%;
  max-height: 100%;
  border-radius: 8px;
}

.lightbox.open {
  display: flex;
}

@media (min-width: 900px) {
  .wrap {
    max-width: 760px;
  }
}
