/**
 * 拍卖行 — 前台与后台样式
 * 颜色全部走 --mn-* 变量（含浅色 fallback），双主题自适应。
 * @file plugins/auction_house/assets/style.css
 */

/* ===== 前台容器 =====
   规范 §6.4-2：`.mn-section` 铺满中栏、自身不限宽也不带内边距，
   宽度与内边距统一由内层 `.ah-wrap` 承担（1080px 站内统一口径）。
   `.ah-wrap-narrow` 是「详情/表单长文阅读」的显式例外（760px）。
   ⚠️ `.ah-page` 这个名字被下方「分页链接」占用，容器不沿用该名字。 */
.ah-wrap {
    max-width: 1080px;
    margin: 0 auto;
    padding: 16px 20px 24px;
}

.ah-wrap-narrow {
    max-width: 760px;
}

@media (max-width: 860px) {
    .ah-wrap {
        padding: 14px 14px 18px;
    }
}

.ah-header-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* ===== 按钮 ===== */
.ah-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 7px 13px;
    border: 1px solid var(--mn-border, #e5e7eb);
    border-radius: 7px;
    background: var(--mn-bg-card, #ffffff);
    font-size: 13px;
    color: var(--mn-text, #111827);
    text-decoration: none;
    cursor: pointer;
    transition: background 0.15s;
}

.ah-btn:hover {
    background: var(--mn-bg-nav-hover, #f3f4f6);
}

.ah-btn-primary {
    border-color: var(--mn-primary, #4f46e5);
    background: var(--mn-primary, #4f46e5);
    color: var(--mn-text-white, #ffffff);
}

.ah-btn-primary:hover {
    border-color: var(--mn-primary-hover, #4338ca);
    background: var(--mn-primary-hover, #4338ca);
    /* 核心 a:hover 会把 <a> 文字色改为 primary-hover，与背景同色导致文字消失 */
    color: var(--mn-text-white, #ffffff);
}

.ah-btn-ghost {
    background: transparent;
    color: var(--mn-text-secondary, #6b7280);
}

/* ===== 卡片网格 ===== */
.ah-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 12px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.ah-card {
    border: 1px solid var(--mn-border, #e5e7eb);
    border-radius: 11px;
    background: var(--mn-bg-card, #ffffff);
    transition: border-color 0.15s, transform 0.15s;
}

.ah-card:hover {
    border-color: var(--mn-primary, #4f46e5);
    transform: translateY(-1px);
}

.ah-card-link {
    display: block;
    padding: 15px 16px;
    text-decoration: none;
    color: inherit;
}

.ah-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 10px;
}

.ah-card-title {
    margin: 0 0 6px;
    font-size: 14.5px;
    font-weight: 600;
    line-height: 1.5;
    color: var(--mn-text, #111827);
}

.ah-card-desc {
    margin: 0 0 10px;
    font-size: 12.5px;
    line-height: 1.6;
    color: var(--mn-text-muted, #9ca3af);
}

.ah-card-price {
    display: flex;
    align-items: baseline;
    gap: 7px;
    padding-top: 10px;
    border-top: 1px dashed var(--mn-border-light, #f0f0f0);
}

.ah-price-label {
    font-size: 11.5px;
    color: var(--mn-text-muted, #9ca3af);
}

.ah-price {
    font-size: 19px;
    font-weight: 700;
    color: var(--mn-warning, #d97706);
}

.ah-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 7px;
    font-size: 11.5px;
    color: var(--mn-text-muted, #9ca3af);
}

/* ===== 徽标 ===== */
.ah-badge {
    display: inline-block;
    padding: 2px 9px;
    border-radius: 999px;
    font-size: 11.5px;
    line-height: 1.6;
    white-space: nowrap;
    background: var(--mn-bg-body, #f3f4f6);
    color: var(--mn-text-secondary, #6b7280);
}

.ah-badge-live {
    background: var(--mn-primary-subtle, #eef2ff);
    color: var(--mn-primary, #4f46e5);
}

.ah-badge-open {
    background: var(--mn-primary-subtle, #eef2ff);
    color: var(--mn-primary, #4f46e5);
}

.ah-badge-settled {
    background: var(--mn-bg-row-hover, #ecfdf5);
    color: var(--mn-success, #16a34a);
}

.ah-badge-passed,
.ah-badge-canceled {
    background: var(--mn-bg-body, #f3f4f6);
    color: var(--mn-text-muted, #9ca3af);
}

.ah-badge-final {
    background: var(--mn-bg-body, #f3f4f6);
    color: var(--mn-text-secondary, #6b7280);
}

/* ===== 倒计时 ===== */
.ah-countdown {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11.5px;
    color: var(--mn-text-muted, #9ca3af);
    font-variant-numeric: tabular-nums;
}

.ah-countdown-lg {
    font-size: 13px;
    font-weight: 600;
    color: var(--mn-warning, #d97706);
}

.ah-countdown-sm {
    font-size: 11.5px;
    color: var(--mn-text-muted, #9ca3af);
    font-variant-numeric: tabular-nums;
}

/* ===== 详情摘要 ===== */
.ah-desc {
    padding: 12px 14px;
    margin: 0 0 14px;
    border-left: 3px solid var(--mn-primary, #4f46e5);
    border-radius: 0 8px 8px 0;
    background: var(--mn-primary-subtle, #eef2ff);
    font-size: 13px;
    line-height: 1.75;
    color: var(--mn-text, #111827);
}

.ah-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    padding: 16px 18px;
    margin: 0 0 12px;
    border: 1px solid var(--mn-border, #e5e7eb);
    border-radius: 11px;
    background: var(--mn-bg-body, #f9fafb);
}

.ah-price-lg {
    font-size: 26px;
    font-weight: 700;
    color: var(--mn-warning, #d97706);
}

.ah-summary-sub {
    display: block;
    margin-top: 3px;
    font-size: 11.5px;
    color: var(--mn-text-muted, #9ca3af);
}

.ah-leader {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px;
    padding: 11px 14px;
    margin: 0 0 16px;
    border-radius: 9px;
    background: var(--mn-bg-body, #f9fafb);
    font-size: 12.5px;
    color: var(--mn-text-secondary, #6b7280);
}

.ah-you {
    padding: 1px 8px;
    border-radius: 999px;
    background: var(--mn-primary, #4f46e5);
    font-size: 11px;
    color: var(--mn-text-white, #ffffff);
}

.ah-you-sm {
    flex: 0 0 auto;
}

/* ===== 出价表单 ===== */
.ah-bid-form {
    padding: 14px 16px;
    margin: 0 0 18px;
    border: 1px solid var(--mn-primary, #4f46e5);
    border-radius: 11px;
    background: var(--mn-bg-card, #ffffff);
}

.ah-bid-label {
    display: block;
    margin-bottom: 7px;
    font-size: 13px;
    font-weight: 500;
    color: var(--mn-text, #111827);
}

.ah-bid-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.ah-input {
    flex: 1 1 160px;
    min-width: 120px;
    padding: 8px 11px;
    border: 1px solid var(--mn-border, #e5e7eb);
    border-radius: 7px;
    background: var(--mn-bg-input, #ffffff);
    font-size: 14px;
    font-weight: 600;
    color: var(--mn-text, #111827);
}

.ah-input:focus {
    outline: none;
    border-color: var(--mn-primary, #4f46e5);
}

.ah-hint {
    margin: 8px 0 0;
    font-size: 12px;
    line-height: 1.6;
    color: var(--mn-text-muted, #9ca3af);
}

.ah-login-tip {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 12px 14px;
    margin: 0 0 18px;
    border-radius: 9px;
    background: var(--mn-bg-body, #f3f4f6);
    font-size: 13px;
    color: var(--mn-text-secondary, #6b7280);
}

.ah-login-tip a {
    color: var(--mn-primary, #4f46e5);
    text-decoration: none;
}

.ah-login-tip a:hover {
    text-decoration: underline;
}

/* ===== 出价记录 ===== */
.ah-h3 {
    display: flex;
    align-items: center;
    gap: 7px;
    margin: 20px 0 12px;
    font-size: 14px;
    font-weight: 600;
    color: var(--mn-text, #111827);
}

.ah-count {
    padding: 1px 8px;
    border-radius: 999px;
    background: var(--mn-primary-subtle, #eef2ff);
    font-size: 11.5px;
    font-weight: 500;
    color: var(--mn-primary, #4f46e5);
}

.ah-bids {
    margin: 0;
    padding: 0;
    list-style: none;
}

.ah-bid-item {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--mn-border-light, #f0f0f0);
    font-size: 13px;
}

.ah-bid-item:last-child {
    border-bottom: 0;
}

.ah-bid-user {
    font-weight: 500;
    color: var(--mn-text, #111827);
}

.ah-bid-amount {
    font-weight: 700;
    color: var(--mn-warning, #d97706);
}

.ah-bid-state {
    padding: 1px 8px;
    border-radius: 5px;
    font-size: 11px;
}

.ah-bid-frozen {
    background: var(--mn-primary-subtle, #eef2ff);
    color: var(--mn-primary, #4f46e5);
}

.ah-bid-refunded {
    background: var(--mn-bg-body, #f3f4f6);
    color: var(--mn-text-muted, #9ca3af);
}

.ah-bid-won {
    background: var(--mn-bg-row-hover, #ecfdf5);
    color: var(--mn-success, #16a34a);
}

.ah-bid-time {
    margin-left: auto;
    font-size: 11.5px;
    color: var(--mn-text-muted, #9ca3af);
}

/* ===== 我的出价 ===== */
.ah-frozen-bar {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 11px 14px;
    margin: 0 0 16px;
    border-radius: 9px;
    background: var(--mn-primary-subtle, #eef2ff);
    font-size: 12.5px;
    font-weight: 500;
    color: var(--mn-primary, #4f46e5);
}

.ah-my-list,
.ah-hist-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.ah-my-item,
.ah-hist-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 13px 14px;
    margin: 0 0 9px;
    border: 1px solid var(--mn-border, #e5e7eb);
    border-radius: 10px;
    background: var(--mn-bg-card, #ffffff);
}

.ah-my-main,
.ah-hist-main {
    flex: 1 1 auto;
    min-width: 0;
}

.ah-my-title,
.ah-hist-title {
    display: block;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--mn-text, #111827);
    text-decoration: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ah-my-title:hover,
.ah-hist-title:hover {
    color: var(--mn-primary, #4f46e5);
}

.ah-my-meta,
.ah-hist-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 7px;
    font-size: 11.5px;
    color: var(--mn-text-muted, #9ca3af);
}

.ah-hist-price {
    font-weight: 700;
    color: var(--mn-warning, #d97706);
}

.ah-dim {
    color: var(--mn-text-muted, #9ca3af);
}

/* ===== 空态 ===== */
.ah-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 44px 20px;
    text-align: center;
    color: var(--mn-text-muted, #9ca3af);
}

.ah-empty p {
    margin: 0;
    font-size: 13px;
}

.ah-empty-line {
    margin: 0;
    padding: 18px 0;
    font-size: 12.5px;
    text-align: center;
    color: var(--mn-text-muted, #9ca3af);
}

/* ===== 分页 ===== */
.ah-pager {
    display: flex;
    justify-content: center;
    gap: 5px;
    margin-top: 16px;
}

.ah-page,
.ah-page-on {
    display: inline-block;
    min-width: 30px;
    padding: 5px 9px;
    border: 1px solid var(--mn-border, #e5e7eb);
    border-radius: 6px;
    font-size: 12px;
    text-align: center;
    text-decoration: none;
}

.ah-page {
    color: var(--mn-text-secondary, #6b7280);
}

.ah-page:hover {
    background: var(--mn-bg-nav-hover, #f3f4f6);
}

.ah-page-on {
    border-color: var(--mn-primary, #4f46e5);
    background: var(--mn-primary, #4f46e5);
    color: var(--mn-text-white, #ffffff);
}

/* ===== Tab ===== */
.ah-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin: 0 0 14px;
    padding: 3px;
    border-radius: 8px;
    background: var(--mn-bg-body, #f3f4f6);
}

.ah-tab {
    padding: 7px 13px;
    border-radius: 6px;
    font-size: 13px;
    color: var(--mn-text-secondary, #6b7280);
    text-decoration: none;
}

.ah-tab:hover {
    color: var(--mn-text, #111827);
}

.ah-tab-on {
    background: var(--mn-bg-card, #ffffff);
    color: var(--mn-primary, #4f46e5);
    font-weight: 600;
    box-shadow: var(--mn-shadow-sm, 0 1px 2px rgba(0, 0, 0, 0.06));
}

/* ===== 后台 ===== */
.ah-adm-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    margin: 0 0 18px;
}

.ah-adm-stat {
    padding: 14px 16px;
    border: 1px solid var(--mn-border, #e5e7eb);
    border-radius: 10px;
    background: var(--mn-bg-card, #ffffff);
    text-align: center;
}

.ah-adm-num {
    display: block;
    font-size: 22px;
    font-weight: 600;
    color: var(--mn-primary, #4f46e5);
}

.ah-adm-label {
    display: block;
    margin-top: 3px;
    font-size: 12px;
    color: var(--mn-text-muted, #9ca3af);
}

.ah-adm-card {
    padding: 18px 20px;
    margin: 0 0 18px;
    border: 1px solid var(--mn-border, #e5e7eb);
    border-radius: 10px;
    background: var(--mn-bg-card, #ffffff);
}

.ah-adm-h2 {
    margin: 0 0 14px;
    font-size: 15px;
    font-weight: 600;
    color: var(--mn-text, #111827);
}

.ah-adm-row {
    padding: 10px 0;
    border-bottom: 1px dashed var(--mn-border-light, #f0f0f0);
}

.ah-adm-check {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 13px;
    color: var(--mn-text, #111827);
    cursor: pointer;
}

.ah-adm-check input {
    width: 15px;
    height: 15px;
    accent-color: var(--mn-primary, #4f46e5);
}

.ah-adm-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 14px;
    margin: 14px 0;
}

.ah-adm-field {
    margin: 14px 0;
}

.ah-adm-field > label {
    display: block;
    margin-bottom: 5px;
    font-size: 13px;
    color: var(--mn-text, #111827);
}

.ah-adm-input {
    max-width: 150px;
    padding: 7px 10px;
    border: 1px solid var(--mn-border, #e5e7eb);
    border-radius: 6px;
    background: var(--mn-bg-input, #ffffff);
    font-size: 13px;
    color: var(--mn-text, #111827);
}

.ah-adm-wide {
    max-width: 100%;
    width: 100%;
}

.ah-adm-input:focus {
    outline: none;
    border-color: var(--mn-primary, #4f46e5);
}

.ah-adm-desc {
    margin: 4px 0 0;
    font-size: 12px;
    line-height: 1.6;
    color: var(--mn-text-muted, #9ca3af);
}

.ah-adm-btn {
    display: inline-block;
    padding: 7px 14px;
    border: 1px solid var(--mn-border, #e5e7eb);
    border-radius: 6px;
    background: var(--mn-bg-card, #ffffff);
    font-size: 13px;
    color: var(--mn-text, #111827);
    cursor: pointer;
}

.ah-adm-btn:hover {
    background: var(--mn-bg-nav-hover, #f3f4f6);
}

.ah-adm-btn-primary {
    border-color: var(--mn-primary, #4f46e5);
    background: var(--mn-primary, #4f46e5);
    color: var(--mn-text-white, #ffffff);
}

.ah-adm-btn-primary:hover {
    border-color: var(--mn-primary-hover, #4338ca);
    background: var(--mn-primary-hover, #4338ca);
    /* 同上：防止核心 a:hover 覆盖按钮白字 */
    color: var(--mn-text-white, #ffffff);
}

.ah-adm-btn-sm {
    padding: 4px 10px;
    font-size: 12px;
}

.ah-adm-btn-danger {
    border-color: var(--mn-warning, #d97706);
    color: var(--mn-warning, #d97706);
}

.ah-adm-btn-danger:hover {
    background: var(--mn-warning, #d97706);
    /* 琥珀色底配深色字：白字在浅琥珀（尤其暗夜主题 #fbbf24）上几乎不可读 */
    color: var(--mn-warning-ink, #111827);
}

.ah-adm-table-wrap {
    overflow-x: auto;
}

.ah-adm-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.ah-adm-table th {
    padding: 9px 10px;
    border-bottom: 1px solid var(--mn-border, #e5e7eb);
    font-size: 12px;
    font-weight: 500;
    text-align: left;
    color: var(--mn-text-muted, #9ca3af);
    white-space: nowrap;
}

.ah-adm-table td {
    padding: 10px;
    border-bottom: 1px solid var(--mn-border-light, #f0f0f0);
    color: var(--mn-text, #111827);
    vertical-align: top;
}

.ah-adm-table tr:last-child td {
    border-bottom: 0;
}

.ah-adm-table a {
    color: var(--mn-text-link, #2563eb);
    text-decoration: none;
}

.ah-adm-table a:hover {
    text-decoration: underline;
}

.ah-adm-dim {
    color: var(--mn-text-secondary, #6b7280);
    white-space: nowrap;
}

.ah-adm-sub {
    margin-top: 3px;
    font-size: 11.5px;
    color: var(--mn-text-muted, #9ca3af);
}

.ah-adm-actions {
    white-space: nowrap;
}

.ah-adm-empty {
    padding: 28px 0;
    font-size: 13px;
    text-align: center;
    color: var(--mn-text-muted, #9ca3af);
}

.ah-adm-note {
    margin: 0;
    font-size: 12px;
    line-height: 1.7;
    color: var(--mn-text-muted, #9ca3af);
}

.ah-inline {
    display: inline;
}

.ah-settle-form {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px dashed var(--mn-border-light, #f0f0f0);
}

/* ===== 窄屏 ===== */
@media (max-width: 640px) {
    .ah-grid {
        grid-template-columns: 1fr;
    }

    .ah-price-lg {
        font-size: 22px;
    }

    .ah-bid-row .ah-btn {
        width: 100%;
        justify-content: center;
    }

    .ah-bid-time {
        margin-left: 0;
        flex: 1 1 100%;
    }

    .ah-my-item,
    .ah-hist-item {
        flex-wrap: wrap;
    }

    .ah-adm-input {
        max-width: 100%;
    }
}
