/* KybApp 商店 · Web 版。逻辑属性（inline-start/end）让阿拉伯语等 RTL 语言自动镜像 */
:root {
  --bg: #f7f8fb; --surface: #fff; --text: #111827; --muted: #4b5563; --faint: #9ca3af; --line: #e5e7eb; --soft: #f1f3f8;
  --brand: #4f46e5; --brand-2: #0ea5e9; --ok: #16a34a; --star: #f59e0b;
  --blue: #2563eb; --green: #16a34a; --orange: #ea580c; --purple: #7c3aed; --red: #dc2626; --teal: #0d9488;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #0b0f19; --surface: #131a2a; --text: #e5e7eb; --muted: #a3acbd; --faint: #6b7385; --line: #263046; --soft: #1a2236; color-scheme: dark; }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--text);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Noto Sans Arabic", "Noto Sans SC", sans-serif;
  -webkit-text-size-adjust: 100%;
}
a { color: var(--brand); text-decoration: none; }
img { max-width: 100%; }

.top {
  position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 12px;
  padding: 10px 16px; background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 8px; color: var(--text); font-weight: 700; white-space: nowrap; }
.search { flex: 1; min-width: 0; }
.search input {
  width: 100%; padding: 9px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--soft); color: var(--text); font: inherit;
}
.lang { padding: 7px 8px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font: inherit; max-width: 120px; }
@media (max-width: 560px) { .brand span { display: none; } }

.client-banner a {
  display: flex; flex-direction: column; margin: 12px 16px 0; padding: 10px 14px; border-radius: 12px; color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
}
.client-banner small { opacity: .85; }

.view { max-width: 1040px; margin: 0 auto; padding: 16px; outline: none; min-height: 60vh; }
.msg { text-align: center; color: var(--muted); padding: 40px 0; }
.faint { color: var(--faint); }
.small { font-size: 12px; }
.h1 { font-size: 20px; margin: 4px 0 12px; }
.h1 small { color: var(--faint); font-weight: 400; font-size: 14px; }

.banners { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(280px, 1fr); gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 4px; }
.banner { scroll-snap-align: start; border-radius: 16px; padding: 18px; color: #fff; display: flex; flex-direction: column; justify-content: space-between; gap: 14px; min-height: 150px; }
.banner-t { display: flex; flex-direction: column; gap: 4px; }
.banner-t b { font-size: 19px; }
.banner-t small { opacity: .9; }
.banner-apps { display: flex; gap: 10px; }
.banner-apps .icon { border: 2px solid rgba(255, 255, 255, .7); }
.theme-blue { background: linear-gradient(135deg, var(--blue), #60a5fa); }
.theme-green { background: linear-gradient(135deg, var(--green), #4ade80); }
.theme-orange { background: linear-gradient(135deg, var(--orange), #fb923c); }
.theme-purple { background: linear-gradient(135deg, var(--purple), #a78bfa); }
.theme-red { background: linear-gradient(135deg, var(--red), #f87171); }
.theme-teal { background: linear-gradient(135deg, var(--teal), #2dd4bf); }

.chips { display: flex; gap: 8px; overflow-x: auto; padding: 14px 0 6px; }
.chip { flex: none; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font-size: 13px; white-space: nowrap; }
.chip small { color: var(--faint); }
.chip.on { border-color: var(--brand); color: var(--brand); }

.sec { margin-top: 18px; }
.sec h2 { display: flex; align-items: baseline; gap: 8px; font-size: 17px; margin: 0 0 10px; }
.sec h2 small { color: var(--faint); font-weight: 400; font-size: 13px; }
.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; align-self: center; }
.cards { display: grid; grid-auto-flow: column; grid-auto-columns: 120px; gap: 12px; overflow-x: auto; padding-bottom: 6px; }
.card { display: flex; flex-direction: column; gap: 4px; color: var(--text); min-width: 0; }
.card .icon { width: 100%; height: auto; aspect-ratio: 1; }
.card-t { font-size: 13px; font-weight: 600; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.card-s, .card-r { font-size: 12px; color: var(--muted); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.card-r { display: flex; justify-content: space-between; color: var(--faint); }

.icon { border-radius: 22%; object-fit: cover; background: var(--soft); flex: none; display: inline-block; box-shadow: 0 1px 2px rgba(0, 0, 0, .08); }
.icon-ph { display: inline-flex; align-items: center; justify-content: center; font-weight: 700; color: #fff; background: linear-gradient(135deg, var(--brand), var(--brand-2)); font-size: 22px; }

.rows { display: flex; flex-direction: column; }
.row { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); color: var(--text); align-items: center; }
.row-b { display: flex; flex-direction: column; min-width: 0; }
.row-b small { color: var(--muted); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.row-b .faint { color: var(--faint); }

.detail { display: flex; flex-direction: column; gap: 12px; }
.d-head { display: flex; gap: 16px; align-items: center; }
.d-head h1 { margin: 0; font-size: 22px; }
.d-head p { margin: 2px 0 0; }
.facts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 0; padding: 10px 0; border-block: 1px solid var(--line); }
.facts div { display: flex; flex-direction: column; align-items: center; text-align: center; }
.facts dt { color: var(--faint); font-size: 12px; }
.facts dd { margin: 0; font-weight: 600; display: flex; flex-direction: column; }
.facts dd small { font-weight: 400; color: var(--faint); font-size: 11px; }
.install { display: block; text-align: center; padding: 12px; border-radius: 12px; color: #fff; font-weight: 700; font-size: 16px; background: linear-gradient(135deg, var(--brand), var(--brand-2)); }
.note { margin: 0; padding: 8px 12px; border-radius: 10px; background: var(--soft); color: var(--muted); font-size: 13px; }
.shots { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 6px; scroll-snap-type: x mandatory; }
.shots img { height: 360px; width: auto; border-radius: 12px; border: 1px solid var(--line); scroll-snap-align: start; flex: none; }
.shots img.wide { height: 200px; align-self: center; }
@media (max-width: 560px) { .shots img { height: 300px; } .facts { grid-template-columns: repeat(2, 1fr); } }
.desc { white-space: pre-wrap; margin: 0; color: var(--muted); }

.rating-box { display: flex; gap: 20px; align-items: center; }
.big { display: flex; flex-direction: column; align-items: center; }
.big b { font-size: 40px; line-height: 1; }
.big span { color: var(--star); }
.big small { color: var(--faint); }
.hist { flex: 1; display: flex; flex-direction: column; gap: 3px; }
.hist-r { display: grid; grid-template-columns: 14px 1fr 32px; gap: 8px; align-items: center; font-size: 12px; color: var(--muted); }
.hist-r i { height: 8px; border-radius: 4px; background: linear-gradient(to var(--end, right), var(--star) var(--w), var(--soft) var(--w)); }
[dir="rtl"] .hist-r i { --end: left; }

.write { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; padding: 12px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); }
.write input, .write textarea { padding: 8px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); color: var(--text); font: inherit; }
.pick { display: flex; gap: 4px; }
.pick button { font-size: 28px; line-height: 1; background: none; border: 0; color: var(--line); cursor: pointer; padding: 0 2px; }
.pick button.on { color: var(--star); }
.btn { align-self: flex-start; padding: 8px 18px; border-radius: 999px; border: 0; background: var(--brand); color: #fff; font: inherit; font-weight: 600; cursor: pointer; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.ghost { background: transparent; color: var(--brand); border: 1px solid var(--line); margin-top: 8px; }
.write-msg { color: var(--muted); }
.reviews { margin-top: 10px; }
.review { padding: 10px 0; border-bottom: 1px solid var(--line); }
.review-h { display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline; }
.review p { margin: 4px 0 0; white-space: pre-wrap; }
.stars { color: var(--star); letter-spacing: 1px; }
.reply { padding: 6px 10px; border-inline-start: 3px solid var(--brand); background: var(--soft); border-radius: 0 8px 8px 0; font-size: 13px; color: var(--muted); }
[dir="rtl"] .reply { border-radius: 8px 0 0 8px; }
.tag { font-size: 11px; padding: 1px 6px; border-radius: 6px; background: var(--soft); color: var(--muted); font-weight: 400; }
.link { background: none; border: 0; color: var(--faint); font: inherit; font-size: 12px; cursor: pointer; padding: 0; margin-top: 4px; }

.busy { display: flex; justify-content: center; gap: 6px; padding: 60px 0; }
.busy span { width: 8px; height: 8px; border-radius: 50%; background: var(--brand); animation: b 1s infinite ease-in-out; }
.busy span:nth-child(2) { animation-delay: .15s; }
.busy span:nth-child(3) { animation-delay: .3s; }
@keyframes b { 0%, 80%, 100% { opacity: .2; } 40% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .busy span { animation: none; opacity: .6; } }

.foot { max-width: 1040px; margin: 20px auto 0; padding: 16px; color: var(--faint); font-size: 12px; display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; border-top: 1px solid var(--line); }
.country { display: inline-flex; gap: 6px; align-items: center; }
.country input { width: 44px; padding: 4px 6px; border-radius: 6px; border: 1px solid var(--line); background: var(--surface); color: var(--text); text-transform: uppercase; text-align: center; }
.foot small { flex-basis: 100%; }
