/* 全站黑绿科技风美化 */
:root {
  --site-green: #42e99a;
  --site-green-light: #8affc6;
  --site-border: rgba(66, 233, 154, .24);
  --site-shadow: 0 12px 32px rgba(0, 0, 0, .12);
}

a, button, .btn, .form-control, .form-select, .product-card {
  transition: color .18s ease, background-color .18s ease,
    border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.btn {
  border-radius: .75rem;
  font-weight: 600;
}

.btn-dark {
  background: linear-gradient(135deg, #08784d, #0b573b);
  border-color: #159963;
  color: #fff;
}

.btn-dark:hover, .btn-dark:focus {
  background: linear-gradient(135deg, #0a9861, #08784d);
  border-color: var(--site-green);
  color: #fff;
  box-shadow: 0 5px 18px rgba(23, 190, 116, .2);
}

.btn:focus-visible, a:focus-visible, button:focus-visible,
input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--site-green);
  outline-offset: 3px;
}

.form-control, .form-select {
  border-radius: .75rem;
}

.form-control:focus, .form-select:focus {
  border-color: #27bd7b;
  box-shadow: 0 0 0 .2rem rgba(39, 189, 123, .14);
}

.product-card {
  height: 100%;
  padding: .75rem;
  border: 1px solid var(--site-border);
  box-shadow: 0 5px 20px rgba(0, 0, 0, .045);
}

.product-card:hover {
  border-color: rgba(66, 233, 154, .58);
  box-shadow: var(--site-shadow);
  transform: translateY(-3px);
}

.product-card .position-relative > a {
  overflow: hidden;
  border: 1px solid rgba(66, 233, 154, .1);
}

.product-card img {
  max-width: 100%;
  height: auto;
  object-fit: contain;
}

.product-card .progress {
  overflow: hidden;
  border-radius: 999px;
  background: rgba(128, 128, 128, .14);
}

.product-card .progress-bar.bg-dark,
.product-card .progress-bar.bg-light {
  background: linear-gradient(90deg, #08784d, #42e99a) !important;
}

.product-card .nav-link {
  font-weight: 600;
  line-height: 1.5;
}

.product-card .h6 {
  font-variant-numeric: tabular-nums;
}

.quicksearch {
  min-height: 46px;
  border-radius: 999px !important;
}

.quicksearch:focus {
  box-shadow: 0 0 0 .2rem rgba(39, 189, 123, .14);
}

#modalId .modal-content {
  border: 1px solid var(--site-border);
  border-radius: 1rem;
  overflow: hidden;
}

#modalId .modal-header, #modalId .modal-footer {
  border-color: var(--site-border);
}

.content-wrapper img {
  max-width: 100%;
}

@media (max-width: 575.98px) {
  .product-card {
    padding: .5rem;
    border-radius: .85rem !important;
  }

  .product-card .position-relative {
    margin-bottom: .65rem !important;
  }

  .product-card .badge {
    font-size: .68rem;
  }

  .quicksearch {
    min-height: 44px;
  }

  .modal-dialog {
    margin: .75rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
  }
}

/* PAGE POLISH: ORDER FLOW */

/* 订单相关页面：卡片边框与层次 */
.content-wrapper .card,
.main-container .card {
    border: 1px solid rgba(57, 255, 136, 0.18);
    border-radius: 16px;
    box-shadow: 0 8px 26px rgba(0, 0, 0, 0.16);
    overflow: hidden;
}

.content-wrapper .card .card-body,
.main-container .card .card-body {
    border-radius: inherit;
}

/* 订单查询标签 */
.content-wrapper .nav-tabs {
    border-bottom-color: rgba(57, 255, 136, 0.24);
    gap: 4px;
}

.content-wrapper .nav-tabs .nav-link {
    border-radius: 10px 10px 0 0;
    transition: color .18s ease, background-color .18s ease, border-color .18s ease;
}

.content-wrapper .nav-tabs .nav-link.active {
    border-color: rgba(57, 255, 136, 0.3);
    border-bottom-color: transparent;
    font-weight: 600;
}

/* 订单详情中的卡密文本区域 */
.content-wrapper textarea[id*="kami"],
.content-wrapper textarea[id*="card"],
.content-wrapper textarea[readonly] {
    max-width: 100%;
    border-radius: 10px;
    line-height: 1.65;
    overflow-wrap: anywhere;
}

.content-wrapper .btn,
.main-container .btn {
    border-radius: 10px;
    transition: transform .18s ease, box-shadow .18s ease;
}

.content-wrapper .btn:active,
.main-container .btn:active {
    transform: translateY(1px);
}

/* 订单金额、状态及摘要区域 */
.content-wrapper .table {
    vertical-align: middle;
}

.content-wrapper .table th,
.content-wrapper .table td {
    padding-top: .8rem;
    padding-bottom: .8rem;
}

/* 扫码支付：适配桌面和手机 */
.main-container {
    box-sizing: border-box;
    width: 100%;
    padding: clamp(1rem, 4vw, 3.5rem) !important;
}

.main-container .card-title {
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.main-container img {
    max-width: 100%;
    height: auto;
}

.main-container .err-messagep-3 {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1rem;
}

@media (max-width: 575.98px) {
    .content-wrapper .card,
    .main-container .card {
        border-radius: 12px;
    }

    .content-wrapper .card .card-body {
        padding: 1rem;
    }

    .content-wrapper .table th,
    .content-wrapper .table td {
        padding: .65rem .5rem;
        font-size: .92rem;
    }

    .main-container {
        padding: 1rem !important;
    }

    .main-container .card {
        margin: .25rem !important;
    }

    .main-container .card .card-body {
        padding: 1rem !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    .content-wrapper .btn,
    .main-container .btn,
    .content-wrapper .nav-tabs .nav-link {
        transition: none;
    }
}

/* PAGE POLISH: ORDER DETAIL */

/* 订单详情：卡密信息区 */
.bg-success.rounded.px-2.py-2 {
    background: rgba(10, 24, 18, 0.94) !important;
    border: 1px solid rgba(57, 255, 136, 0.42);
    border-radius: 14px !important;
    box-shadow: inset 0 0 18px rgba(57, 255, 136, 0.04);
}

.bg-success.rounded.px-2.py-2 h2 {
    color: #39ff88;
    letter-spacing: .03em;
}

textarea[id^="kami-textarea-"] {
    display: block;
    width: 100%;
    min-height: 120px;
    color: #dfffee;
    background: #0b100e;
    border: 1px solid rgba(57, 255, 136, 0.35);
    resize: vertical;
    overflow-wrap: anywhere;
}

textarea[id^="kami-textarea-"]:focus {
    border-color: #39ff88;
    box-shadow: 0 0 0 .2rem rgba(57, 255, 136, 0.12);
}

.kami-btn {
    min-height: 42px;
    white-space: normal;
    overflow-wrap: anywhere;
}

.bg-success.rounded.px-2.py-2 .d-flex.gap-3 {
    flex-wrap: wrap;
}

.bg-success.rounded.px-2.py-2 .kami-btn {
    flex: 1 1 180px;
    width: auto !important;
}

@media (max-width: 575.98px) {
    textarea[id^="kami-textarea-"] {
        min-height: 140px;
        font-size: .9rem;
    }

    .bg-success.rounded.px-2.py-2 .d-flex.gap-3 {
        gap: .5rem !important;
    }

    .bg-success.rounded.px-2.py-2 .kami-btn {
        flex-basis: 100%;
        width: 100% !important;
    }
}

/* PAGE POLISH: GLOBAL FINISH */

/* 全站统一焦点色与文字换行 */
:root {
    --site-neon: #39ff88;
    --site-neon-soft: rgba(57, 255, 136, .14);
    --site-neon-border: rgba(57, 255, 136, .28);
}

a:focus-visible,
button:focus-visible,
.btn:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid var(--site-neon);
    outline-offset: 3px;
}

/* 顶部导航：轻微玻璃质感，不改变定位与尺寸 */
.navbar-sticky .navbar {
    border: 1px solid var(--site-neon-border);
    box-shadow:
        0 8px 28px rgba(0, 0, 0, .18),
        inset 0 1px 0 rgba(255, 255, 255, .025);
}

.navbar-sticky .navbar .nav-link {
    transition: color .18s ease, background-color .18s ease;
}

.navbar-sticky .navbar .nav-link:hover,
.navbar-sticky .navbar .nav-link.active {
    color: var(--site-neon) !important;
}

.navbar-sticky .navbar .navbar-brand {
    transition: filter .2s ease;
}

.navbar-sticky .navbar .navbar-brand:hover {
    filter: drop-shadow(0 0 7px rgba(57, 255, 136, .28));
}

/* 导航下拉菜单与移动端菜单 */
.navbar-sticky .dropdown-menu,
#navbarNav .dropdown-menu {
    border: 1px solid var(--site-neon-border);
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, .22);
}

#navbarNav .dropdown-item {
    transition: color .15s ease, background-color .15s ease;
}

#navbarNav .dropdown-item:hover,
#navbarNav .dropdown-item:focus {
    color: var(--site-neon);
    background: var(--site-neon-soft);
}

/* 公告条：不改变公告滚动与按钮功能 */
body > .alert,
body .alert.rounded-0 {
    border-color: var(--site-neon-border);
}

body > .alert a,
body .alert.rounded-0 a {
    text-underline-offset: 3px;
}

/* 输入框与搜索区域 */
.form-control,
.form-select {
    transition: border-color .18s ease, box-shadow .18s ease;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--site-neon);
    box-shadow: 0 0 0 .2rem rgba(57, 255, 136, .12);
}

/* 页脚：分隔线与链接交互 */
footer a,
.footer a {
    text-underline-offset: 3px;
    transition: color .18s ease;
}

footer a:hover,
.footer a:hover {
    color: var(--site-neon) !important;
}

/* 触屏设备不使用悬停位移，减少误触感 */
@media (hover: none) {
    .product-card:hover,
    .content-wrapper .btn:hover,
    .main-container .btn:hover {
        transform: none;
    }
}

/* 尊重系统减少动态效果的设置 */
@media (prefers-reduced-motion: reduce) {
    .navbar-sticky .navbar *,
    .form-control,
    .form-select,
    footer a,
    .footer a {
        transition: none !important;
    }
}

/* PAGE POLISH: DARK BACKGROUND */
:root {
    color-scheme: dark;
    --site-bg: #080b0a;
    --site-surface: #101613;
    --site-surface-raised: #151d18;
    --site-neon: #39ff88;
    --site-text: #e8f5ed;
    --site-muted: #a5b5aa;
}

html,
body {
    background-color: var(--site-bg) !important;
    color: var(--site-text);
}

body {
    background-image:
        radial-gradient(ellipse at 50% 0%, rgba(35, 110, 65, .14), transparent 55%);
    background-attachment: fixed;
}

main,
main main,
.page-content,
.content-wrapper,
.container-fluid:not(.navbar .container-fluid) {
    color: var(--site-text);
}

.card,
.modal-content,
.dropdown-menu,
.offcanvas,
.list-group-item {
    background-color: var(--site-surface);
    color: var(--site-text);
    border-color: rgba(57, 255, 136, .18);
}

.card .card,
.card .card-body .card {
    background-color: var(--site-surface-raised);
}

.text-body,
.text-dark,
h1, h2, h3, h4, h5, h6,
label {
    color: var(--site-text);
}

.text-muted,
.text-secondary,
small,
.form-text {
    color: var(--site-muted) !important;
}

.form-control,
.form-select,
textarea,
input[type="text"],
input[type="email"],
input[type="number"],
input[type="search"] {
    background-color: #0b100d;
    color: var(--site-text);
    border-color: rgba(57, 255, 136, .28);
}

.form-control::placeholder,
textarea::placeholder,
input::placeholder {
    color: #819187;
}

.table {
    --bs-table-bg: transparent;
    --bs-table-color: var(--site-text);
    --bs-table-border-color: rgba(57, 255, 136, .16);
}

hr {
    border-color: rgba(57, 255, 136, .2);
}

@media (prefers-reduced-motion: reduce) {
    body {
        background-attachment: scroll;
    }
}
/* END PAGE POLISH: DARK BACKGROUND */

/* PAGE POLISH: DARK MODALS AND DROPDOWNS */
.bg-white,
.bg-light,
.bg-body,
.bg-body-tertiary,
.modal-content,
.modal-header,
.modal-body,
.modal-footer,
.dropdown-menu,
.dropdown-item,
.accordion-item,
.accordion-button,
.card-header,
.card-footer,
.popover,
.popover-header,
.popover-body,
.offcanvas,
.list-group-item {
    background-color: #101613 !important;
    color: #e8f5ed !important;
    border-color: rgba(57, 255, 136, .22) !important;
}

.dropdown-item:hover,
.dropdown-item:focus,
.accordion-button:not(.collapsed) {
    background-color: #18251d !important;
    color: #39ff88 !important;
}

.modal-title,
.popover-header,
.accordion-button {
    color: #e8f5ed !important;
}

.modal-content a,
.dropdown-menu a,
.accordion-body a {
    color: #39ff88;
}

.modal-content .btn-close,
.offcanvas .btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
}
/* END PAGE POLISH: DARK MODALS AND DROPDOWNS */

/* PAGE POLISH: CONFIRM ORDER TABLE DARK GREEN */
main.content-wrapper table.table {
    --bs-table-bg: #0b120e;
    --bs-table-color: #e3f3e9;
    --bs-table-border-color: rgba(57, 255, 136, .20);
    --bs-table-striped-bg: #101a14;
    --bs-table-striped-color: #e3f3e9;
    --bs-table-hover-bg: #14251a;
    --bs-table-hover-color: #f0fff5;
    color: #e3f3e9 !important;
    background-color: #0b120e !important;
    border-color: rgba(57, 255, 136, .20) !important;
}

main.content-wrapper table.table > :not(caption) > * > * {
    color: #e3f3e9 !important;
    background-color: #0b120e !important;
    border-bottom-color: rgba(57, 255, 136, .20) !important;
    box-shadow: none !important;
}

main.content-wrapper table.table .text-body,
main.content-wrapper table.table .text-body-secondary,
main.content-wrapper table.table .text-dark-emphasis {
    color: #c5dfd0 !important;
}

main.content-wrapper table.table a {
    color: #8affc6 !important;
}

main.content-wrapper .bg-body-tertiary.rounded-5 {
    background-color: #101613 !important;
    color: #e8f5ed !important;
    border: 1px solid rgba(57, 255, 136, .20);
}

main.content-wrapper .bg-body-tertiary.rounded-5 .border-bottom,
main.content-wrapper .bg-body-tertiary.rounded-5 .border-top {
    border-color: rgba(57, 255, 136, .22) !important;
}

.fixed-bottom.bg-body {
    background-color: #101613 !important;
    border-color: rgba(57, 255, 136, .22) !important;
}

/* END PAGE POLISH: CONFIRM ORDER TABLE DARK GREEN */

/* PAGE POLISH: PRODUCT DESCRIPTION DROPDOWN TEXT */
main.content-wrapper .accordion,
main.content-wrapper .accordion-item,
main.content-wrapper .accordion-body,
main.content-wrapper .collapse,
main.content-wrapper .collapse.show,
main.content-wrapper .dropdown-menu,
main.content-wrapper .popover {
    color: #e8f5ed !important;
}

main.content-wrapper .accordion-button,
main.content-wrapper .dropdown-item,
main.content-wrapper .popover-header,
main.content-wrapper .popover-body {
    color: #e8f5ed !important;
}

main.content-wrapper .accordion-button:not(.collapsed) {
    color: #8affc6 !important;
    background-color: #101d15 !important;
}

main.content-wrapper .accordion-button::after {
    filter: brightness(0) saturate(100%)
            invert(85%) sepia(28%) saturate(650%)
            hue-rotate(85deg) brightness(105%);
}

main.content-wrapper .accordion-body a,
main.content-wrapper .collapse a,
main.content-wrapper .popover a,
main.content-wrapper .dropdown-menu a {
    color: #8affc6 !important;
}

main.content-wrapper .accordion-body small,
main.content-wrapper .collapse small,
main.content-wrapper .popover small {
    color: #b8cfc0 !important;
}

/* END PAGE POLISH: PRODUCT DESCRIPTION DROPDOWN TEXT */

/* PAGE POLISH: PRODUCT DESCRIPTION CONTENT CONTRAST */
#description-tab-pane,
#description-tab-pane .row,
#description-tab-pane p,
#description-tab-pane div,
#description-tab-pane span,
#description-tab-pane li,
#description-tab-pane td,
#description-tab-pane th,
#description-tab-pane label,
#description-tab-pane strong,
#description-tab-pane b,
#description-tab-pane em,
#description-tab-pane h1,
#description-tab-pane h2,
#description-tab-pane h3,
#description-tab-pane h4,
#description-tab-pane h5,
#description-tab-pane h6 {
    color: #e8f5ed !important;
}

#description-tab-pane a {
    color: #8affc6 !important;
}

#description-tab-pane [style*="color"],
#description-tab-pane [color] {
    color: #e8f5ed !important;
}

#description-tab-pane img {
    max-width: 100%;
    height: auto;
}

/* END PAGE POLISH: PRODUCT DESCRIPTION CONTENT CONTRAST */
