/* ==================== 商家管理后台样式 ==================== */

.admin-body {
    background: #f5f6fa;
}

.admin-header {
    background: #1f2430;
    padding: 0;
    color: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    position: sticky;
    top: 0;
    z-index: 500;
}

.admin-header-inner {
    max-width: 1300px;
    margin: 0 auto;
    padding: 12px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.admin-header .logo {
    color: white;
}

.admin-header .logo img {
    height: 36px;
}

.admin-back {
    color: #ccc;
    font-size: 14px;
    padding: 8px 16px;
    border: 1px solid #444;
    border-radius: 18px;
    transition: all 0.2s;
}

.admin-back:hover {
    color: white;
    border-color: white;
}

.admin-main {
    max-width: 1300px;
    margin: 24px auto;
    padding: 0 15px;
}

.admin-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 18px;
    border-bottom: 2px solid #e3e6ee;
    padding-bottom: 0;
}

.admin-tab {
    border: none;
    background: none;
    padding: 12px 22px;
    font-size: 15px;
    color: #666;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.admin-tab:hover {
    color: #e1251b;
}

.admin-tab.active {
    color: #e1251b;
    border-bottom-color: #e1251b;
    font-weight: bold;
}

.tab-badge {
    background: #e1251b;
    color: white;
    font-size: 11px;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
    font-weight: bold;
}

.admin-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.admin-search {
    flex: 1;
    max-width: 360px;
    padding: 10px 14px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.admin-search:focus {
    border-color: #e1251b;
}

.admin-btn {
    padding: 9px 18px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    color: #333;
}

.admin-btn:hover {
    border-color: #bbb;
    background: #fafafa;
}

.admin-btn.primary {
    background: #e1251b;
    border-color: #e1251b;
    color: white;
}

.admin-btn.primary:hover {
    background: #c60a00;
}

.admin-btn.danger {
    color: #e1251b;
    border-color: #f0c0bd;
}

.admin-btn.danger:hover {
    background: #fff0f0;
}

.admin-btn.small {
    padding: 5px 12px;
    font-size: 13px;
}

.admin-table-wrap {
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    overflow-x: auto;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    min-width: 860px;
}

.admin-table th {
    background: #fafbfc;
    padding: 13px 14px;
    text-align: left;
    font-size: 13px;
    color: #666;
    border-bottom: 1px solid #eee;
    white-space: nowrap;
}

.admin-table td {
    padding: 12px 14px;
    border-bottom: 1px solid #f3f4f6;
    vertical-align: middle;
    color: #333;
}

.admin-table tr:last-child td {
    border-bottom: none;
}

.admin-table tr:hover td {
    background: #fafbfe;
}

.td-name {
    max-width: 260px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.td-price {
    color: #e1251b;
    font-weight: bold;
    white-space: nowrap;
}

.td-orig {
    display: block;
    font-size: 11px;
    color: #bbb;
    text-decoration: line-through;
    font-weight: normal;
}

.td-rating {
    font-size: 12px;
    line-height: 1.7;
}

.td-stars {
    color: #ff9500;
    letter-spacing: 1px;
}

.td-sub {
    font-size: 12px;
    color: #999;
}

.td-order-id {
    font-family: Consolas, monospace;
    font-size: 12px;
    color: #888;
    white-space: nowrap;
}

.td-actions {
    white-space: nowrap;
}

.admin-thumb {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid #eee;
    display: block;
}

.stock-pill {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    background: #e8f7ee;
    color: #1a9e4b;
    font-size: 13px;
    font-weight: bold;
}

.stock-pill.low {
    background: #fdf3e3;
    color: #e6a23c;
}

.stock-pill.zero {
    background: #feeceb;
    color: #e1251b;
}

.td-tag {
    display: inline-block;
    background: #fff0f0;
    color: #e1251b;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
    margin: 2px 3px 2px 0;
}

.status-pill {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 13px;
    white-space: nowrap;
}

.status-pill.待发货 {
    background: #fdf3e3;
    color: #e6a23c;
    font-weight: bold;
}

.status-pill.已发货 {
    background: #e6f2ff;
    color: #409eff;
    font-weight: bold;
}

.status-pill.已完成 {
    background: #e8f7ee;
    color: #1a9e4b;
    font-weight: bold;
}

.admin-empty {
    text-align: center;
    padding: 60px 20px;
    color: #999;
    font-size: 14px;
}

/* 商品编辑弹窗 */
.admin-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.55);
    justify-content: center;
    align-items: center;
    z-index: 3000;
}

.admin-modal-box {
    background: white;
    border-radius: 14px;
    width: 92%;
    max-width: 640px;
    max-height: 92%;
    overflow-y: auto;
    padding: 28px;
    position: relative;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.25);
    animation: fadeIn 0.3s ease;
}

.admin-modal-title {
    font-size: 19px;
    margin-bottom: 20px;
    padding-right: 30px;
}

.admin-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.admin-form-grid .span-2 {
    grid-column: span 2;
}

.admin-form-grid .form-group label {
    display: block;
    font-size: 13px;
    color: #666;
    margin-bottom: 6px;
}

.admin-form-grid input,
.admin-form-grid select,
.admin-form-grid textarea {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    outline: none;
    font-family: inherit;
    transition: border-color 0.2s;
}

.admin-form-grid input:focus,
.admin-form-grid select:focus,
.admin-form-grid textarea:focus {
    border-color: #e1251b;
}

.form-hint {
    font-size: 12px;
    color: #aaa;
    margin-top: 4px;
}

.admin-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 22px;
    padding-top: 16px;
    border-top: 1px solid #f0f0f0;
}

/* 删除确认弹窗 */
.confirm-box {
    max-width: 420px;
    text-align: center;
}

.confirm-icon {
    width: 52px;
    height: 52px;
    margin: 0 auto 10px;
    color: #e1251b;
    background: #fdeceb;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.confirm-icon svg {
    width: 26px;
    height: 26px;
}

.confirm-title {
    text-align: center;
    padding-right: 0;
}

.confirm-text {
    font-size: 14px;
    color: #666;
    line-height: 1.7;
    margin-bottom: 8px;
}

.confirm-actions {
    justify-content: center;
    border-top: none;
    padding-top: 10px;
}

.confirm-actions .admin-btn {
    min-width: 100px;
    padding: 10px 0;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(12px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 640px) {
    .admin-form-grid {
        grid-template-columns: 1fr;
    }

    .admin-form-grid .span-2 {
        grid-column: span 1;
    }

    .admin-tab {
        padding: 10px 14px;
        font-size: 14px;
    }
}
