/* ==========================================================================
   墨绿主题层：叠在 index.css 之后，只覆盖首页 / 商品详情 / 订单查询。

   取向：暖米白纸底 + 单一墨绿主色 + 宋体标题，层级靠细边框和留白，不用阴影。
   index.css 的结构与类名一律不动——这里改令牌、改观感，不改布局语义，
   删掉 Header.html 里引用本文件的那一行即可整体回退。
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. 令牌
   -------------------------------------------------------------------------- */
:root {
    --shop-bg: #f7f6f2;
    --shop-surface: #fffefb;
    --shop-surface-muted: #f2f0e9;
    --shop-border: #e3e0d6;
    --shop-border-strong: #cbc7b9;
    --shop-ink: #262823;
    --shop-text: #45473f;
    --shop-muted: #7b7d73;

    --shop-primary: #526e65;
    --shop-primary-dark: #435b53;
    --shop-primary-soft: rgba(82, 110, 101, .10);
    --shop-price: #2f3d38;

    --shop-radius: 10px;
    --shop-radius-sm: 8px;
    --shop-shadow: none;
    --shop-shadow-hover: none;

    --ink-serif: "Noto Serif SC", "Source Han Serif SC", "Source Han Serif CN", "Songti SC", STSong, SimSun, serif;
    --ink-wash: #e9ece6;

    /* 公共组件（component.css：弹层按钮、滚动条等）取 --md-primary，未定义时回落近黑 */
    --md-primary: #526e65;
    --md-primary-rgb: 82, 110, 101;
}

body {
    background: var(--shop-bg);
}

/* 内容很短的页面（订单查询等）让页脚落到视口底部，而不是悬在半屏 */
body:has(> .ink-footer) {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

body:has(> .ink-footer) > #pjax-container {
    flex: 1 0 auto;
}

.btn-primary {
    --bs-btn-disabled-bg: #a9b8b2;
    --bs-btn-disabled-border-color: #a9b8b2;
    --bs-btn-focus-shadow-rgb: 82, 110, 101;
}

.btn-outline-secondary {
    --bs-btn-color: var(--shop-ink);
    --bs-btn-border-color: var(--shop-border-strong);
    --bs-btn-hover-color: var(--shop-ink);
    --bs-btn-hover-bg: var(--shop-surface-muted);
    --bs-btn-hover-border-color: var(--shop-border-strong);
    --bs-btn-active-color: var(--shop-ink);
    --bs-btn-active-bg: var(--shop-surface-muted);
    --bs-btn-active-border-color: var(--shop-border-strong);
}

/* --------------------------------------------------------------------------
   2. 顶栏
   -------------------------------------------------------------------------- */
.navbar-acg {
    background: var(--shop-bg);
    border-bottom-color: var(--shop-border);
}

.navbar-acg .navbar-brand {
    font-family: var(--ink-serif);
    letter-spacing: .02em;
}

/* 宋体比原来的无衬线字宽，手机上收紧字号与字距，保持顶栏单行 */
@media (max-width: 575.98px) {
    .navbar-acg .navbar-brand {
        font-size: .875rem;
        letter-spacing: 0;
    }

    /* 未登录时「登录 / 创建账号」两枚按钮去掉图标、收窄，让店名、按钮、菜单键排进一行
       （原主题在 390 宽下就会折成两行） */
    .user-login-box .btn .nav-icon {
        display: none;
    }

    .user-login-box .btn {
        padding: .3rem .5rem;
        font-size: .75rem;
    }

    .navbar-acg .navbar-toggler {
        padding: .25rem .4rem;
    }

    /* 日文「アカウント作成」最长，窄屏放不下一行；注册入口在登录页与页脚「新規登録」仍可达 */
    :lang(ja) .user-login-box .btn-primary {
        display: none;
    }
}

@media (max-width: 399.98px) {
    .navbar-acg .navbar-brand {
        margin-right: auto;
        font-size: .8125rem;
    }
}

.navbar-acg .nav-link.active {
    background: transparent;
    color: var(--shop-primary);
}

.navbar-acg .nav-link:hover {
    background: transparent;
}

.search-input .input-group-text,
.search-input .form-control {
    background: var(--shop-surface);
}

/* 语言切换：圆形图标钮 + 白底下拉，当前语言墨绿字 + 右侧圆点 */
.ink-lang__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #ecebe5;
    color: var(--shop-text);
    transition: background-color .15s ease, color .15s ease;
}

.ink-lang__btn:hover,
.ink-lang__btn:focus-visible,
.ink-lang.show .ink-lang__btn {
    background: #e2e6df;
    color: var(--shop-primary);
    outline: none;
}

.ink-lang__menu {
    min-width: 208px;
    margin-top: 10px !important;
    padding: 10px 8px;
    border: 1px solid var(--shop-border);
    border-radius: 12px;
    background: var(--shop-surface);
    box-shadow: 0 16px 36px -24px rgba(38, 40, 35, .45);
}

.ink-lang__label {
    margin: 4px 12px 8px;
    color: var(--shop-muted);
    font-size: .8125rem;
    font-weight: 700;
}

.ink-lang__item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .6rem 12px;
    border-radius: 8px;
    color: var(--shop-muted);
    font-size: 1rem;
    font-weight: 700;
}

.ink-lang__item:hover {
    background: var(--shop-surface-muted);
    color: var(--shop-ink);
}

.ink-lang__item.active {
    color: var(--shop-primary);
}

.ink-lang__item.active::after {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--shop-primary);
}

/* --------------------------------------------------------------------------
   3. 首屏
   -------------------------------------------------------------------------- */
.ink-hero {
    position: relative;
    overflow: hidden;
    border-bottom: 1px solid var(--shop-border);
}

.ink-hero__inner {
    position: relative;
    display: flex;
    align-items: center;
    min-height: 340px;
    padding-top: 48px;
    padding-bottom: 48px;
}

.ink-hero__copy {
    position: relative;
    z-index: 1;
    max-width: 560px;
}

.ink-eyebrow {
    display: flex;
    align-items: center;
    gap: .6rem;
    margin: 0 0 1rem;
    color: var(--shop-primary);
    font-size: .8125rem;
    font-weight: 600;
    letter-spacing: .18em;
}

.ink-eyebrow::before {
    content: "";
    width: 28px;
    height: 1px;
    background: currentColor;
}

.ink-hero__title {
    margin: 0;
    color: var(--shop-ink);
    font-family: var(--ink-serif);
    font-size: 2.75rem;
    font-weight: 700;
    line-height: 1.22;
    letter-spacing: .02em;
}

/* 日文按词组断行，避免「メンバーシッ / プ」这类从词中间折开（Chrome 119+，其余浏览器忽略） */
:lang(ja) .ink-hero__title,
:lang(ja) .ink-section__title {
    word-break: auto-phrase;
}

.ink-hero__lead {
    margin: 1rem 0 0;
    color: var(--shop-text);
    font-size: 1.0625rem;
    line-height: 1.75;
}

.ink-hero__actions {
    display: flex;
    flex-wrap: wrap;
    gap: .75rem;
    margin-top: 1.75rem;
}

.ink-btn {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    padding: .7rem 1.4rem;
    border: 1px solid var(--shop-primary);
    border-radius: var(--shop-radius-sm);
    background: var(--shop-primary);
    color: #fff;
    font-size: .9375rem;
    font-weight: 600;
    line-height: 1.2;
    transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}

.ink-btn:hover {
    border-color: var(--shop-primary-dark);
    background: var(--shop-primary-dark);
    color: #fff;
}

.ink-btn--ghost {
    border-color: var(--shop-border-strong);
    background: var(--shop-surface);
    color: var(--shop-ink);
}

.ink-btn--ghost:hover {
    border-color: var(--shop-primary);
    background: var(--shop-surface);
    color: var(--shop-primary);
}

/* 插画贴住首屏底边：山丘落在分隔线上 */
.ink-hero__art {
    position: absolute;
    right: 0;
    bottom: 0;
    width: min(54%, 620px);
    pointer-events: none;
}

.ink-hero__art svg {
    display: block;
    width: 100%;
    height: auto;
}

/* 插画两侧淡出，不在容器边缘留硬边 */
.ink-hero__art {
    -webkit-mask-image: linear-gradient(to right, transparent 0, #000 22%, #000 78%, transparent 100%);
    mask-image: linear-gradient(to right, transparent 0, #000 22%, #000 78%, transparent 100%);
}

@media (max-width: 991.98px) {
    .ink-hero__art {
        width: 62%;
        opacity: .55;
    }
}

@media (max-width: 575.98px) {
    .ink-hero__inner {
        min-height: 0;
        padding-top: 32px;
        padding-bottom: 32px;
    }

    .ink-hero__title {
        font-size: 2rem;
    }

    /* 英文单词长，32px 下每行都会再折一次，缩一档保持两行 */
    :lang(en) .ink-hero__title {
        font-size: 1.625rem;
    }

    .ink-hero__lead {
        font-size: .9375rem;
    }

    .ink-hero__art {
        right: -20%;
        width: 96%;
        opacity: .35;
    }

    .ink-btn {
        padding: .6rem 1.1rem;
    }
}

/* --------------------------------------------------------------------------
   4. 面板（公告）与分区标题（商品）
   -------------------------------------------------------------------------- */
.panel {
    background: var(--shop-surface);
}

.panel-header .icon {
    background: var(--shop-primary-soft);
    color: var(--shop-primary);
}

.panel-title {
    font-family: var(--ink-serif);
}

/* 公告：后台富文本里写死了 <font color>（橙）与链接内联 color:blue，与主题打架。
   这里只改观感、不改内容：文字回到正文色，链接做成墨绿描边小按钮，
   带换行的段落（下单须知这类清单）首行加粗当小标题。后台改公告也照样适用。 */
.ink-notice .panel-body {
    line-height: 1.85;
}

@media (max-width: 575.98px) {
    .ink-notice .panel-body {
        line-height: 1.7;
    }
}

.ink-notice .panel-body font {
    color: inherit;   /* <font color> 是表现性提示，任何作者样式都能盖过 */
}

.ink-notice .panel-body p {
    margin-bottom: .75rem;
}

.ink-notice .panel-body p:last-child {
    margin-bottom: 0;
}

.ink-notice .panel-body p:has(br)::first-line {
    color: var(--shop-ink);
    font-weight: 700;
}

.ink-notice .panel-body a {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    margin: 0 .5rem .35rem 0 !important;
    padding: .25rem .8rem;
    border: 1px solid rgba(82, 110, 101, .35);
    border-radius: 999px;
    background: var(--shop-primary-soft);
    color: var(--shop-primary-dark) !important;
    font-size: .875rem;
    font-weight: 600;
    line-height: 1.5;
    transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}

.ink-notice .panel-body a:hover {
    border-color: var(--shop-primary);
    background: var(--shop-primary);
    color: #fff !important;
}

/* 电报链接前加一枚纸飞机，图形用 mask 取当前文字色 */
.ink-notice .panel-body a[href*="t.me/"]::before {
    content: "";
    width: 14px;
    height: 14px;
    background: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M21.4 3.2 2.9 10.4c-1.3.5-1.2 1.3-.2 1.6l4.7 1.5 1.8 5.6c.2.6.4.8.9.8.4 0 .6-.2.9-.4l2.3-2.2 4.7 3.5c.9.5 1.5.2 1.7-.8l3.1-14.6c.3-1.3-.5-1.9-1.4-1.6zM8.6 13.1l9.9-6.2c.5-.3.9-.1.5.2l-8.1 7.4-.3 3.4-2-4.8z'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M21.4 3.2 2.9 10.4c-1.3.5-1.2 1.3-.2 1.6l4.7 1.5 1.8 5.6c.2.6.4.8.9.8.4 0 .6-.2.9-.4l2.3-2.2 4.7 3.5c.9.5 1.5.2 1.7-.8l3.1-14.6c.3-1.3-.5-1.9-1.4-1.6zM8.6 13.1l9.9-6.2c.5-.3.9-.1.5.2l-8.1 7.4-.3 3.4-2-4.8z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.ink-section {
    margin-top: 40px;
}

.ink-section__head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
    padding-bottom: .9rem;
    border-bottom: 1px solid var(--shop-border);
}

.ink-section__head .ink-eyebrow {
    margin-bottom: .35rem;
    font-size: .75rem;
}

.ink-section__head .ink-eyebrow::before {
    display: none;
}

.ink-section__title {
    margin: 0;
    color: var(--shop-ink);
    font-family: var(--ink-serif);
    font-size: 1.875rem;
    font-weight: 700;
    letter-spacing: .02em;
}

.ink-section__link {
    color: var(--shop-muted);
    font-size: .875rem;
    font-weight: 600;
    white-space: nowrap;
}

.ink-section__link:hover {
    color: var(--shop-primary);
}

@media (max-width: 575.98px) {
    .ink-section {
        margin-top: 28px;
    }

    .ink-section__title {
        font-size: 1.5rem;
    }
}

/* --------------------------------------------------------------------------
   5. 分类 chip：方角、描边，选中填墨绿
   -------------------------------------------------------------------------- */
.chip {
    border-color: var(--shop-border-strong);
    border-radius: var(--shop-radius-sm);
    background: var(--shop-surface);
    font-weight: 600;
}

.chip:hover {
    background: var(--shop-surface);
    border-color: var(--shop-primary);
    color: var(--shop-primary);
}

.chip.is-primary,
.chip.is-primary:hover {
    border-color: var(--shop-primary);
    background: var(--shop-primary);
    color: #fff;
}

/* --------------------------------------------------------------------------
   6. 商品卡片
   -------------------------------------------------------------------------- */
.acg-card {
    background: var(--shop-surface);
}

/* 封面缩进到卡片内，衬一层浅纸色，图与卡之间留出呼吸 */
.acg-thumb {
    margin: 10px 10px 0;
    padding: 8px;
    border-bottom: 0;
    border-radius: 6px;
    background-color: #fbfbf9;
    background-origin: content-box;
    box-shadow: inset 0 0 0 1px var(--shop-border);
}

.acg-body {
    padding: 14px 16px 16px;
}

.goods-title {
    font-size: 1rem;
}

.price {
    color: var(--shop-price);
    font-size: 1.5rem;
    letter-spacing: 0;
}

.price .unit {
    font-size: 1rem;
}

/* 可购买的卡片在价格右侧补一枚「购买」，售罄卡（链接为 javascript:）不显示 */
.item-list > a:not([href^="javascript"]) .stat-row::after {
    /* 文案由 Index.html 经 t() 写进 --ink-buy-label，随语言切换 */
    content: var(--ink-buy-label, "购买");
    padding: .4rem .95rem;
    border-radius: var(--shop-radius-sm);
    background: var(--shop-primary);
    color: #fff;
    font-size: .8125rem;
    font-weight: 600;
    line-height: 1.2;
    align-self: center;
}

.stat-bottom {
    border-top: 0;
    padding-top: .25rem;
}

/* 库存状态点：有货墨绿，紧张橙色，售罄红色 */
.stat-bottom > span:first-child::before {
    content: "";
    display: inline-block;
    width: 6px;
    height: 6px;
    margin-right: .4rem;
    border-radius: 50%;
    background: var(--shop-primary);
    vertical-align: middle;
}

.stat-bottom > span.badge-soft-warning:first-child::before,
.acg-card.soldout .stat-bottom > span:first-child::before {
    background: currentColor;
}

/* 售罄仍淡化封面和商品内容，但保留库存标签的红色。 */
.acg-card.soldout {
    filter: none;
}

.acg-card.soldout .acg-thumb,
.acg-card.soldout .acg-body > :not(.stat-bottom) {
    filter: grayscale(1);
}

.soldout-ribbon {
    top: 18px;
    left: 18px;
    background: rgba(38, 40, 35, .82);
}

@media (hover: hover) and (pointer: fine) {
    .item-list .acg-card:hover {
        border-color: var(--shop-primary);
        box-shadow: none;
        transform: translateY(-2px);
    }
}

@media (max-width: 575.98px) {
    .acg-thumb {
        margin: 8px 8px 0;
        padding: 4px;
    }

    .acg-body {
        padding: 10px 12px 12px;
    }

    .price {
        font-size: 1.25rem;
    }

    .item-list > a:not([href^="javascript"]) .stat-row::after {
        padding: .3rem .7rem;
        font-size: .75rem;
    }
}

/* --------------------------------------------------------------------------
   7. 徽章：统一降成墨绿 / 灰两档，不再红蓝绿并列
   -------------------------------------------------------------------------- */
.badge-soft-success {
    background: var(--shop-primary-soft);
    color: var(--shop-primary-dark);
}

.badge-soft-primary {
    background: #f1e9dd;
    color: #8a5a2b;
}

/* --------------------------------------------------------------------------
   8. 服务条（首页商品之后）
   -------------------------------------------------------------------------- */
.ink-assure {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-top: 32px;
    border: 1px solid var(--shop-border);
    border-radius: var(--shop-radius);
    background: var(--shop-surface);
}

.ink-assure__item {
    display: flex;
    align-items: center;
    gap: .9rem;
    padding: 18px 20px;
    color: inherit;
}

.ink-assure__item + .ink-assure__item {
    border-left: 1px solid var(--shop-border);
}

a.ink-assure__item:hover .ink-assure__title {
    color: var(--shop-primary);
}

.ink-assure__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: var(--shop-surface-muted);
    color: var(--shop-primary);
    font-size: 1.05rem;
    flex: 0 0 auto;
}

.ink-assure__title {
    margin: 0;
    color: var(--shop-ink);
    font-size: .9375rem;
    font-weight: 700;
}

.ink-assure__desc {
    margin: .15rem 0 0;
    color: var(--shop-muted);
    font-size: .8125rem;
}

@media (max-width: 767.98px) {
    .ink-assure {
        grid-template-columns: 1fr;
    }

    .ink-assure__item + .ink-assure__item {
        border-left: 0;
        border-top: 1px solid var(--shop-border);
    }
}

/* --------------------------------------------------------------------------
   9. 页脚
   -------------------------------------------------------------------------- */
.ink-footer {
    margin-top: 56px;
    border-top: 1px solid var(--shop-border);
    background: #f1efe9;
    color: var(--shop-muted);
    font-size: .875rem;
}

.ink-footer__main {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    padding-top: 32px;
    padding-bottom: 28px;
}

.ink-footer__brand {
    margin: 0;
    color: var(--shop-ink);
    font-family: var(--ink-serif);
    font-size: 1.125rem;
    font-weight: 700;
}

.ink-footer__tagline {
    margin: .35rem 0 0;
}

.ink-footer__links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 28px;
}

.ink-footer__links a {
    color: var(--shop-text);
}

.ink-footer__links a:hover {
    color: var(--shop-primary);
}

.ink-footer__bottom {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px 24px;
    padding-top: 14px;
    padding-bottom: 18px;
    border-top: 1px solid var(--shop-border);
    font-size: .8125rem;
}

/* 页脚语言栏：所有屏宽都在，窄屏时它是唯一的切换入口 */
.ink-footer__langs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
}

.ink-footer__langs a {
    color: var(--shop-muted);
}

.ink-footer__langs a + a::before {
    content: "·";
    margin: 0 .5rem;
    color: var(--shop-border-strong);
}

.ink-footer__langs a:hover,
.ink-footer__langs a.active {
    color: var(--shop-primary);
}

.ink-footer__langs a.active {
    font-weight: 700;
}

/* ICP 备案条沿用原 footer 标签，压成页脚最底一行 */
.ink-footer + footer {
    background: #f1efe9;
    color: var(--shop-muted);
}

/* --------------------------------------------------------------------------
   10. 商品详情与订单查询：标题换宋体，价格与选中态走墨绿
   -------------------------------------------------------------------------- */
.item-title {
    font-family: var(--ink-serif);
    letter-spacing: .01em;
}

.optional-card.is-primary,
.cash-pay .pay-list .pay.selected {
    border-color: var(--shop-primary);
    background: var(--shop-primary-soft);
}

/* 宝贝详情：与公告同样的处理——后台编辑器写进去的 <font color>（常见整段橙色）回到正文色，
   链接走墨绿，第一段首行（通常是「🔔 下单须知」这类标题）加粗。只改观感，不改内容 */
.item-detail .acg-rich {
    color: var(--shop-text);
    line-height: 1.85;
}

.item-detail .acg-rich font[color] {
    color: inherit;
}

.item-detail .acg-rich p {
    margin-bottom: .6rem;
}

.item-detail .acg-rich > p:first-child:has(br)::first-line {
    color: var(--shop-ink);
    font-weight: 700;
}

.item-detail .acg-rich a,
.item-detail .acg-rich a font {
    color: var(--shop-primary) !important;
    font-weight: 600;
}

.item-detail .acg-rich a:hover {
    color: var(--shop-primary-dark) !important;
}

@media (max-width: 575.98px) {
    .item-detail .acg-rich {
        line-height: 1.7;
    }
}

/* 查询密码框「显示 / 隐藏」按钮（下单页、订单查询页） */
.ink-pw-wrap { position: relative; }
.ink-pw-wrap > .form-control { padding-right: 2.6rem; }
.ink-pw-toggle {
    position: absolute; top: 50%; right: .45rem; transform: translateY(-50%);
    display: inline-flex; align-items: center; justify-content: center;
    width: 2rem; height: 2rem; padding: 0; border: 0; border-radius: var(--shop-radius-sm, 8px);
    background: transparent; color: var(--shop-muted, #7b7d73); cursor: pointer; line-height: 1;
}
.ink-pw-toggle:hover, .ink-pw-toggle:focus-visible { color: var(--shop-primary, #526e65); background: var(--shop-primary-soft, rgba(82, 110, 101, .10)); outline: none; }
.order-query-form ~ p .recovery-open { color: var(--shop-primary, #526e65); }
.no-results .recovery-open {
    --bs-btn-color: var(--shop-primary, #526e65); --bs-btn-border-color: var(--shop-primary, #526e65);
    --bs-btn-hover-color: #fff; --bs-btn-hover-bg: var(--shop-primary, #526e65); --bs-btn-hover-border-color: var(--shop-primary, #526e65);
    --bs-btn-active-color: #fff; --bs-btn-active-bg: var(--shop-primary-dark, #435b53); --bs-btn-active-border-color: var(--shop-primary-dark, #435b53);
    --bs-btn-focus-shadow-rgb: 82, 110, 101;
}

/* 订单查询结果上方的「下次用邮箱 + 查询密码查」提示（按订单号查到时显示） */
.query-next-hint {
    margin-bottom: 1rem; padding: .7rem 1rem; border-radius: var(--shop-radius-sm, 8px);
    background: var(--shop-primary-soft, rgba(82, 110, 101, .10)); color: var(--shop-primary, #526e65);
    font-size: .9rem; line-height: 1.5;
}
