@import url('https://fonts.googleapis.com/css2?family=Noto+Naskh+Arabic:wght@400;500;600;700&family=Noto+Sans+Arabic:wght@300;400;500;700&display=swap');

:root{
  --paper:#f5e6c8;
  --paper-2:#fbf3e2;
  --gold:#d4a574;
  --ink:#262117;
  --ink-soft:#4a4033;
  --glass:rgba(255,251,240,.46);
  --line:rgba(38,33,23,.16);
  --shadow:0 14px 30px rgba(38,33,23,.14);
}

*,*::before,*::after{ box-sizing:border-box; }

html{
  scroll-behavior:smooth;
  -webkit-text-size-adjust:100%;
  background:var(--paper);
  overflow-x:hidden;
  overflow-x:clip;
  max-width:100%;
}

body{
  margin:0;
  padding-bottom:104px;
  min-height:100vh;
  width:100%;
  max-width:100%;
  color:var(--ink);
  background:
    radial-gradient(90% 60% at 50% -10%, #fdf6e6 0%, rgba(253,246,230,0) 60%),
    var(--paper);
  font-family:"Noto Naskh Arabic","Noto Sans Arabic","Songti SC","Noto Serif SC",Georgia,"Times New Roman",serif;
  font-size:17px;
  line-height:1.75;
  overflow-x:hidden;
  overflow-x:clip;
}

img,svg,video,canvas,iframe{ max-width:100%; }

img{ height:auto; }

menu,ul{ margin:0; padding:0; list-style:none; }

a{ -webkit-tap-highlight-color:transparent; }

/* 胶片颗粒 */
body::before{
  content:"";
  position:fixed;
  inset:0;
  z-index:9;
  pointer-events:none;
  opacity:.2;
  mix-blend-mode:multiply;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23g)' opacity='0.55'/%3E%3C/svg%3E");
}

/* 光漏 */
body::after{
  content:"";
  position:fixed;
  inset:0;
  z-index:8;
  pointer-events:none;
  opacity:.55;
  background:
    radial-gradient(58% 40% at 84% 6%, rgba(255,226,160,.6), transparent 62%),
    radial-gradient(50% 38% at 6% 92%, rgba(224,152,96,.32), transparent 70%);
  animation:leak 19s ease-in-out infinite alternate;
}

@keyframes leak{
  from{ transform:translate3d(0,0,0) scale(1); }
  to{ transform:translate3d(-2%,1.6%,0) scale(1.04); }
}

/* ——— 底部固定条 / 全屏遮罩 ——— */
.dock{
  position:fixed;
  left:0;
  right:0;
  bottom:0;
  z-index:40;
  width:100%;
  max-width:100%;
  display:grid;
  grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);
  align-items:center;
  gap:8px;
  padding:8px 12px calc(8px + env(safe-area-inset-bottom));
  background:rgba(33,28,19,.95);
  color:var(--paper);
  border-top:1px solid rgba(212,165,116,.42);
  box-shadow:0 -8px 26px rgba(38,33,23,.24);
  backdrop-filter:blur(10px) saturate(1.2);
  -webkit-backdrop-filter:blur(10px) saturate(1.2);
}

.dock[open]{
  top:0;
  display:flex;
  flex-direction:column;
  gap:0;
  max-height:100dvh;
  padding:16px 18px calc(16px + env(safe-area-inset-bottom));
  overflow-y:auto;
  overflow-x:hidden;
  background:rgba(26,22,14,.985);
  border-top:0;
}

.dock-top{
  grid-column:2;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:10px;
  min-height:44px;
  max-width:100%;
  padding:6px 12px;
  list-style:none;
  cursor:pointer;
  border:1px solid transparent;
  border-radius:12px;
  font-size:1rem;
  letter-spacing:.24em;
}

.dock-top::-webkit-details-marker{ display:none; }

.dock-top:hover{ border-color:rgba(212,165,116,.5); }

.dock-top .word{ white-space:nowrap; }

.lines{ display:inline-flex; flex-direction:column; gap:3px; flex:none; }

.lines i{ display:block; width:18px; height:2px; background:currentColor; }

.dock[open] .dock-top{
  order:9;
  grid-column:auto;
  margin-top:20px;
  padding-top:16px;
  border:0;
  border-top:1px solid rgba(212,165,116,.3);
  border-radius:0;
}

.search{ display:none; gap:8px; margin:2px 0 14px; min-width:0; }

.dock[open] .search{ display:flex; }

.search input{
  flex:1 1 auto;
  min-width:0;
  min-height:46px;
  padding:0 14px;
  border-radius:12px;
  border:1px solid rgba(212,165,116,.55);
  background:rgba(245,230,200,.08);
  color:var(--paper);
  font:inherit;
}

.search input::placeholder{ color:rgba(245,230,200,.6); }

.dock-menu{ display:none; gap:2px; min-width:0; }

.dock-menu.dock-left{ grid-column:1; justify-self:start; }
.dock-menu.dock-right{ grid-column:3; justify-self:end; }

.dock-menu a{
  display:flex;
  align-items:center;
  min-height:40px;
  padding:6px 9px;
  border-radius:10px;
  color:var(--paper);
  text-decoration:none;
  font-size:.88rem;
  white-space:nowrap;
}

.dock-menu a:hover{ background:rgba(212,165,116,.22); }

@media (min-width:880px){
  .dock-menu{ display:flex; }
}

.dock[open] .dock-menu{
  display:flex;
  flex-direction:column;
  gap:0;
  width:100%;
  grid-column:auto;
  justify-self:stretch;
}

.dock[open] .dock-menu a{
  min-height:52px;
  padding:10px 6px;
  font-size:1.28rem;
  border-bottom:1px solid rgba(245,230,200,.13);
  border-radius:0;
  white-space:normal;
}

/* ——— hero ——— */
.hero{
  position:relative;
  display:grid;
  gap:28px;
  align-content:center;
  width:100%;
  max-width:1120px;
  margin:0 auto;
  min-height:70vh;
  padding:40px 20px 68px;
}

.hero::after{
  content:"";
  position:absolute;
  left:0;
  right:0;
  bottom:-26px;
  height:56px;
  z-index:0;
  pointer-events:none;
  background:linear-gradient(96deg,rgba(212,165,116,.92),rgba(212,165,116,.28) 58%,rgba(212,165,116,0));
  transform:skewY(-3deg);
}

.hero-copy,
.hero-collage{
  position:relative;
  z-index:1;
  min-width:0;
  max-width:100%;
}

.hero-copy h1{
  margin:0;
  text-align:right;
  font-size:clamp(1.85rem,6.2vw,3.2rem);
  line-height:1.3;
  letter-spacing:.03em;
  overflow-wrap:break-word;
  animation:vhs 9s steps(1) infinite;
}

@keyframes vhs{
  0%,95%{ transform:none; }
  96%{ transform:translateX(1px) skewX(-.7deg); }
  97%{ transform:translateX(-1.5px); }
  98%{ transform:translateX(1px); }
  99%{ transform:none; }
}

@media (min-width:860px){
  .hero{
    grid-template-columns:1.05fr .95fr;
    align-items:center;
    padding:58px 40px 84px;
  }
}

.hero-collage{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(108px,1fr));
  gap:12px;
  align-items:start;
  transform:translateY(var(--py,0));
  will-change:transform;
}

.shot{
  min-width:0;
  padding:8px 8px 22px;
  background:#fffdf5;
  border-radius:3px;
  box-shadow:0 16px 30px rgba(38,33,23,.26);
  transform:rotate(-2.4deg);
}

.shot:nth-child(2){ transform:rotate(2.6deg) translateY(18px); }

.shot-img{
  display:block;
  width:100%;
  max-width:100%;
  height:auto;
  filter:sepia(.35) contrast(1.03) saturate(.82);
}

/* ——— 正文容器 ——— */
.wrap{
  width:100%;
  max-width:1120px;
  margin:0 auto;
  padding:0 20px 44px;
}

.body-grid{
  display:grid;
  grid-template-columns:minmax(0,1fr);
  gap:26px;
  min-width:0;
}

@media (min-width:900px){
  .body-grid{
    grid-template-columns:minmax(0,1fr) 268px;
    align-items:start;
  }
}

.prose{
  min-width:0;
  max-width:100%;
  overflow-wrap:break-word;
  word-break:break-word;
}

.prose > section{
  margin:0 0 26px;
  padding:24px 20px;
  min-width:0;
  background:var(--glass);
  border:1px solid rgba(255,255,255,.6);
  border-radius:18px;
  box-shadow:var(--shadow);
  scroll-margin-top:26px;
  backdrop-filter:blur(10px) saturate(1.08);
  -webkit-backdrop-filter:blur(10px) saturate(1.08);
}

.prose > section:first-child{ margin-top:0; }

.prose h2{
  margin:1.5em 0 .45em;
  font-size:1.42rem;
  line-height:1.45;
  letter-spacing:.02em;
  color:var(--ink);
}

.prose h2:first-child{ margin-top:0; }

.prose h3{
  margin:1.35em 0 .4em;
  font-size:1.16rem;
  line-height:1.5;
}

.prose p{ margin:0 0 1.05em; color:var(--ink-soft); }

.prose ul,
.prose ol{ margin:0 0 1.1em; padding-left:1.3em; color:var(--ink-soft); }

.prose ul{ list-style:square; }

.prose ol{ list-style:decimal; }

.prose li{ margin:.4em 0; }

.prose strong{ color:var(--ink); }

.prose a{
  color:#8a5a24;
  text-decoration:none;
  border-bottom:1px solid rgba(138,90,36,.4);
  overflow-wrap:break-word;
}

.prose a:hover{ border-bottom-color:#8a5a24; }

.prose blockquote{
  margin:1.2em 0;
  padding:12px 16px;
  border-left:3px solid var(--gold);
  border-radius:0 14px 14px 0;
  background:rgba(212,165,116,.17);
  color:var(--ink);
}

.prose img{
  display:block;
  height:auto;
  max-width:100%;
  border-radius:12px;
  filter:sepia(.2) saturate(.9);
}

.prose pre,
.prose table{
  display:block;
  width:100%;
  max-width:100%;
  overflow-x:auto;
  -webkit-overflow-scrolling:touch;
}

.prose pre{ padding:12px 14px; border-radius:12px; background:rgba(38,33,23,.08); }

.prose table{ border-collapse:collapse; }

.prose hr,
.side hr{
  border:0;
  height:2px;
  margin:.4em 0 1.2em;
  background:linear-gradient(90deg,var(--gold),rgba(212,165,116,0));
}

/* ——— 侧栏 ——— */
.side{
  min-width:0;
  max-width:100%;
  padding:18px 16px;
  background:var(--glass);
  border:1px solid rgba(255,255,255,.6);
  border-radius:18px;
  box-shadow:var(--shadow);
  backdrop-filter:blur(10px);
  -webkit-backdrop-filter:blur(10px);
}

@media (min-width:900px){
  .side{ position:sticky; top:18px; }
}

.side-title{
  margin:0 0 8px;
  font-size:1.05rem;
  letter-spacing:.16em;
}

.side hr{ margin:0 0 10px; }

.side-list{ min-width:0; }

.side-list a{
  display:flex;
  align-items:center;
  min-height:40px;
  padding:6px 8px;
  color:var(--ink-soft);
  text-decoration:none;
  font-size:.95rem;
  border-bottom:1px dashed var(--line);
  overflow-wrap:break-word;
}

.side-list a:hover{ color:#8a5a24; }

.top-link{
  display:inline-flex;
  align-items:center;
  min-height:40px;
  margin-top:12px;
  padding:0 14px;
  border-radius:999px;
  background:rgba(38,33,23,.9);
  color:var(--paper);
  text-decoration:none;
  font-size:.86rem;
}

/* ——— 页脚 ——— */
.foot{
  margin-top:34px;
  padding:46px 22px 28px;
  background:linear-gradient(180deg,#211c13,#191510);
  color:var(--paper);
  overflow-x:clip;
}

.foot-grid{
  display:grid;
  gap:26px;
  max-width:1040px;
  margin:0 auto;
  min-width:0;
}

@media (min-width:760px){
  .foot-grid{ grid-template-columns:1.15fr 1fr; align-items:start; }
}

.foot-brand{
  font-style:normal;
  min-width:0;
  overflow-wrap:break-word;
}

.foot-sign{
  display:inline-block;
  padding-bottom:8px;
  border-bottom:2px solid rgba(212,165,116,.55);
  color:var(--gold);
  font-size:1.2rem;
  letter-spacing:.3em;
}

.foot-brand p{
  max-width:34ch;
  margin:14px 0 0;
  color:rgba(245,230,200,.74);
  font-size:.95rem;
}

.foot-nav{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:0 14px;
  min-width:0;
}

.foot-nav a{
  display:flex;
  align-items:center;
  min-height:44px;
  padding:4px 0;
  color:rgba(245,230,200,.88);
  text-decoration:none;
  font-size:.94rem;
  border-bottom:1px solid rgba(245,230,200,.13);
  overflow-wrap:break-word;
}

.foot-nav a:hover{ color:var(--gold); }

.sub{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  max-width:1040px;
  margin:30px auto 0;
  min-width:0;
}

.sub input{
  flex:1 1 200px;
  min-width:0;
  min-height:46px;
  padding:0 14px;
  border-radius:12px;
  border:1px solid rgba(212,165,116,.5);
  background:rgba(245,230,200,.07);
  color:var(--paper);
  font:inherit;
}

.sub input::placeholder{ color:rgba(245,230,200,.55); }

.sub button{
  flex:0 0 auto;
  min-height:46px;
  padding:0 22px;
  border:0;
  border-radius:12px;
  background:var(--gold);
  color:#241d13;
  font:inherit;
  font-weight:600;
  cursor:pointer;
}

.copy{
  max-width:1040px;
  margin:26px auto 0;
  padding-top:16px;
  border-top:1px solid rgba(245,230,200,.14);
  color:rgba(245,230,200,.62);
  font-size:.84rem;
  text-align:center;
}

/* ——— 滚动显现 ——— */
.rv{
  opacity:0;
  transform:translateY(14px);
  transition:opacity .62s ease,transform .62s ease;
}

.rv.in{ opacity:1; transform:none; }

@media (max-width:400px){
  .hero{ padding:34px 16px 60px; }
  .wrap{ padding:0 16px 40px; }
  .prose > section{ padding:20px 15px; }
  .foot{ padding:40px 18px 24px; }
  .foot-nav{ grid-template-columns:1fr; }
}

@media (prefers-reduced-motion:reduce){
  html{ scroll-behavior:auto; }
  body::after,
  .hero-copy h1{ animation:none; }
  .rv{ opacity:1 !important; transform:none !important; transition:none; }
  .hero-collage{ transform:none; }
}

button[aria-expanded]{min-width:44px;min-height:44px}
