:root {
  --ink: #1a1a1a;
  --paper: #faf7f0;
  --vermillion: #c73e2e;
  --muted: #6b6558;
  --card: #ffffff;
  --line: rgba(0,0,0,.09);
}
* { box-sizing: border-box; margin: 0; }
body { font-family: Georgia, 'Noto Serif TC', 'Songti TC', serif; background: var(--paper); color: var(--ink); line-height: 1.7; }
a { color: var(--vermillion); text-decoration: none; }
a:hover { text-decoration: underline; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 22px; }
img { max-width: 100%; }

.site-head { background: var(--ink); color: #fff; position: sticky; top: 0; z-index: 50; box-shadow: 0 2px 10px rgba(0,0,0,.25); }
.site-head .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; }
.brand { display: flex; align-items: center; gap: 12px; color: #fff; }
.brand img { width: 44px; height: 44px; border-radius: 8px; background: #fff; padding: 3px; }
.brand .t { font-weight: 700; font-size: 1.05rem; line-height: 1.25; }
.brand .t small { display: block; font-size: .68rem; font-weight: 400; color: #cfc9bd; letter-spacing: .4px; }
nav.main { display: flex; gap: 4px; }
nav.main a { color: #e8e2d5; padding: 9px 13px; border-radius: 8px; font-size: .95rem; }
nav.main a:hover { background: rgba(255,255,255,.1); text-decoration: none; }
nav.main a.on { color: #fff; background: var(--vermillion); }
.nav-toggle { display: none; background: none; border: 1px solid rgba(255,255,255,.3); color: #fff; padding: 7px 12px; border-radius: 8px; cursor: pointer; font-size: .9rem; }
@media (max-width: 820px) {
  .nav-toggle { display: block; }
  nav.main { display: none; position: absolute; top: 64px; left: 0; right: 0; background: var(--ink); flex-direction: column; padding: 10px 16px 16px; }
  nav.main.open { display: flex; }
}

.hero { background: linear-gradient(135deg, #23201a 0%, #3a352b 55%, #57432e 100%); color: #fff; padding: 84px 0 76px; }
.hero .wrap { display: flex; align-items: center; gap: 40px; }
.hero h1 { font-size: 3rem; line-height: 1.15; letter-spacing: 2px; }
.hero h1 .en { font-size: 1.9rem; color: #e8c9a0; }
.hero .sub { margin: 16px 0 10px; font-size: 1.12rem; color: #efe8d8; }
.hero .en { color: #cfc6b4; font-size: .98rem; max-width: 620px; }
.hero .cta { margin-top: 26px; display: flex; gap: 14px; flex-wrap: wrap; }
.chop { height: 58px; width: auto; align-self: center; border-radius: 5px; box-shadow: 0 3px 10px rgba(0,0,0,.3); }
.badge-img { width: 240px; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 20px; flex-shrink: 0; box-shadow: 0 12px 40px rgba(0,0,0,.4); }
@media (max-width: 820px) { .hero .wrap { flex-direction: column; text-align: center; } .hero .cta { justify-content: center; } .hero h1 { font-size: 2.3rem; } }

.section { padding: 64px 0; }
.section.alt { background: #f1ecdf; }
.sec-head { text-align: center; margin-bottom: 34px; }
.sec-head .kicker { color: var(--vermillion); font-size: .8rem; letter-spacing: 2.5px; text-transform: uppercase; font-weight: 700; }
.sec-head h2 { font-size: 1.85rem; margin: 8px 0 6px; }
.sec-head p { color: var(--muted); }

.page-head { background: var(--ink); color: #fff; padding: 52px 0; text-align: center; }
.page-head h1 { font-size: 2rem; letter-spacing: 1px; }
.page-head p { color: #d8d1c2; margin-top: 8px; }

.bio { max-width: 860px; margin: 0 auto; }
.bio p { margin-bottom: 14px; }

.cv { list-style: none; max-width: 860px; margin: 0 auto; display: grid; gap: 10px; }
.cv li { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 12px 18px; }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 22px; }
.card h3 { font-size: 1.05rem; margin-bottom: 8px; }
.card p { color: var(--muted); font-size: .92rem; margin-bottom: 10px; }

.link-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; max-width: 860px; margin: 0 auto; }
.link-grid a { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 12px 16px; text-align: center; color: var(--ink); }
.link-grid a:hover { border-color: var(--vermillion); text-decoration: none; }

.book-grid { display: grid; grid-template-columns: 320px 1fr; gap: 40px; align-items: start; max-width: 980px; margin: 0 auto; }
.book-cover { border-radius: 12px; box-shadow: 0 14px 40px rgba(0,0,0,.28); }
.book-info table { width: 100%; border-collapse: collapse; }
.book-info th, .book-info td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.book-info th { white-space: nowrap; color: var(--muted); font-weight: 700; width: 130px; }
blockquote { border-left: 4px solid var(--vermillion); background: #fff; padding: 16px 20px; margin: 18px 0; border-radius: 0 10px 10px 0; font-size: 1.05rem; }

.article { max-width: 860px; margin: 0 auto; }
.article h2 { margin: 30px 0 12px; font-size: 1.45rem; }
.article h3 { margin: 22px 0 8px; font-size: 1.15rem; }
.article p { margin-bottom: 14px; }
.article .meta { color: var(--muted); font-size: .9rem; }
.note { background: #fdf3e3; border: 1px solid #e8d5b0; border-radius: 10px; padding: 14px 18px; margin: 18px 0; }

.btn { display: inline-block; padding: 12px 24px; border-radius: 10px; font-weight: 700; font-size: .98rem; }
.btn-solid { background: var(--vermillion); color: #fff; }
.btn-solid:hover { background: #a93226; text-decoration: none; }
.btn-ghost { border: 1.5px solid rgba(255,255,255,.55); color: #fff; }
.btn-ghost:hover { background: rgba(255,255,255,.12); text-decoration: none; }

/* Books by TonyTong.cc */
.books { max-width: 980px; margin: 0 auto; display: grid; gap: 72px; counter-reset: book; }
.book-item { display: grid; grid-template-columns: 175px 1fr; gap: 30px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 28px; }
.book-item .cover { width: 100%; border-radius: 4px; border: 7px solid #fff; outline: 1px solid rgba(0,0,0,.28); box-shadow: 0 10px 26px rgba(0,0,0,.28); display: block; background: #fff; }
.book-item .bnum { color: var(--vermillion); font-weight: 700; font-size: .85rem; letter-spacing: 2px; }
.book-item h3 { font-size: 1.3rem; margin: 6px 0 4px; line-height: 1.35; }
.book-link { color: inherit; text-decoration: none; border-bottom: 1px solid transparent; transition: border-color .15s ease; }
.book-link:hover { border-bottom-color: currentColor; }
.book-item .sub { color: var(--muted); margin-bottom: 12px; }
.book-item .auth { font-size: .97rem; margin-bottom: 10px; }
.book-item .bdesc { font-size: .92rem; color: var(--muted); }
.book-item .bdesc p { margin-bottom: 10px; }
.book-item .blinks { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: .9rem; }
.book-no-cover { width: 100%; aspect-ratio: 7 / 9; border-radius: 10px; background: linear-gradient(160deg, #23201a 0%, #3a352b 60%, #57432e 100%); color: #efe8d8; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 20px; box-shadow: 0 10px 30px rgba(0,0,0,.22); }
.book-no-cover .t { font-size: 1.15rem; font-weight: 700; line-height: 1.4; }
.book-no-cover .a { margin-top: 12px; font-size: .85rem; color: #cfc6b4; }
details.toc { margin-top: 12px; border: 1px solid var(--line); border-radius: 10px; padding: 12px 16px; background: var(--paper); }
details.toc summary { cursor: pointer; font-weight: 700; color: var(--vermillion); }
details.toc .toc-list { list-style: none; margin: 12px 0 4px; padding: 0; font-size: .9rem; color: var(--muted); line-height: 1.55; }
details.toc .toc-list li { padding: 4px 0 4px 16px; position: relative; border-bottom: 1px dashed var(--line); }
details.toc .toc-list li:last-child { border-bottom: none; }
details.toc .toc-list li::before { content: "—"; position: absolute; left: 0; color: var(--vermillion); }
details.toc .toc-list li.part { font-weight: 700; color: var(--ink); margin-top: 10px; padding-left: 4px; }
details.toc .toc-list li.part::before { content: none; }
details.toc .toc-list li.chap { font-weight: 600; color: var(--ink); margin-top: 6px; }
.book-item.stacked { grid-template-columns: 1fr; }
.book-item.stacked .cover { max-width: 560px; margin: 0 auto; width: 100%; }
.book-item.stacked .cover + .cover { margin-top: 18px; }
.book-item.wide { grid-template-columns: 384px 1fr; align-items: start; }
.book-item.wide .cover { max-width: 384px; }
.book-item.tall { grid-template-columns: 325px 1fr; align-items: start; }
.book-item.tall .cover { max-width: 325px; }
@media (max-width: 700px) { .book-item { grid-template-columns: 1fr; } .book-item .cover { max-width: 200px; margin: 0 auto; } .book-item.stacked .cover { max-width: 100%; } .book-item.wide { grid-template-columns: 1fr; } .book-item.wide .cover { max-width: 320px; } .book-item.tall { grid-template-columns: 1fr; } .book-item.tall .cover { max-width: 280px; } }

.site-foot { background: var(--ink); color: #b8b1a2; padding: 34px 0; margin-top: 40px; font-size: .9rem; }
.site-foot .wrap { display: flex; justify-content: space-between; gap: 18px; flex-wrap: wrap; }
.site-foot .cols { display: flex; gap: 16px; flex-wrap: wrap; }
.site-foot a { color: #e8e2d5; }

/* Afterword to RuDao — framed panel after Book 07 */
.afterword { margin-top: 30px; border: 2px solid var(--vermillion); border-radius: 16px; background: var(--card); box-shadow: 0 12px 34px rgba(0,0,0,.12); overflow: hidden; }
.afterword .aw-head { background: var(--ink); color: #fff; text-align: center; padding: 28px 24px 24px; }
.afterword .aw-head .kicker { color: #e8b9b0; font-size: .78rem; letter-spacing: 3px; text-transform: uppercase; }
.afterword .aw-head h3 { color: #fff; font-size: 1.5rem; margin: 10px 0 6px; line-height: 1.35; }
.afterword .aw-cn-title { color: #f3e9d8; font-size: 1.08rem; }
.afterword .aw-ded { color: #cfc7b8; font-size: .9rem; margin-top: 6px; }
.afterword .aw-ded a { color: #f0b9ae; }
.afterword .aw-body { padding: 30px 34px 34px; max-width: 860px; margin: 0 auto; }
.afterword .aw-body p { font-size: .96rem; line-height: 1.85; color: var(--ink); margin-bottom: 14px; text-align: justify; }
.afterword .aw-body h4 { color: var(--vermillion); font-size: 1.08rem; margin: 26px 0 10px; line-height: 1.4; }
.afterword .aw-sign { text-align: right; color: var(--muted) !important; font-style: italic; }
.afterword .aw-div { border: none; border-top: 1px dashed var(--line); margin: 26px 0; }
.afterword .aw-body hr + h4 { margin-top: 0; }
@media (max-width: 700px) { .afterword .aw-body { padding: 22px 18px; } }
.bio h3 { color: var(--vermillion); font-size: 1.15rem; margin: 26px 0 10px; line-height: 1.4; }
.bio h4 { color: var(--ink); font-size: 1.02rem; margin: 20px 0 8px; border-bottom: 1px dashed var(--line); padding-bottom: 6px; }
.bio ul { list-style: none; padding: 0; margin: 0 0 14px; }
.bio ul li { position: relative; padding: 5px 0 5px 20px; font-size: .96rem; line-height: 1.75; color: var(--ink); }
.bio ul li::before { content: "—"; position: absolute; left: 0; color: var(--vermillion); }

/* Book 06 stacked covers — smaller */
.book-item.stacked.small .cover { max-width: 280px; }
.book-item.stacked.small .cover + .cover { margin-top: 14px; }
@media (max-width: 700px) { .book-item.stacked.small .cover { max-width: 220px; } }
