:root {
  --paper: #f5efdf;
  --paper-deep: #ebe0c9;
  --ink: #2b241e;
  --muted: #746b5e;
  --line: #ddd0b9;
  --vermilion: #9f3d2f;
  --vermilion-soft: #f0ddd4;
  --jade: #58786d;
  --indigo: #5b647e;
  --gold: #ad8650;
  --white: #fffaf0;
  --shadow: 0 14px 34px rgba(74, 56, 33, 0.11);
  --radius: 10px;
}

* { box-sizing: border-box; }
html { background: #dfe5dc; }
body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background: #d8c4a3;
  font-family: "Noto Sans SC", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; }
button:focus-visible, a:focus-visible { outline: 3px solid rgba(184, 75, 59, 0.35); outline-offset: 3px; }

.app-shell {
  width: min(100%, 480px);
  min-height: 100vh;
  margin: 0 auto;
  background: var(--paper);
  position: relative;
  padding-bottom: 84px;
  overflow-x: hidden;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 22px 14px;
  background: rgba(245, 239, 223, 0.97);
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid rgba(224, 228, 218, 0.65);
}
.brand-lockup { display: flex; align-items: center; gap: 11px; }
.brand-mark, .nav-seal {
  display: grid; place-items: center;
  width: 38px; height: 38px;
  color: var(--paper);
  background: var(--ink);
  border-radius: 50%;
  font-family: "Noto Serif SC", serif;
  font-weight: 700;
}
.brand-mark { position: relative; font-size: 17px; border: 1px solid rgba(255,255,255,.15); box-shadow: 0 0 0 4px rgba(27,36,33,.05); }
.brand-mark::after { content: ""; position: absolute; inset: -5px; border: 1px solid rgba(184, 75, 59, .38); border-radius: 50% 46% 52% 48%; transform: rotate(-13deg); pointer-events: none; }
.brand-name { margin: 0; font-family: "Noto Serif SC", serif; font-weight: 700; font-size: 20px; letter-spacing: .04em; }
.brand-subtitle { margin: 2px 0 0; color: var(--muted); font-size: 11px; letter-spacing: .08em; }
.icon-button { width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 50%; color: var(--ink); background: var(--white); display: grid; place-items: center; position: relative; cursor: pointer; }
.icon-button svg { width: 18px; }
.notification-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--vermilion); position: absolute; right: 8px; top: 7px; }

#app-main { padding: 0 18px; }
.section { margin-top: 26px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; margin-bottom: 13px; }
.section-heading h2 { margin: 0; font-family: "Noto Serif SC", serif; font-size: 21px; letter-spacing: .02em; }
.section-heading p { margin: 0; color: var(--muted); font-size: 12px; }
.text-link { color: var(--vermilion); font-size: 12px; border: 0; background: none; cursor: pointer; padding: 0; }

.hero { position: relative; height: clamp(176px, 46vw, 220px); margin: 8px 0 0; border-radius: 14px; overflow: hidden; color: var(--paper); box-shadow: var(--shadow); isolation: isolate; background: #d8c4a3; }
.hero::before { display: none; }
.hero-image { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; filter: saturate(.78) contrast(.94); }
.banner-viewport { position: absolute; inset: 0; overflow: hidden; }
.banner-track { width: 100%; height: 100%; display: flex; flex-direction: column; transition: transform .78s cubic-bezier(.22,.82,.24,1); will-change: transform; }
.banner-slide { width: 100%; height: 100%; flex: 0 0 100%; }
.banner-image { display: block; width: 100%; height: 100%; object-fit: cover; filter: saturate(.82) contrast(.96); }
.banner-controls { position: absolute; top: 50%; right: 12px; z-index: 8; display: flex; flex-direction: column; align-items: center; gap: 7px; padding: 8px 6px; border: 1px solid rgba(255,250,240,.72); border-radius: 20px; background: rgba(43,36,30,.28); transform: translateY(-50%); }
.banner-dot { width: 6px; height: 6px; padding: 0; border: 0; border-radius: 50%; background: rgba(255,250,240,.68); cursor: pointer; transform: scale(1); transition: transform .25s ease, background .25s ease, box-shadow .25s ease; }
.banner-dot.active { transform: scale(1.35); border-radius: 50%; background: #f4d99e; box-shadow: 0 0 0 2px rgba(244, 217, 158, .35); }
.hero-content { padding: 31px 25px 27px; display: flex; min-height: 0; flex-direction: column; justify-content: space-between; }
.hero-inscription { display: flex; align-items: center; gap: 9px; color: #ead7ad; font-family: "Noto Serif SC", serif; font-size: 12px; letter-spacing: .08em; }
.inscription-seal { display: inline-grid; place-items: center; width: 31px; height: 31px; border: 1px solid rgba(231,215,174,.8); border-radius: 7px; font-size: 11px; letter-spacing: 0; transform: rotate(-4deg); }
.hero h1 { margin: 12px 0 8px; max-width: 245px; font-family: "Noto Serif SC", serif; font-size: clamp(30px, 8vw, 42px); line-height: 1.16; letter-spacing: .04em; }
.hero-copy { margin: 0; color: rgba(248, 248, 244, .82); font-size: 13px; line-height: 1.8; max-width: 260px; }
.hero-cta { align-self: flex-start; display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px; border: 0; border-radius: 7px; color: var(--ink); background: #f1d59a; cursor: pointer; font-weight: 600; font-size: 12px; }
.hero-cta svg { width: 15px; }

.entry-section { position: relative; z-index: 5; margin-top: 15px; }
.entry-grid { position: relative; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 0; padding: 0; }
.entry { position: relative; width: 100%; min-height: 102px; padding: 12px 7px 10px; border: 1px solid rgba(226, 214, 191, .96); border-radius: 13px; background: rgba(255, 250, 240, .97) !important; color: var(--ink); text-align: center; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0; overflow: visible; box-shadow: 0 9px 20px rgba(59, 45, 29, .13); transition: transform .2s ease, color .2s ease, box-shadow .2s ease; }
.entry:hover { transform: translateY(-2px); color: var(--vermilion); }
.entry:active { transform: translateY(0); }
.entry-icon { width: 34px; height: 34px; flex: 0 0 auto; display: grid; place-items: center; border: 1px solid transparent; border-radius: 9px; color: var(--ink); margin-bottom: 8px; box-shadow: none; }
.entry:nth-child(1) .entry-icon { color: var(--vermilion); background: #f1dfd2; border-color: #dfc4b5; }
.entry:nth-child(2) .entry-icon { color: var(--jade); background: #e4eee7; border-color: #cbdcd1; }
.entry:nth-child(3) .entry-icon { color: var(--indigo); background: #e7e9f0; border-color: #d0d4e1; }
.entry-icon svg { width: 17px; height: 17px; }
.entry-copy { min-width: 0; max-width: 100%; text-align: center; }
.entry strong { display: block; font-family: "Noto Serif SC", serif; font-size: 13px; letter-spacing: .03em; white-space: nowrap; }
.entry small { display: block; max-width: 100%; margin-top: 3px; overflow: hidden; color: var(--muted); font-size: 10px; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }

.announcement-bar { width: 100%; margin-top: 17px; padding: 10px 11px; display: flex; align-items: center; gap: 10px; border: 1px solid #ddc9a8; border-radius: 7px; background: #f8f0df; color: var(--ink); text-align: left; cursor: pointer; }
.announcement-icon { width: 28px; height: 28px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 5px; color: var(--white); background: var(--vermilion); }
.announcement-icon svg { width: 15px; }
.announcement-copy { display: flex; align-items: baseline; gap: 9px; min-width: 0; flex: 1; }
.announcement-copy strong { font-family: "Noto Serif SC", serif; font-size: 12px; white-space: nowrap; }
.announcement-copy span { min-width: 0; overflow: hidden; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.announcement-marquee { display: block; min-width: 0; overflow: hidden; white-space: nowrap; }
.announcement-marquee-track { display: inline-flex; min-width: max-content; gap: 72px; animation: announcement-scroll 16s linear infinite; }
.announcement-marquee-track > span { color: var(--muted); font-size: 11px; white-space: nowrap; }
@keyframes announcement-scroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.announcement-arrow { width: 15px; flex: 0 0 auto; color: var(--gold); }

.exhibition-rail { display: flex; gap: 12px; overflow-x: auto; padding: 2px 0 9px; scrollbar-width: none; scroll-snap-type: x mandatory; overscroll-behavior-x: contain; }
.exhibition-rail::-webkit-scrollbar { display: none; }
.exhibition-card { min-width: 256px; display: grid; grid-template-columns: 92px 1fr; gap: 12px; padding: 10px; border: 1px solid var(--line); border-radius: 9px; background: var(--white); scroll-snap-align: start; }
.exhibition-card img { width: 92px; height: 84px; border-radius: 6px; object-fit: cover; }
.exhibition-pagination { display: flex; justify-content: center; align-items: center; gap: 5px; padding-top: 3px; }
.exhibition-dot { width: 6px; height: 6px; padding: 0; border: 0; border-radius: 50%; background: #cdbd9e; cursor: pointer; transform: scale(1); transition: transform .2s ease, background .2s ease, box-shadow .2s ease; }
.exhibition-dot.active { background: var(--vermilion); transform: scale(1.35); box-shadow: 0 0 0 2px rgba(159, 61, 47, .16); }
.card-meta { display: flex; flex-direction: column; min-width: 0; }
.eyebrow { margin: 0 0 8px; color: var(--vermilion); font-size: 10px; letter-spacing: .12em; }
.card-title { margin: 0; font-family: "Noto Serif SC", serif; font-size: 15px; line-height: 1.45; }
.card-desc { margin: 6px 0 0; color: var(--muted); font-size: 11px; line-height: 1.55; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-date { margin-top: auto; color: #8b958e; font-size: 10px; }

.post-list { display: grid; gap: 10px; }
.post-card { display: grid; grid-template-columns: 100px 1fr; gap: 14px; align-items: center; padding: 11px; border: 1px solid var(--line); border-radius: 9px; background: var(--white); }
.post-card img { width: 100px; height: 82px; border-radius: 6px; object-fit: cover; }
.post-card .card-title { font-size: 15px; }
.post-card .card-desc { -webkit-line-clamp: 2; }
.post-pagination { display: flex; align-items: center; justify-content: center; gap: 8px; padding-top: 13px; }
.page-arrow { width: 22px; height: 22px; min-width: 22px; max-width: 22px; min-height: 22px; max-height: 22px; flex: 0 0 22px; display: grid; place-items: center; padding: 0; border: 1px solid var(--line); border-radius: 50%; background: var(--white); color: var(--ink); cursor: pointer; line-height: 22px; }
.page-arrow svg { width: 13px; height: 13px; }
.page-arrow.disabled { opacity: .35; pointer-events: none; }
.page-count { min-width: 28px; color: var(--muted); font-size: 10px; text-align: center; font-variant-numeric: tabular-nums; }

.page-heading { padding: 14px 0 2px; }
.page-heading h1 { margin: 0; font-family: "Noto Serif SC", serif; font-size: 29px; line-height: 1.3; letter-spacing: .03em; }
.page-heading p { margin: 9px 0 0; color: var(--muted); font-size: 13px; line-height: 1.6; }
.library-heading { padding: 25px 2px 17px; }
.library-heading h1 { font-size: 31px; letter-spacing: .06em; }
.library-heading p { margin-top: 12px; color: #847a6b; font-size: 14px; letter-spacing: .03em; }
.filter-row { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 20px 0 16px; }
.filter-row::-webkit-scrollbar { display: none; }
.filter-chip { display: inline-flex; flex: 0 0 auto; width: auto; min-width: 0; white-space: nowrap; border: 1px solid var(--line); background: var(--white); color: var(--muted); padding: 8px 12px; border-radius: 18px; font-size: 12px; cursor: pointer; }
.filter-chip.active { color: var(--paper); border-color: var(--ink); background: var(--ink); }

.course-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.course-card { border: 1px solid var(--line); background: var(--white); border-radius: 9px; overflow: hidden; cursor: pointer; }
.course-card img { width: 100%; aspect-ratio: 1.25; object-fit: cover; display: block; }
.course-body { padding: 11px; }
.course-title { font-family: "Noto Serif SC", serif; font-size: 15px; margin: 0; }
.course-age { color: var(--muted); font-size: 11px; margin: 6px 0 10px; }
.course-bottom { display: flex; align-items: center; justify-content: space-between; }
.price { color: var(--vermilion); font-size: 15px; font-weight: 700; }
.price small { font-size: 10px; font-weight: 400; }
.round-tag { color: var(--jade); background: #e3eee9; padding: 4px 6px; border-radius: 4px; font-size: 10px; }
.teacher-tabs { display: flex; gap: 17px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.teacher-tabs::-webkit-scrollbar { display: none; }
.teacher-tab { border: 0; background: none; color: var(--muted); padding: 9px 0 10px; position: relative; white-space: nowrap; cursor: pointer; font-size: 13px; }
.teacher-tab.active { color: var(--ink); font-weight: 700; }
.teacher-tab.active::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--vermilion); }
.teacher-panel { padding: 18px 0 2px; }
.teacher-intro { display: grid; grid-template-columns: 84px 1fr; gap: 14px; align-items: start; }
.teacher-avatar { width: 84px; height: 100px; object-fit: cover; border-radius: 8px; }
.teacher-panel h3 { margin: 0 0 6px; font-family: "Noto Serif SC", serif; font-size: 18px; }
.teacher-panel p { margin: 0; color: var(--muted); line-height: 1.7; font-size: 12px; }
.teacher-works { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; margin-top: 16px; }
.teacher-works img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 5px; }

.library-list { display: grid; gap: 16px; }
.library-card { border: 1px solid #ddcfb7; background: var(--white); border-radius: 13px; overflow: hidden; box-shadow: 0 10px 24px rgba(74, 56, 33, .08); }
.library-card img { width: 100%; height: 154px; object-fit: cover; display: block; }
.library-body { padding: 17px 16px 15px; }
.library-body > .eyebrow { margin: 0 0 9px; color: var(--vermilion); font-size: 10px; letter-spacing: .13em; }
.library-card h3 { margin: 0; font-family: "Noto Serif SC", serif; font-size: 19px; line-height: 1.45; letter-spacing: .02em; }
.library-body > p:not(.eyebrow) { margin: 10px 0 0; color: var(--muted); font-size: 13px; line-height: 1.75; }
.library-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; padding-top: 13px; border-top: 1px solid #e7ddcb; }
.paid-label { color: var(--vermilion); font-size: 12px; font-weight: 600; }
.outline-button { border: 1px solid var(--ink); background: transparent; border-radius: 6px; padding: 8px 11px; font-size: 12px; cursor: pointer; }

.shop-head { display: flex; align-items: center; gap: 9px; }
.search-box { flex: 1; display: flex; align-items: center; gap: 7px; border: 1px solid var(--line); border-radius: 7px; padding: 9px 10px; background: var(--white); }
.search-box svg { width: 16px; color: var(--muted); }
.search-box input { width: 100%; border: 0; outline: none; background: transparent; font-size: 12px; }
.cart-button { border: 1px solid var(--line); background: var(--white); width: 38px; height: 38px; border-radius: 7px; display: grid; place-items: center; position: relative; cursor: pointer; }
.cart-button svg { width: 17px; }
.cart-count { position: absolute; top: -6px; right: -5px; min-width: 16px; height: 16px; border-radius: 50%; display: grid; place-items: center; font-size: 9px; color: var(--white); background: var(--vermilion); }
.product-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.product-card { background: var(--white); border: 1px solid var(--line); border-radius: 9px; overflow: hidden; }
.product-card img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; }
.product-info { padding: 10px; }
.product-info h3 { margin: 0; font-family: "Noto Serif SC", serif; font-size: 14px; }
.product-info p { margin: 4px 0 9px; color: var(--muted); font-size: 11px; }
.product-row { display: flex; align-items: center; justify-content: space-between; }
.add-button { width: 28px; height: 28px; border: 0; border-radius: 50%; background: var(--ink); color: var(--white); display: grid; place-items: center; cursor: pointer; }
.add-button svg { width: 15px; }

.order-tabs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; background: var(--paper-deep); padding: 4px; border-radius: 7px; margin: 20px 0 15px; }
.order-tab { border: 0; background: transparent; color: var(--muted); padding: 8px 2px; border-radius: 5px; font-size: 12px; cursor: pointer; }
.order-tab.active { color: var(--ink); background: var(--white); box-shadow: 0 2px 8px rgba(34, 47, 41, .06); font-weight: 600; }
.order-list { display: grid; gap: 10px; }
.order-card { border: 1px solid var(--line); border-radius: 9px; background: var(--white); padding: 14px; }
.order-head { display: flex; justify-content: space-between; gap: 10px; }
.order-head strong { font-family: "Noto Serif SC", serif; font-size: 15px; }
.status { color: var(--vermilion); font-size: 11px; }
.order-card p { margin: 7px 0 0; color: var(--muted); font-size: 12px; }
.order-foot { display: flex; justify-content: space-between; align-items: center; border-top: 1px solid var(--line); padding-top: 10px; margin-top: 12px; }
.order-number { color: #87918a; font-size: 10px; }

.profile-hero { display: flex; align-items: center; gap: 13px; padding: 18px 0 8px; }
.profile-avatar { width: 58px; height: 58px; border-radius: 50%; object-fit: cover; border: 3px solid var(--white); box-shadow: 0 0 0 1px var(--line); }
.profile-hero h1 { margin: 0; font-family: "Noto Serif SC", serif; font-size: 20px; }
.profile-hero p { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.wallet-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 9px; overflow: hidden; }
.wallet-cell { background: var(--white); padding: 13px 10px; }
.wallet-cell strong { display: block; font-family: "Noto Serif SC", serif; font-size: 18px; }
.wallet-cell span { display: block; color: var(--muted); font-size: 11px; margin-top: 5px; }
.profile-menu { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 9px; overflow: hidden; }
.profile-menu button { border: 0; background: var(--white); padding: 15px 13px; display: flex; align-items: center; gap: 11px; color: var(--ink); cursor: pointer; text-align: left; }
.profile-menu button svg { width: 17px; color: var(--jade); }
.profile-menu button span { flex: 1; font-size: 13px; }
.profile-menu button .chevron { color: #a3aba5; width: 15px; }

.bottom-nav { position: fixed; z-index: 30; bottom: 0; left: 50%; transform: translateX(-50%); width: min(100%, 480px); display: grid; grid-template-columns: repeat(5, 1fr); padding: 10px 8px max(10px, env(safe-area-inset-bottom)); background: rgba(255, 255, 255, .96); border-top: 1px solid var(--line); backdrop-filter: blur(13px); }
.nav-item { min-height: 53px; border: 0; background: transparent; color: #88928b; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; cursor: pointer; font-size: 10px; }
.nav-item svg { width: 19px; height: 19px; stroke-width: 1.8; }
.nav-item.active { color: var(--vermilion); font-weight: 600; }
.center-item { color: var(--ink); gap: 3px; }
.center-item .nav-seal { width: 34px; height: 34px; margin-top: -14px; border: 4px solid var(--paper); box-shadow: 0 0 0 1px var(--ink); }
.center-item.active .nav-seal { background: var(--vermilion); box-shadow: 0 0 0 1px var(--vermilion); color: var(--white); }

.empty-state { text-align: center; padding: 55px 20px; color: var(--muted); }
.empty-state svg { width: 31px; height: 31px; color: var(--jade); margin-bottom: 10px; }
.empty-state p { margin: 0; font-size: 13px; }

::selection { color: var(--white); background: var(--vermilion); }
* { scrollbar-color: #c9b592 transparent; scrollbar-width: thin; }

@media (min-width: 700px) {
  body { padding: 25px 0; }
  .app-shell { min-height: calc(100vh - 50px); border-radius: 14px; box-shadow: 0 20px 60px rgba(24, 37, 29, .16); }
  .bottom-nav { bottom: 25px; border-radius: 0 0 14px 14px; }
}

@media (max-width: 365px) {
  #app-main { padding: 0 14px; }
  .topbar { padding-left: 16px; padding-right: 16px; }
  .hero-content { padding-left: 20px; padding-right: 20px; }
  .hero h1 { font-size: 29px; }
  .post-card { grid-template-columns: 86px 1fr; gap: 10px; }
  .post-card img { width: 86px; height: 76px; }
}
