/* hywang.me — phase 1 minimal styles */
body {
  font-family: "Maple Mono NF CN", ui-monospace, SFMono-Regular, Menlo,
    Consolas, "PingFang SC", "Microsoft YaHei", monospace;
  max-width: 760px;
  margin: 0 auto;
  padding: 2rem 1rem;
  color: #222;
  line-height: 1.65;
}

.site-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  border-bottom: 1px solid #eee;
  padding-bottom: 1rem;
  margin-bottom: 2rem;
}

.site-name {
  font-weight: 700;
  text-decoration: none;
  color: #222;
  font-size: 1.2rem;
}

.site-header nav a {
  margin-left: 1rem;
  color: #555;
  text-decoration: none;
}

.site-header nav a:hover {
  color: #000;
}

/* ---------- Home (intro) ---------- */

.intro {
  padding: 1rem 0 2rem;
}

.intro h1 {
  font-size: 2.2rem;
  margin-bottom: 1.2rem;
}

.intro p {
  font-size: 1.05rem;
  color: #333;
}

.intro a {
  color: #5b8ec2;
  text-decoration: none;
}

.intro a:hover {
  text-decoration: underline;
}

.intro-links {
  margin-top: 1.5rem;
  color: #888;
  font-size: 0.95rem;
}

.intro-links .sep {
  margin: 0 0.6rem;
  color: #ccc;
}

.site-footer {
  margin-top: 4rem;
  padding-top: 1rem;
  border-top: 1px solid #eee;
  color: #888;
  font-size: 0.9rem;
}

.error-page {
  text-align: center;
  padding: 4rem 0;
}

.error-page h1 {
  font-size: 4rem;
  color: #888;
  margin-bottom: 0.5rem;
}

/* ---------- Blog ---------- */

.blog-list h1 {
  margin-bottom: 2rem;
}

.post-list {
  list-style: none;
  padding: 0;
}

.post-card {
  margin-bottom: 2.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid #eee;
}

.post-card h2 {
  margin: 0 0 0.4rem;
  font-size: 1.4rem;
}

.post-card h2 a {
  color: #222;
  text-decoration: none;
}

.post-card h2 a:hover {
  text-decoration: underline;
}

.post-meta {
  font-size: 0.85rem;
  color: #888;
  margin-bottom: 0.6rem;
}

.post-meta time {
  margin-right: 0.8rem;
}

.tag {
  display: inline-block;
  margin-right: 0.3rem;
  color: #5b8ec2;
  font-family: "Maple Mono NF CN", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.85rem;
}

.summary {
  margin: 0;
  color: #555;
}

.empty {
  color: #888;
  font-style: italic;
}

/* ---------- Post (detail) ---------- */

.post-header h1 {
  margin-bottom: 0.4rem;
}

.post-body {
  margin-top: 2rem;
}

.post-body h2,
.post-body h3 {
  margin-top: 2rem;
}

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

.post-body code {
  background: #f4f4f4;
  padding: 0.1rem 0.3rem;
  border-radius: 3px;
  font-size: 0.9em;
}

.post-body pre {
  background: #f4f4f4;
  padding: 1rem;
  border-radius: 4px;
  overflow-x: auto;
  font-size: 0.9rem;
  line-height: 1.5;
}

.post-body pre code {
  background: transparent;
  padding: 0;
}

.post-body blockquote {
  border-left: 3px solid #ddd;
  padding-left: 1rem;
  color: #666;
  margin: 1rem 0;
}

.post-body table {
  border-collapse: collapse;
  margin: 1rem 0;
}

.post-body th,
.post-body td {
  border: 1px solid #ddd;
  padding: 0.4rem 0.8rem;
}

.post-body th {
  background: #f8f8f8;
}

.post-body img {
  max-width: 100%;
  height: auto;
}

.post-footer {
  margin-top: 3rem;
  padding-top: 1rem;
  border-top: 1px solid #eee;
}

.back-link {
  color: #555;
  text-decoration: none;
  font-size: 0.9rem;
}

.back-link:hover {
  color: #000;
}

/* ---------- Tools index ---------- */

.tools-index h1 {
  margin-bottom: 0.5rem;
}

.tools-intro {
  color: #666;
  margin-bottom: 2rem;
}

.tool-list {
  list-style: none;
  padding: 0;
}

.tool-card {
  margin-bottom: 1.8rem;
  padding-bottom: 1.2rem;
  border-bottom: 1px solid #eee;
}

.tool-card h2 {
  margin: 0 0 0.3rem;
  font-size: 1.25rem;
}

.tool-card h2 a {
  color: #222;
  text-decoration: none;
}

.tool-card h2 a:hover {
  text-decoration: underline;
}

.tool-card .summary {
  margin: 0;
  color: #555;
  font-size: 0.95rem;
}

/* ---------- Tool page (shared) ---------- */

.tool-page {
  /* The site body already constrains max-width. */
}

.tool-header h1 {
  margin-bottom: 0.4rem;
}

.tool-summary {
  color: #666;
  margin-bottom: 1.5rem;
}

.tool-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 1rem;
}

.tool-actions button {
  font: inherit;
  padding: 0.4rem 1rem;
  border: 1px solid #ccc;
  background: #f8f8f8;
  border-radius: 4px;
  cursor: pointer;
}

.tool-actions button:hover {
  background: #efefef;
  border-color: #888;
}

.tool-actions select {
  font: inherit;
  padding: 0.3rem 0.4rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  background: #fff;
}

.tool-actions label {
  font-size: 0.9rem;
  color: #555;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.tool-io {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

@media (max-width: 600px) {
  .tool-io {
    grid-template-columns: 1fr;
  }
}

.tool-io textarea {
  width: 100%;
  min-height: 18rem;
  padding: 0.6rem 0.8rem;
  font-family: "Maple Mono NF CN", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  resize: vertical;
  background: #fafafa;
  line-height: 1.5;
}

.tool-io textarea:focus {
  outline: 2px solid #5b8ec2;
  background: #fff;
}

.tool-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

@media (max-width: 600px) {
  .tool-grid {
    grid-template-columns: 1fr;
  }
}

.tool-grid label {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.9rem;
  color: #555;
}

.tool-grid input {
  font: inherit;
  padding: 0.5rem 0.7rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-family: "Maple Mono NF CN", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.tool-grid input:focus {
  outline: 2px solid #5b8ec2;
}

.tool-result {
  margin: 1rem 0;
}

.tool-result dl {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.3rem 1rem;
  margin: 0;
  font-size: 0.9rem;
}

.tool-result dt {
  color: #888;
  font-weight: normal;
}

.tool-result dd {
  margin: 0;
  font-family: "Maple Mono NF CN", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  word-break: break-all;
}

.tool-status {
  margin: 0.5rem 0 0;
  min-height: 1.2em;
  font-size: 0.9rem;
}

.tool-status.ok {
  color: #2e7d32;
}

.tool-status.err {
  color: #c62828;
}

/* ---------- Ad slot (placeholder for future AdSense) ---------- */

.ad-slot {
  margin: 3rem 0 2rem;
  padding: 1.2rem 1.5rem;
  background: #fafafa;
  border: 1px solid #eee;
  border-radius: 4px;
}

.ad-slot-title {
  margin: 0 0 0.6rem;
  font-size: 0.85rem;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.ad-slot-links {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem 1.5rem;
}

.ad-slot-links a {
  color: #5b8ec2;
  text-decoration: none;
  font-size: 0.95rem;
}

.ad-slot-links a:hover {
  text-decoration: underline;
  color: #2c5d8e;
}

/* ---------- Blog list header (RSS link inline) ---------- */

.blog-list-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 2rem;
}

.blog-list-header h1 {
  margin: 0;
}

.rss-link {
  font-family: "Maple Mono NF CN", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.85rem;
  color: #f48d2f;
  text-decoration: none;
  border: 1px solid #f48d2f;
  padding: 0.15rem 0.5rem;
  border-radius: 3px;
}

.rss-link:hover {
  background: #f48d2f;
  color: #fff;
}
