/*
 * Custom Template CSS — 自动发卡商城
 * 基于 shadan 模板改造
 */

/* ===== 全局重置 ===== */
* { box-sizing: border-box; }

html, body {
    min-height: 100vh;
    margin: 0;
    padding: 0;
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
    color: #333;
    font-size: 14px;
}

body { background: transparent; }

/* ===== 顶部导航 ===== */
.custom-header {
    width: 100%;
    background: rgba(30, 52, 92, 0.92);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: 0 1px 6px rgba(0,0,0,0.12);
    position: relative;
    z-index: 100;
}
.custom-header-inner {
    width: calc(100% - 40px);
    max-width: 1160px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}
.custom-header-left { flex-shrink: 0; }
.custom-logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: #fff;
}
.custom-logo-text {
    font-size: 26px;
    color: #fff;
    font-weight: 400;
    white-space: nowrap;
}
.custom-logo img { vertical-align: middle; }
.custom-header-right {
    display: flex;
    align-items: center;
    gap: 6px;
}
.custom-nav-item {
    display: inline-block;
    padding: 8px 16px;
    color: rgba(255,255,255,0.82);
    text-decoration: none;
    font-size: 15px;
    border-radius: 3px;
    transition: all .2s;
    white-space: nowrap;
}
.custom-nav-item:hover { color: #fff; background: rgba(255,255,255,0.12); }
.custom-nav-item.active { color: #fff; background: rgba(255,255,255,0.18); }

/* 用户下拉 */
.custom-nav-user { position: relative; }
.custom-nav-avatar { cursor: pointer; }
.custom-nav-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background: #fff;
    border-radius: 4px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    min-width: 140px;
    padding: 4px 0;
    z-index: 200;
}
.custom-nav-dropdown a {
    display: block;
    padding: 10px 20px;
    color: #333;
    text-decoration: none;
    font-size: 14px;
}
.custom-nav-dropdown a:hover { background: #f5f5f5; }
.custom-nav-user:hover .custom-nav-dropdown { display: block; }

/* 手机端切换 */
.custom-mobile-toggle {
    display: none;
    background: none;
    border: none;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    padding: 4px 8px;
}
.custom-mobile-menu {
    display: none;
    background: rgba(30,52,92,0.97);
    flex-direction: column;
    padding: 8px 0;
}
.custom-mobile-menu a {
    display: block;
    padding: 12px 24px;
    color: rgba(255,255,255,0.88);
    text-decoration: none;
    font-size: 15px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}
.custom-mobile-menu.show { display: flex; }

/* ===== 主体容器 ===== */
.custom-main {
    width: calc(100% - 40px);
    max-width: 1160px;
    margin: 0 auto;
    padding: 18px 0 30px;
}

/* ===== 公告卡片 ===== */
.custom-notice {
    background: rgba(255,255,255,0.84);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border-radius: 3px;
    padding: 20px 28px;
    margin-bottom: 16px;
    box-shadow: 0 1px 8px rgba(0,0,0,0.06);
    line-height: 1.8;
    font-size: 14px;
    color: #333;
    text-align: center;
}
.custom-notice-label {
    color: #666;
    font-size: 13px;
    margin-bottom: 8px;
}
.custom-notice a { color: #009fe8; text-decoration: none; }
.custom-notice .red, .custom-notice span[style*="red"], .custom-notice font[color="red"] { color: #e53b3b !important; }

/* ===== 商品分类卡片 ===== */
.custom-category {
    background: rgba(255,255,255,0.84);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border-radius: 3px;
    margin-bottom: 12px;
    box-shadow: 0 1px 8px rgba(0,0,0,0.06);
    overflow: hidden;
}
.custom-category-title {
    padding: 14px 20px;
    font-size: 15px;
    color: #333;
    font-weight: 500;
    border-bottom: 1px solid rgba(0,0,0,0.08);
}

/* ===== 商品表格 ===== */
.custom-product-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    table-layout: fixed;
}
.custom-product-table thead th {
    padding: 11px 14px;
    color: #555;
    font-weight: 500;
    font-size: 13px;
    border-bottom: 1px solid rgba(0,0,0,0.1);
    background: rgba(250,250,250,0.5);
}
.custom-product-table th.col-name { text-align: left; }
.custom-product-table th.col-price { text-align: right; width: 110px; }
.custom-product-table th.col-stock { text-align: center; width: 85px; }
.custom-product-table th.col-action { text-align: center; width: 80px; }
.custom-product-table tbody td {
    padding: 12px 14px;
    border-bottom: 1px solid rgba(0,0,0,0.06);
    color: #333;
}
.custom-product-table td.col-name { text-align: left; font-size: 14px; color: #252525; }
.custom-product-table td.col-price { text-align: right; font-size: 14px; color: #333; }
.custom-product-table td.col-stock { text-align: center; font-size: 13px; }
.custom-product-table td.col-action { text-align: center; }
.custom-product-table tbody tr:hover { background: rgba(0,0,0,0.02); }

/* 购买链接 */
.custom-buy-link {
    display: inline-block;
    color: #009fe8;
    text-decoration: none;
    font-size: 14px;
    padding: 3px 8px;
    border-radius: 2px;
    transition: all .2s;
}
.custom-buy-link:hover { color: #007bc1; text-decoration: underline; }
.custom-buy-link.disabled {
    color: #bbb;
    cursor: not-allowed;
    pointer-events: none;
}

/* ===== 库存状态 ===== */
.stock-ample { color: #5a5a5a; }
.stock-low { color: #f59e0b; }
.stock-out { color: #e53b3b; }

/* ===== 移动端商品卡片 ===== */
.custom-product-mobile-list { display: none; }
.custom-product-mobile-item {
    padding: 14px 16px;
    border-bottom: 1px solid rgba(0,0,0,0.06);
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.custom-product-mobile-item:last-child { border-bottom: none; }
.custom-mobile-pname { font-size: 14px; color: #252525; line-height: 1.5; }
.custom-mobile-pinfo { display: flex; justify-content: space-between; align-items: center; }
.custom-mobile-price { font-size: 16px; color: #333; font-weight: 500; }
.custom-mobile-stock { font-size: 13px; }
.custom-mobile-action { text-align: right; }
.custom-mobile-action .custom-buy-link {
    padding: 8px 18px;
    background: rgba(0,158,232,0.08);
    border-radius: 3px;
    font-size: 14px;
}

/* ===== 通用面板（支付/查询/详情） ===== */
.custom-panel {
    background: rgba(255,255,255,0.84);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border-radius: 3px;
    padding: 24px 28px;
    box-shadow: 0 1px 8px rgba(0,0,0,0.06);
    margin-bottom: 16px;
}
.custom-panel-title {
    font-size: 22px;
    color: #222;
    font-weight: 600;
    margin-bottom: 20px;
    padding-bottom: 14px;
    border-bottom: 1px solid rgba(0,0,0,0.1);
}

/* ===== 详情页 ===== */
.custom-detail-wrap {
    display: flex;
    gap: 24px;
}
.custom-detail-left {
    flex: 0 0 33%;
    min-width: 0;
}
.custom-detail-right {
    flex: 1;
    min-width: 0;
}
.custom-detail-left .custom-panel { height: 100%; }
.custom-detail-desc {
    font-size: 14px;
    color: #444;
    line-height: 1.8;
}
.custom-detail-desc img { max-width: 100%; height: auto; }
.custom-detail-img {
    max-width: 100%;
    max-height: 140px;
    margin-bottom: 16px;
    border-radius: 2px;
}

/* 详情右侧 */
.custom-product-title {
    font-size: 24px;
    color: #222;
    font-weight: 600;
    margin-bottom: 20px;
}
.custom-product-meta {
    margin-bottom: 20px;
    font-size: 15px;
    color: #555;
}
.custom-product-price {
    font-size: 18px;
    color: #ff6a00;
    font-weight: 600;
}
.custom-auto-tag {
    display: inline-block;
    background: #15bdf4;
    color: #fff;
    padding: 3px 12px;
    border-radius: 12px;
    font-size: 13px;
    margin-left: 8px;
}
.custom-manual-tag {
    display: inline-block;
    background: #888;
    color: #fff;
    padding: 3px 12px;
    border-radius: 12px;
    font-size: 13px;
    margin-left: 8px;
}

/* 详情表单 */
.custom-detail-form .layui-form-item { margin-bottom: 16px; }
.custom-detail-form .layui-form-label {
    float: none;
    display: block;
    padding: 0 0 6px 0;
    color: #666;
    font-size: 13px;
    text-align: left;
    width: auto;
    background: none;
}
.custom-detail-form .layui-input-block {
    margin-left: 0 !important;
}
.custom-input {
    width: 100%;
    border: none;
    border-bottom: 1px solid rgba(0,0,0,0.25);
    background: transparent;
    padding: 8px 2px;
    font-size: 14px;
    color: #333;
    outline: none;
    transition: border-color .2s;
    font-family: inherit;
}
.custom-input:focus {
    border-bottom-color: #009fe8;
}
.custom-input[readonly], .custom-input[disabled] {
    background: transparent;
    color: #888;
}

/* 数量调整 */
.custom-qty-wrap {
    display: flex;
    align-items: center;
    gap: 0;
}
.custom-qty-btn {
    width: 34px;
    height: 34px;
    border: 1px solid rgba(0,0,0,0.2);
    background: transparent;
    color: #555;
    font-size: 16px;
    cursor: pointer;
    line-height: 34px;
    text-align: center;
    user-select: none;
}
.custom-qty-btn:hover { background: rgba(0,0,0,0.04); }
.custom-qty-btn:first-child { border-radius: 3px 0 0 3px; }
.custom-qty-btn:last-child { border-radius: 0 3px 3px 0; }
.custom-qty-input {
    width: 56px;
    height: 34px;
    border: 1px solid rgba(0,0,0,0.2);
    border-left: none;
    border-right: none;
    text-align: center;
    font-size: 14px;
    color: #333;
    background: transparent;
    outline: none;
}

/* 库存信息行 */
.custom-stock-info {
    text-align: right;
    font-size: 14px;
}
.custom-total-price {
    font-size: 18px;
    font-weight: 600;
    color: #ff6a00;
    margin: 12px 0;
}

/* 按钮 */
.custom-btn-primary {
    display: inline-block;
    padding: 10px 28px;
    background: #e94300;
    color: #fff;
    border: none;
    border-radius: 3px;
    font-size: 15px;
    cursor: pointer;
    text-decoration: none;
    transition: background .2s;
    min-width: 120px;
    text-align: center;
}
.custom-btn-primary:hover { background: #d03b00; color: #fff; text-decoration: none; }
.custom-btn-primary:disabled, .custom-btn-primary.disabled {
    background: #ccc;
    cursor: not-allowed;
    color: #999;
}
.custom-btn-secondary {
    display: inline-block;
    padding: 10px 22px;
    background: #fff;
    color: #555;
    border: 1px solid #bbb;
    border-radius: 3px;
    font-size: 15px;
    cursor: pointer;
    text-decoration: none;
    transition: all .2s;
    min-width: 85px;
    text-align: center;
}
.custom-btn-secondary:hover { border-color: #888; color: #333; text-decoration: none; }
.custom-btn-blue {
    display: inline-block;
    padding: 10px 24px;
    background: #009fe8;
    color: #fff;
    border: none;
    border-radius: 3px;
    font-size: 15px;
    cursor: pointer;
    text-decoration: none;
}
.custom-btn-blue:hover { background: #0089cc; color: #fff; text-decoration: none; }

/* 支付页 */
.custom-pay-methods {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin: 16px 0;
    justify-content: center;
}
.custom-pay-methods a {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 3px;
    background: rgba(0,158,232,0.08);
    color: #009fe8;
    text-decoration: none;
    font-size: 14px;
    cursor: pointer;
    transition: all .2s;
}
.custom-pay-methods a:hover { background: rgba(0,158,232,0.18); }
.custom-pay-methods a img { height: 36px; vertical-align: middle; }

/* 查询页 */
.custom-query-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 20px;
    border-bottom: 1px solid rgba(0,0,0,0.1);
}
.custom-query-tabs a {
    display: inline-block;
    padding: 10px 20px;
    color: #666;
    text-decoration: none;
    font-size: 14px;
    border-bottom: 2px solid transparent;
    transition: all .2s;
}
.custom-query-tabs a:hover { color: #333; }
.custom-query-tabs a.active {
    color: #009fe8;
    border-bottom-color: #009fe8;
}

/* 查询结果表格 */
.custom-result-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
.custom-result-table th {
    padding: 10px 12px;
    text-align: left;
    color: #555;
    font-weight: 500;
    font-size: 13px;
    border-bottom: 1px solid rgba(0,0,0,0.12);
    background: rgba(250,250,250,0.5);
}
.custom-result-table td {
    padding: 12px;
    border-bottom: 1px solid rgba(0,0,0,0.06);
    color: #333;
}

/* 兑换码展示 */
.custom-kami-section {
    margin-top: 20px;
    padding: 20px;
    background: rgba(245,245,245,0.7);
    border-radius: 3px;
    text-align: center;
}
.custom-kami-title {
    font-size: 15px;
    color: #333;
    margin-bottom: 12px;
}
.custom-kami-code {
    display: inline-block;
    padding: 11px 20px;
    background: #fff;
    border: 1px solid rgba(0,0,0,0.12);
    border-radius: 3px;
    font-family: "Consolas", "Courier New", monospace;
    font-size: 15px;
    color: #222;
    margin: 4px 0;
    word-break: break-all;
}
.custom-kami-list { text-align: left; margin: 12px 0; }
.custom-kami-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    border-bottom: 1px solid rgba(0,0,0,0.06);
    font-size: 14px;
}
.custom-kami-item-label {
    color: #888;
    font-size: 13px;
    margin-right: 12px;
    white-space: nowrap;
}
.custom-kami-item-code {
    font-family: "Consolas", "Courier New", monospace;
    font-size: 14px;
    color: #222;
    word-break: break-all;
    flex: 1;
}
.custom-kami-item-copy {
    margin-left: 12px;
    color: #009fe8;
    cursor: pointer;
    font-size: 13px;
    white-space: nowrap;
    background: none;
    border: none;
}
.custom-kami-item-copy:hover { color: #007bc1; }

/* 成功页面 */
.custom-success-icon {
    font-size: 48px;
    color: #4caf50;
    margin-bottom: 12px;
}
.custom-success-title {
    font-size: 22px;
    color: #333;
    font-weight: 600;
    margin-bottom: 20px;
}

/* 背景提示 */
.custom-empty {
    text-align: center;
    padding: 40px 20px;
    color: #999;
    font-size: 14px;
}

/* 团购/分类页 */
.custom-group-product {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.custom-group-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    background: rgba(255,255,255,0.5);
    border-radius: 3px;
    border: 1px solid rgba(0,0,0,0.06);
}
.custom-group-item .name { font-size: 14px; color: #333; flex: 1; }
.custom-group-item .info { font-size: 13px; color: #888; margin: 0 16px; }

/* 友链 / 关于 */
.custom-about {
    font-size: 14px;
    color: #555;
    line-height: 1.8;
}
.custom-about h2 { font-size: 18px; margin: 16px 0 8px; color: #333; }

/* ===== 页脚 ===== */
.custom-footer {
    width: 100%;
    text-align: center;
    padding: 20px 0;
    color: rgba(255,255,255,0.6);
    font-size: 13px;
}
.custom-footer-inner {
    width: calc(100% - 40px);
    max-width: 1160px;
    margin: 0 auto;
}
.custom-footer a {
    color: rgba(255,255,255,0.6);
    text-decoration: none;
}
.custom-footer a:hover { color: rgba(255,255,255,0.9); }

/* ===== 移动端响应式 ===== */
@media (max-width: 768px) {
    html, body { background-attachment: scroll; }

    .custom-header-inner { height: 56px; }
    .custom-logo-text { font-size: 20px; }
    .custom-header-right { display: none; }
    .custom-mobile-toggle { display: block; }

    .custom-main {
        width: calc(100% - 24px);
        padding: 12px 0 24px;
    }

    .custom-notice { padding: 14px 16px; font-size: 13px; }

    /* 隐藏 PC 表格，显示卡片 */
    .custom-product-table { display: none; }
    .custom-product-mobile-list { display: block; }

    /* 详情 - 上下布局 */
    .custom-detail-wrap { flex-direction: column; gap: 12px; }
    .custom-detail-left { flex: auto; }
    .custom-panel { padding: 16px 18px; }
    .custom-panel-title { font-size: 18px; }
    .custom-product-title { font-size: 20px; }
    .custom-btn-primary, .custom-btn-secondary {
        width: 100%;
        display: block;
        margin: 4px 0;
    }

    /* 查询页 */
    .custom-query-tabs a { padding: 8px 12px; font-size: 13px; }

    /* 结果表格 */
    .custom-result-table, .custom-result-table thead, .custom-result-table tbody,
    .custom-result-table th, .custom-result-table td, .custom-result-table tr {
        display: block;
        width: 100%;
    }
    .custom-result-table thead { display: none; }
    .custom-result-table tr { margin-bottom: 12px; border: 1px solid rgba(0,0,0,0.08); border-radius: 3px; padding: 8px 12px; }
    .custom-result-table td { border: none; padding: 4px 0; display: flex; justify-content: space-between; }
    .custom-result-table td::before { content: attr(data-label); color: #888; font-size: 13px; }

    .custom-footer { font-size: 12px; }
}

@media (max-width: 480px) {
    .custom-main { width: calc(100% - 20px); padding: 8px 0 20px; }
    .custom-header-inner { height: 52px; padding: 0 8px; width: 100%; }
    .custom-logo-text { font-size: 18px; }
}
