/* ════════════════════════════════════════
   穴位傷科清單頁
   ════════════════════════════════════════ */
#aculist-content {
    max-width: 1440px;
    margin: 0 auto;
    padding: 22px 28px 48px;
}

/* ── 頁首：標題 + 搜尋工具列 ── */
#aculist-header {
    position: sticky;
    top: 0;
    z-index: 10;
    display: grid;
    grid-template-columns: minmax(220px, 1fr) minmax(360px, 620px);
    gap: 20px;
    align-items: end;
    padding: 18px 0 20px;
    margin-bottom: 18px;
    background:
        linear-gradient(180deg, var(--bg) 0%, color-mix(in srgb, var(--bg) 92%, transparent) 100%);
    border-bottom: 1px solid color-mix(in srgb, var(--accent-bg) 80%, var(--ink) 8%);
    backdrop-filter: blur(10px);
    transition: background-color 0.25s ease, border-color 0.25s ease;
}
.aculist-title-block {
    min-width: 0;
}
.aculist-kicker {
    display: block;
    margin-bottom: 5px;
    color: var(--ink);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}
#aculist-header h1 {
    margin: 0;
    color: var(--text);
    font-family: "Noto Serif TC", serif;
    font-size: 1.95rem;
    font-weight: 500;
    line-height: 1.15;
    letter-spacing: 0;
}
.aculist-toolbar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    min-width: 0;
}
.aculist-search-wrap {
    position: relative;
    display: flex;
    align-items: center;
    flex: 1 1 360px;
    min-width: 220px;
    max-width: 440px;
}
.aculist-search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-52%);
    color: var(--muted);
    font-size: 1rem;
    pointer-events: none;
}
#aculist-search {
    width: 100%;
    min-height: 42px;
    padding: 10px 14px 10px 38px;
    border: 1px solid color-mix(in srgb, var(--accent-bg) 72%, var(--ink) 12%);
    border-radius: 8px;
    outline: none;
    background: var(--surface);
    color: var(--text);
    box-shadow: 0 1px 2px rgba(47, 74, 61, 0.04);
    font: inherit;
    font-size: 0.94rem;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}
#aculist-search:focus {
    border-color: var(--ink);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--ink) 16%, transparent);
}
#aculist-search::placeholder {
    color: var(--muted);
}
#aculist-count {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 6px 10px;
    border: 1px solid color-mix(in srgb, var(--accent-bg) 78%, var(--ink) 8%);
    border-radius: 8px;
    background: color-mix(in srgb, var(--surface) 78%, var(--accent-bg) 22%);
    color: var(--muted);
    font-size: 0.8rem;
    font-weight: 500;
    white-space: nowrap;
}

/* ── 卡片格線 ── */
#aculist-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 14px;
    align-items: start;
}

/* ── 部位卡片 ── */
.loc-card {
    position: relative;
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
    height: 392px;
    overflow: hidden;
    border: 1px solid color-mix(in srgb, var(--accent-bg) 70%, var(--ink) 10%);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: 0 1px 2px rgba(47, 74, 61, 0.05), 0 10px 28px rgba(47, 74, 61, 0.06);
    transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}
.loc-card::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 4px;
    background: var(--ink);
    opacity: 0.86;
}
@media (hover: hover) and (pointer: fine) {
    .loc-card:hover {
        transform: translateY(-1px);
        border-color: color-mix(in srgb, var(--ink) 34%, var(--accent-bg));
        box-shadow: 0 2px 5px rgba(47, 74, 61, 0.08), 0 16px 36px rgba(47, 74, 61, 0.11);
    }
}
.loc-card-title {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 9px;
    align-items: center;
    padding: 13px 14px 11px 17px;
    border-bottom: 1px solid color-mix(in srgb, var(--accent-bg) 78%, transparent);
    background: color-mix(in srgb, var(--inner) 74%, var(--surface) 26%);
}
.acu-loc-code {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 26px;
    padding: 0 8px;
    border-radius: 7px;
    background: color-mix(in srgb, var(--ink) 12%, var(--accent-bg));
    color: var(--ink);
    font-family: "Consolas", "SFMono-Regular", monospace;
    font-size: 0.72rem;
    font-weight: 700;
}
.acu-loc-name {
    min-width: 0;
    overflow: hidden;
    color: var(--text);
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.35;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.acu-item-count {
    justify-self: end;
    color: var(--muted);
    font-size: 0.76rem;
    font-weight: 500;
    white-space: nowrap;
}

/* ── 穴位列表 ── */
.acu-list {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1 1 auto;
    min-height: 0;
    padding: 8px 9px 9px 13px;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: color-mix(in srgb, var(--ink) 38%, var(--accent-bg)) transparent;
}
.acu-list::-webkit-scrollbar {
    width: 8px;
}
.acu-list::-webkit-scrollbar-track {
    background: transparent;
}
.acu-list::-webkit-scrollbar-thumb {
    border: 2px solid var(--surface);
    border-radius: 999px;
    background: color-mix(in srgb, var(--ink) 34%, var(--accent-bg));
}
.loc-card.has-many .acu-list {
    padding-bottom: 28px;
    mask-image: linear-gradient(to bottom, #000 0, #000 calc(100% - 30px), transparent 100%);
}
.acu-row {
    display: grid;
    grid-template-columns: 54px minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    min-height: 34px;
    padding: 6px 9px;
    border-radius: 7px;
    overflow: hidden;
    transition: background 0.14s ease, color 0.14s ease;
}
@media (hover: hover) and (pointer: fine) {
    .acu-row:hover {
        background: color-mix(in srgb, var(--accent-bg) 82%, var(--surface));
    }
}
.acu-fee-code {
    color: var(--muted);
    font-family: "Consolas", "SFMono-Regular", monospace;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}
.acu-fee-name {
    min-width: 0;
    overflow: hidden;
    color: var(--text);
    font-size: 0.95rem;
    line-height: 1.35;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.acu-row.highlight {
    background: color-mix(in srgb, var(--ink) 12%, var(--surface));
}
.acu-row.highlight .acu-fee-code,
.acu-row.highlight .acu-fee-name {
    color: var(--ink);
    font-weight: 700;
}
.acu-card-footer {
    position: absolute;
    right: 10px;
    bottom: 8px;
    left: 13px;
    display: flex;
    justify-content: flex-end;
    pointer-events: none;
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 600;
    line-height: 1.2;
    text-shadow: 0 1px 0 var(--surface), 0 -1px 0 var(--surface);
}

/* ── 搜尋無結果 ── */
#aculist-empty {
    display: none;
    margin: 40px auto 0;
    max-width: 460px;
    padding: 34px 20px;
    border: 1px dashed color-mix(in srgb, var(--accent-bg) 70%, var(--muted));
    border-radius: 8px;
    background: color-mix(in srgb, var(--surface) 70%, transparent);
    color: var(--muted);
    text-align: center;
    font-size: 0.94rem;
}

@media (max-width: 900px), (orientation: portrait) and (pointer: coarse) {
    #aculist-content {
        padding: 12px 12px 34px;
    }
    #aculist-header {
        grid-template-columns: 1fr;
        gap: 13px;
        align-items: stretch;
        padding: 14px 0 15px;
    }
    #aculist-header h1 {
        font-size: 1.55rem;
    }
    .aculist-toolbar {
        justify-content: stretch;
        flex-wrap: wrap;
    }
    .aculist-search-wrap {
        flex-basis: 100%;
        max-width: none;
        min-width: 0;
    }
    #aculist-count {
        width: 100%;
        justify-content: center;
    }
    #aculist-grid {
        grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
        gap: 10px;
    }
    .loc-card {
        height: 340px;
    }
    .loc-card-title {
        padding-right: 12px;
    }
}

@media (max-width: 560px) {
    #aculist-grid {
        grid-template-columns: 1fr;
    }
    .loc-card {
        height: auto;
        max-height: 420px;
    }
    .acu-row {
        grid-template-columns: 58px minmax(0, 1fr);
    }
}
