/* =====================================================================
 * N14 / 16 · 阿拉伯字母表 —— 独立皮肤「沙漠靛蓝手稿」
 * 与全批公共基座不同的暖羊皮底、靛蓝主色、沙金辅色、RTL 字形墙与手稿分栏。
 * 主题：只消费公共导航写入的 <html data-theme>，不自建开关。
 * ===================================================================== */

.aa-page {
    --nx-bg:        #faf7f0;
    --nx-bg-2:      #f2ece0;
    --nx-surface:   #fffdf8;
    --nx-surface-2: #f6f1e7;
    --nx-surface-3: #ece5d6;
    --nx-ink:       #241f18;
    --nx-ink-2:     #5b5245;
    --nx-ink-3:     #938877;
    --nx-line:      #e2d9c8;
    --nx-line-2:    #eee7da;
    --nx-a:         #1e5b8f;
    --nx-b:         #c08a2e;
    --nx-tint:      #e4eff7;
    --nx-deep:      #174a76;
    --tsk-card: #fffdf8;
    --tsk-line: #e2d9c8;
    --tsk-faint: #938877;
    --tsk-sub: #5b5245;
    --tsk-ink: #241f18;
    background-image: repeating-linear-gradient(135deg, rgba(192, 138, 46, .025) 0 1px, transparent 1px 9px);
}
:root[data-theme="dark"] .aa-page {
    --nx-bg:        #0e141b;
    --nx-bg-2:      #131c25;
    --nx-surface:   #17212c;
    --nx-surface-2: #1e2a37;
    --nx-surface-3: #263444;
    --nx-ink:       #f2ece0;
    --nx-ink-2:     #b9b0a0;
    --nx-ink-3:     #8b8274;
    --nx-line:      #2d3d4f;
    --nx-line-2:    #243140;
    --nx-a:         #6cb0e6;
    --nx-b:         #d9ad5c;
    --nx-tint:      rgba(108, 176, 230, .16);
    --nx-deep:      #9ccdf0;
    --tsk-card: #17212c;
    --tsk-line: #2d3d4f;
    --tsk-faint: #8b8274;
    --tsk-sub: #b9b0a0;
    --tsk-ink: #f2ece0;
    background-image: repeating-linear-gradient(135deg, rgba(217, 173, 92, .03) 0 1px, transparent 1px 9px);
}

.aa-page .aa-arabic, .aa-page .aa-glyph, .aa-page .aa-ar {
    font-family: "Noto Naskh Arabic", "Traditional Arabic", "Amiri", "Scheherazade New", "Arial", serif;
    direction: rtl; unicode-bidi: isolate;
}
.aa-page .n14-kicker { color: var(--nx-b); }
.aa-page .n14-kicker::before { background: var(--nx-b); }
.aa-page .n14-hero h1 em { color: var(--nx-a); }
.aa-intro__note { margin-top: 18px; max-width: 60ch; }

/* 首屏检索台：顶部金线 + 手写编号 */
.aa-console { border-top: 3px solid var(--nx-b); position: relative; }
.aa-console::after {
    content: "ا ب ت"; position: absolute; right: 22px; bottom: 12px;
    font-size: 40px; color: var(--nx-b); opacity: .12; pointer-events: none;
    font-family: "Noto Naskh Arabic", "Traditional Arabic", serif; direction: rtl;
}
.aa-console > * { position: relative; z-index: 1; }
.aa-console__demo { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin-top: 16px; padding-top: 14px; border-top: 1px dashed var(--nx-line); }
.aa-console__demo .n14-small { margin-right: 4px; }

/* 字形墙 */
.aa-legend { display: flex; gap: 8px; flex-wrap: wrap; }
.aa-wall { display: grid; grid-template-columns: repeat(auto-fill, minmax(158px, 1fr)); gap: 12px; }
.aa-card {
    position: relative; display: flex; flex-direction: column; align-items: stretch;
    background: var(--nx-surface); border: 1px solid var(--nx-line); border-radius: 14px;
    padding: 14px 14px 12px; cursor: pointer; text-align: right;
    transition: transform .15s, box-shadow .15s, border-color .15s;
    box-shadow: var(--nx-sh-sm);
}
.aa-card:hover { transform: translateY(-3px); box-shadow: var(--nx-sh-lift); border-color: var(--nx-a); }
.aa-card[aria-pressed="true"] { border-color: var(--nx-a); box-shadow: 0 0 0 2px var(--nx-tint), var(--nx-sh-sm); }
.aa-card__no { font-family: var(--nx-mono); font-size: 11px; color: var(--nx-ink-3); text-align: left; }
.aa-card__glyph { font-size: 46px; line-height: 1.35; color: var(--nx-ink); min-height: 66px; text-align: center; }
.aa-card__four { display: flex; justify-content: center; gap: 5px; direction: rtl; font-size: 21px; line-height: 1.5; color: var(--nx-a); min-height: 38px; }
.aa-card__four span { flex: 0 0 auto; }
.aa-card__meta { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-top: 8px; padding-top: 9px; border-top: 1px solid var(--nx-line-2); direction: ltr; }
.aa-card__name { font-size: 13px; font-weight: 750; color: var(--nx-ink); }
.aa-card__tr { font-family: var(--nx-mono); font-size: 12px; color: var(--nx-ink-3); }
.aa-card__flag { position: absolute; top: 10px; right: 10px; width: 8px; height: 8px; border-radius: 50%; background: var(--nx-a); }
.aa-card[data-aa-sun="moon"] .aa-card__flag { background: var(--nx-ink-3); }
.aa-card[data-aa-sun="iso"] .aa-card__flag { background: var(--nx-b); }
.aa-wall .n14-empty { grid-column: 1 / -1; }

/* 单字详情 */
.aa-detail { margin-top: 18px; border-right: 4px solid var(--nx-b); }
.aa-detail__top { display: flex; flex-wrap: wrap; align-items: center; gap: 18px; }
.aa-detail__big { font-size: clamp(64px, 9vw, 108px); line-height: 1.1; color: var(--nx-a); }
.aa-detail__forms { display: grid; grid-template-columns: repeat(4, minmax(84px, 1fr)); gap: 10px; flex: 1 1 320px; }
.aa-detail__forms div { background: var(--nx-surface-2); border: 1px solid var(--nx-line); border-radius: 10px; padding: 9px; text-align: center; }
.aa-detail__forms b { display: block; font-size: 30px; line-height: 1.4; color: var(--nx-ink); direction: rtl; }
.aa-detail__forms span { font-size: 11px; color: var(--nx-ink-3); }
.aa-detail__facts { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 16px; }
.aa-detail__facts span { font-size: 13px; background: var(--nx-surface-2); border-radius: 8px; padding: 6px 11px; color: var(--nx-ink-2); }
.aa-detail__facts span b { color: var(--nx-ink); }

/* 转写工作台 */
.aa-split { align-items: start; }
.aa-note { margin-top: 14px; }
.aa-trans-out { display: grid; gap: 9px; max-height: 300px; overflow: auto; }
.aa-trans-row { display: grid; grid-template-columns: minmax(90px, auto) 1fr; gap: 12px; align-items: center; background: var(--nx-surface-2); border: 1px solid var(--nx-line); border-radius: 10px; padding: 10px 13px; }
.aa-trans-row__k { font-family: var(--nx-mono); font-size: 12px; color: var(--nx-ink-3); word-break: break-all; }
.aa-trans-row__v { font-size: 27px; line-height: 1.5; color: var(--nx-ink); direction: rtl; text-align: right; word-break: break-all; }
.aa-trans-row__v em { font-style: normal; color: var(--nx-err); }
.aa-trans-row__n { display: block; font-family: var(--nx-sans); font-size: 11px; direction: ltr; text-align: left; color: var(--nx-ink-3); }

/* 校验输出 */
.aa-check-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(125px, 1fr)); gap: 10px; }
.aa-check-grid div { background: var(--nx-surface); border: 1px solid var(--nx-line); border-radius: 10px; padding: 10px 12px; }
.aa-check-grid b { display: block; font-family: var(--nx-mono); font-size: 21px; color: var(--nx-ink); }
.aa-check-grid span { font-size: 11px; color: var(--nx-ink-3); }
.aa-escape { margin-top: 14px; }
.aa-escape .n14-code { max-height: 150px; overflow: auto; }

/* 变体与数字 */
.aa-digits { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 16px; }
.aa-digits span { display: inline-flex; flex-direction: column; align-items: center; min-width: 40px; padding: 6px 4px; background: var(--nx-surface-2); border: 1px solid var(--nx-line); border-radius: 9px; }
.aa-digits b { font-size: 22px; color: var(--nx-a); direction: rtl; }
.aa-digits i { font-style: normal; font-family: var(--nx-mono); font-size: 11px; color: var(--nx-ink-3); }

@media (max-width: 640px) {
    .aa-wall { grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 9px; }
    .aa-card__glyph { font-size: 38px; min-height: 56px; }
    .aa-card__four { font-size: 18px; }
    .aa-detail__forms { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .aa-trans-row { grid-template-columns: 1fr; gap: 4px; }
}
