/* ========================================
   风清文化 - 后台管理样式
   ======================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    background: #f5f6fa;
    color: #333;
    font-size: 14px;
    line-height: 1.6;
}

a {
    color: #ff6b35;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* ========== 登录页 ========== */
.login-page {
    background: linear-gradient(135deg, #ff9a56 0%, #ff6b35 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-box {
    background: #fff;
    border-radius: 16px;
    padding: 40px 30px;
    width: 100%;
    max-width: 380px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-header .logo {
    font-size: 56px;
    margin-bottom: 10px;
}

.login-header h1 {
    font-size: 22px;
    color: #333;
    margin-bottom: 5px;
}

.login-header p {
    color: #999;
    font-size: 14px;
}

.login-footer {
    text-align: center;
    margin-top: 20px;
    font-size: 13px;
}

/* ========== 后台框架 ========== */
.admin-header {
    background: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    position: sticky;
    top: 0;
    z-index: 100;
}

.admin-header-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.admin-logo {
    font-size: 18px;
    font-weight: bold;
    color: #ff6b35;
    text-decoration: none;
}

.admin-logo:hover {
    text-decoration: none;
}

.admin-user {
    display: flex;
    align-items: center;
    gap: 15px;
}

.admin-user span {
    color: #666;
}

.btn-logout {
    color: #fff;
    background: #ff6b35;
    padding: 6px 16px;
    border-radius: 6px;
    font-size: 13px;
    text-decoration: none;
}

.btn-logout:hover {
    background: #e55a2b;
    text-decoration: none;
}

.admin-body {
    max-width: 1400px;
    margin: 20px auto;
    padding: 0 24px;
    display: flex;
    gap: 20px;
    min-height: calc(100vh - 120px);
}

.admin-sidebar {
    width: 200px;
    flex-shrink: 0;
    background: #fff;
    border-radius: 12px;
    padding: 15px 0;
    height: fit-content;
    position: sticky;
    top: 80px;
}

.admin-sidebar ul {
    list-style: none;
}

.admin-sidebar a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    color: #555;
    text-decoration: none;
    transition: all 0.2s;
}

.admin-sidebar a:hover {
    background: #fff5f0;
    color: #ff6b35;
    text-decoration: none;
}

.admin-sidebar a.active {
    background: #fff5f0;
    color: #ff6b35;
    font-weight: 600;
    border-right: 3px solid #ff6b35;
}

.admin-sidebar .icon {
    font-size: 18px;
}

.admin-content {
    flex: 1;
    min-width: 0;
}

.page-title {
    font-size: 24px;
    color: #333;
    margin-bottom: 20px;
}

.admin-footer {
    text-align: center;
    padding: 20px;
    color: #999;
    font-size: 13px;
}

/* ========== 卡片和面板 ========== */
.panel {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #f0f0f0;
}

.panel-header h2 {
    font-size: 18px;
    color: #333;
}

/* ========== 统计卡片 ========== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.stat-card {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.stat-icon {
    font-size: 36px;
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-orange .stat-icon { background: #fff5f0; }
.stat-blue .stat-icon { background: #f0f5ff; }
.stat-green .stat-icon { background: #f0fff5; }
.stat-purple .stat-icon { background: #f8f0ff; }
.stat-pink .stat-icon { background: #fff0f5; }

.stat-value {
    font-size: 24px;
    font-weight: bold;
    color: #333;
}

.stat-label {
    color: #999;
    font-size: 13px;
}

/* ========== 表单 ========== */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    color: #555;
    font-weight: 500;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #ff6b35;
}

.form-group textarea {
    resize: vertical;
}

.form-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: flex-end;
}

.form-inline .form-group {
    flex: 1;
    min-width: 150px;
    margin-bottom: 0;
}

.form-row {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.form-row .form-group {
    flex: 1;
    min-width: 150px;
}

.form-hint {
    color: #999;
    font-size: 12px;
    margin-top: 4px;
}

.form-actions {
    margin-top: 20px;
}

.radio-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: normal;
}

.radio-group input {
    width: auto;
    margin-right: 5px;
}

/* ========== 按钮 ========== */
.btn {
    display: inline-block;
    padding: 8px 20px;
    background: #f0f0f0;
    color: #555;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    text-decoration: none;
    transition: all 0.2s;
    font-family: inherit;
}

.btn:hover {
    background: #e0e0e0;
    text-decoration: none;
}

.btn-primary {
    background: #ff6b35;
    color: #fff;
}

.btn-primary:hover {
    background: #e55a2b;
}

.btn-success {
    background: #52c41a;
    color: #fff;
}

.btn-danger {
    background: #ff4d4f;
    color: #fff;
}

.btn-danger:hover {
    background: #e03e40;
}

.btn-sm {
    padding: 4px 12px;
    font-size: 12px;
}

.btn-block {
    display: block;
    width: 100%;
    text-align: center;
}

.btn-large {
    padding: 12px 24px;
    font-size: 16px;
}

/* ========== 表格 ========== */
.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    background: #fafafa;
    padding: 12px;
    text-align: left;
    font-weight: 600;
    color: #555;
    border-bottom: 2px solid #f0f0f0;
    white-space: nowrap;
}

.data-table td {
    padding: 12px;
    border-bottom: 1px solid #f0f0f0;
    color: #333;
}

.data-table tr:hover {
    background: #fafafa;
}

.action-buttons {
    white-space: nowrap;
}

.action-buttons .btn {
    margin-right: 5px;
    margin-bottom: 3px;
}

/* ========== 标签 ========== */
.badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 10px;
    font-size: 12px;
    background: #f0f0f0;
    color: #666;
    border: none;
    cursor: default;
}

.badge-success {
    background: #f6ffed;
    color: #52c41a;
    border: 1px solid #b7eb8f;
}

.badge-warning {
    background: #fffbe6;
    color: #faad14;
    border: 1px solid #ffe58f;
}

.badge-danger {
    background: #fff2f0;
    color: #ff4d4f;
    border: 1px solid #ffccc7;
}

.bind-code {
    background: #fff5f0;
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: 600;
    color: #ff6b35;
}

/* ========== 提示 ========== */
.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 14px;
}

.alert-success {
    background: #f6ffed;
    color: #389e0d;
    border: 1px solid #b7eb8f;
}

.alert-error {
    background: #fff2f0;
    color: #cf1322;
    border: 1px solid #ffccc7;
}

.alert-warning {
    background: #fffbe6;
    color: #d48806;
    border: 1px solid #ffe58f;
}

.alert-info {
    background: #e6f7ff;
    color: #096dd9;
    border: 1px solid #91d5ff;
}

/* ========== 弹窗 ========== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-large {
    max-width: 700px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #f0f0f0;
}

.modal-header h3 {
    font-size: 18px;
}

.modal-close {
    font-size: 28px;
    cursor: pointer;
    color: #999;
    line-height: 1;
}

.modal-close:hover {
    color: #333;
}

/* ========== 空状态 ========== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.empty-icon {
    font-size: 64px;
    margin-bottom: 15px;
}

/* ========== 桌号卡片网格 ========== */
.table-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}

.table-card {
    background: #fff;
    border: 1px solid #f0f0f0;
    border-radius: 12px;
    padding: 15px;
    text-align: center;
}

.table-card-no {
    font-size: 16px;
    font-weight: bold;
    color: #333;
    margin-bottom: 10px;
}

.table-qr {
    width: 100%;
    max-width: 180px;
    height: auto;
    margin: 0 auto 10px;
    display: block;
}

.table-card-actions {
    display: flex;
    gap: 8px;
    justify-content: center;
}

/* ========== 商品列表 ========== */
.product-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.product-item {
    display: flex;
    gap: 15px;
    padding: 15px;
    border: 1px solid #f0f0f0;
    border-radius: 10px;
    align-items: center;
}

.product-img {
    width: 80px;
    height: 80px;
    flex-shrink: 0;
    border-radius: 8px;
    overflow: hidden;
}

.product-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.img-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f5f5f5;
    color: #ccc;
    font-size: 12px;
}

.product-info {
    flex: 1;
    min-width: 0;
}

.product-info h3 {
    font-size: 16px;
    margin-bottom: 5px;
}

.product-desc {
    color: #999;
    font-size: 13px;
    margin-bottom: 5px;
}

.product-price {
    color: #ff6b35;
    font-weight: bold;
}

.product-actions {
    display: flex;
    flex-direction: column;
    gap: 5px;
    align-items: flex-end;
}

/* ========== 备注组 ========== */
.option-group {
    background: #fafafa;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
}

.option-group-readonly {
    background: #fafafa;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 10px;
}

.option-group-readonly ul {
    margin-left: 20px;
    margin-top: 5px;
}

.option-group-readonly .badge {
    margin-left: 8px;
}

/* ========== 筛选栏 ========== */
.filter-bar {
    background: #fff;
    border-radius: 12px;
    padding: 16px 24px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.stats-row {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    padding: 15px 24px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.stat-mini {
    color: #666;
}

.stat-mini strong {
    color: #ff6b35;
    font-size: 18px;
    margin-left: 5px;
}

/* ========== 商户状态栏 ========== */
.merchant-status-bar {
    background: #fff;
    border-radius: 12px;
    padding: 16px 24px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

/* ========== 绑定页面 ========== */
.bind-info {
    background: #fafafa;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.bind-steps {
    margin-bottom: 20px;
}

.bind-steps ol {
    margin-left: 20px;
    line-height: 2;
}

.bind-code-box {
    text-align: center;
    background: #fff5f0;
    padding: 30px;
    border-radius: 12px;
    margin-bottom: 20px;
}

.bind-code-box .bind-code {
    font-size: 32px;
    font-weight: bold;
    color: #ff6b35;
    letter-spacing: 3px;
    margin: 15px 0;
    display: block;
}

.qr-section {
    text-align: center;
    margin-top: 20px;
}

.qr-section img {
    margin: 10px auto;
}

/* ========== 配置信息 ========== */
.config-info ul {
    margin-left: 20px;
    line-height: 2;
}

.config-info code {
    background: #f5f5f5;
    padding: 2px 8px;
    border-radius: 4px;
    font-family: Consolas, Monaco, monospace;
}

/* ========== 订单详情 ========== */
.order-info {
    background: #fafafa;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.order-info p {
    margin-bottom: 8px;
}

.order-detail h4 {
    margin: 20px 0 10px;
    color: #333;
}

.order-detail pre {
    background: #fafafa;
    padding: 10px;
    border-radius: 6px;
    font-size: 12px;
    white-space: pre-wrap;
}

/* ========== 响应式 ========== */
@media (max-width: 768px) {
    .admin-body {
        flex-direction: column;
        padding: 0 12px;
    }
    
    .admin-sidebar {
        width: 100%;
        position: static;
    }
    
    .admin-sidebar ul {
        display: flex;
        overflow-x: auto;
    }
    
    .admin-sidebar a {
        white-space: nowrap;
        border-right: none;
        border-bottom: 3px solid transparent;
    }
    
    .admin-sidebar a.active {
        border-right: none;
        border-bottom-color: #ff6b35;
    }
    
    .form-inline {
        flex-direction: column;
        align-items: stretch;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .product-item {
        flex-direction: column;
        align-items: stretch;
    }
    
    .product-img {
        width: 100%;
        height: 150px;
    }
}
