:root {
  --bg: #faf9f6;
  --card: #ffffff;
  --text: #2d2a26;
  --muted: #8a857c;
  --line: #eceae4;
  --accent: #b08968;
  --accent-dark: #8c6a4a;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  line-height: 1.7;
}

a { color: inherit; text-decoration: none; }

.wrap { max-width: 720px; margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 620px; }

.site-header {
  border-bottom: 1px solid var(--line);
  background: rgba(250, 249, 246, 0.9);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 60px;
}

.logo {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--accent-dark);
}

nav a { margin-left: 20px; color: var(--muted); font-size: 15px; }
nav a:hover { color: var(--accent-dark); }

.hero { text-align: center; padding: 52px 0 36px; }
.hero h1 { margin: 0; font-size: 30px; letter-spacing: 2px; }
.hero .sub { color: var(--muted); margin: 8px 0 0; font-size: 15px; }

.post-list { display: flex; flex-direction: column; gap: 16px; padding-bottom: 40px; }

.post-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 22px 24px;
  display: flex;
  gap: 18px;
  transition: box-shadow 0.2s, transform 0.2s;
}

.post-card:hover { box-shadow: 0 4px 18px rgba(0,0,0,0.06); transform: translateY(-1px); }

.post-card .meta { flex: 1; min-width: 0; }
.post-card h2 { margin: 0 0 6px; font-size: 19px; }
.post-card h2 a:hover { color: var(--accent-dark); }
.post-card .date { color: var(--muted); font-size: 13px; margin-bottom: 8px; }
.post-card .summary { color: #555; font-size: 14.5px; margin: 0; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }

.post-card .cover {
  width: 108px;
  height: 108px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid var(--line);
}

.loading, .empty { text-align: center; color: var(--muted); padding: 48px 0; }

.post-detail {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 36px 32px;
  margin-top: 32px;
}

.post-detail h1 { margin: 0 0 8px; font-size: 26px; }
.post-detail .date { color: var(--muted); font-size: 13.5px; margin-bottom: 24px; }
.post-detail .content p { margin: 0 0 14px; font-size: 15.5px; }
.post-detail .content img { max-width: 100%; border-radius: 8px; margin: 8px 0; }

.post-nav { text-align: center; margin: 24px 0 48px; }
.post-nav a { color: var(--muted); font-size: 14px; }
.post-nav a:hover { color: var(--accent-dark); }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 28px;
  margin-top: 48px;
}

input[type="text"], input[type="password"], textarea {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 15px;
  font-family: inherit;
  background: #fff;
  color: var(--text);
  outline: none;
}

input:focus, textarea:focus { border-color: var(--accent); }
textarea { resize: vertical; line-height: 1.8; }

button {
  cursor: pointer;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  border-radius: 8px;
  padding: 9px 20px;
  font-size: 14.5px;
  font-family: inherit;
  transition: 0.15s;
}

button:hover { border-color: var(--accent); color: var(--accent-dark); }

button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-size: 15px;
  padding: 10px 28px;
}

button.primary:hover { background: var(--accent-dark); }
button.primary:disabled { opacity: 0.55; cursor: default; }

button.danger { color: #b4443c; border-color: #e8d5d2; padding: 4px 12px; font-size: 13px; }
button.danger:hover { border-color: #b4443c; background: #fdf5f4; }

.err { color: #b4443c; font-size: 13.5px; min-height: 20px; margin: 8px 0 0; }
.ok-msg { color: #3d7a4e; font-size: 13.5px; margin: 8px 0 0; }

.hidden { display: none; }

#editor-box { margin-top: 32px; }
#editor-box h2 { font-size: 20px; margin: 0 0 16px; }
#editor-box h3 { font-size: 16px; margin: 36px 0 12px; border-top: 1px solid var(--line); padding-top: 24px; }
#title { margin-bottom: 12px; }
#content { margin-bottom: 12px; }

.upload-row { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
.upload-btn {
  cursor: pointer;
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 8px 16px;
  color: var(--muted);
  font-size: 14px;
}
.upload-btn:hover { border-color: var(--accent); color: var(--accent-dark); }
#upload-status { font-size: 13px; color: var(--muted); }

.thumbs { display: flex; flex-wrap: wrap; gap: 10px; margin: 10px 0 18px; }
.thumbs .thumb { position: relative; }
.thumbs img { width: 76px; height: 76px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }
.thumbs .rm {
  position: absolute;
  top: -7px;
  right: -7px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  border: 1px solid var(--line);
  color: #b4443c;
  font-size: 12px;
  line-height: 18px;
  text-align: center;
  padding: 0;
}

.manage-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  font-size: 14.5px;
}
.manage-item .d { color: var(--muted); font-size: 12.5px; }
.manage-item .acts { display: flex; gap: 8px; flex-shrink: 0; }

.site-footer {
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  padding: 28px 20px 40px;
}

.tabs {
  display: flex;
  gap: 8px;
  margin: 32px 0 20px;
}

.tab {
  flex: 1;
  padding: 10px 0;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  font-size: 14.5px;
}

.tab.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.panel h2 { font-size: 20px; margin: 0 0 16px; }

.form-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 4px 0 14px;
}

.form-row label { font-size: 13.5px; color: var(--muted); }

.form-row select, .form-row input[type="date"], .form-row input[type="time"], .form-row input[type="number"] {
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  background: #fff;
  color: var(--text);
  outline: none;
}

.form-row input[type="number"] { width: 80px; }
.panel .primary { margin-top: 4px; }

.badge {
  display: inline-block;
  font-size: 11.5px;
  border-radius: 20px;
  padding: 1px 9px;
  vertical-align: 1px;
  margin-left: 6px;
}

.badge.over { background: #fbeae9; color: #b4443c; }
.badge.today { background: #fdf3e4; color: #a1722a; }
.badge.done { background: #e9f2ec; color: #3d7a4e; }

.item-done .d, .item-done > div > div:first-child { color: var(--muted); }

@media (max-width: 560px) {
  .post-card { flex-direction: column-reverse; }
  .post-card .cover { width: 100%; height: 150px; }
  .post-detail { padding: 26px 20px; }
}
