/* ===== 基础样式 ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Microsoft YaHei", sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #e4e8ec 100%);
    color: #333;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
}

/* ===== 导航栏 ===== */
.navbar {
    background: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 64px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 20px;
    font-weight: 700;
    color: #2563eb;
}

.logo i {
    font-size: 24px;
}

.nav-menu {
    display: flex;
    gap: 32px;
}

.nav-menu a {
    color: #64748b;
    font-weight: 500;
    transition: color 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.nav-menu a:hover,
.nav-menu a.active {
    color: #2563eb;
}

/* ===== 主要内容 ===== */
.main-content {
    flex: 1;
    padding: 20px 0;
}

/* ===== 卡片列表 ===== */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
    margin-top: 24px;
}

.card-item {
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    transition: transform 0.2s, box-shadow 0.2s;
}

.card-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.card-image {
    width: 100%;
    height: 180px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 48px;
}

.card-body {
    padding: 20px;
}

.card-title {
    font-size: 18px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 8px;
}

.card-desc {
    font-size: 14px;
    color: #64748b;
    line-height: 1.6;
    margin-bottom: 16px;
    min-height: 44px;
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-price {
    font-size: 24px;
    font-weight: 700;
    color: #ef4444;
}

.card-price small {
    font-size: 14px;
    font-weight: 400;
}

.card-stock {
    font-size: 13px;
    color: #64748b;
}

.card-stock.in-stock {
    color: #10b981;
}

.card-stock.out-stock {
    color: #ef4444;
}

/* ===== 按钮 ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 20px;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.btn-primary {
    background: #2563eb;
    color: #fff;
}

.btn-primary:hover {
    background: #1d4ed8;
}

.btn-success {
    background: #10b981;
    color: #fff;
}

.btn-success:hover {
    background: #059669;
}

.btn-danger {
    background: #ef4444;
    color: #fff;
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-secondary {
    background: #f1f5f9;
    color: #475569;
}

.btn-secondary:hover {
    background: #e2e8f0;
}

.btn-block {
    display: flex;
    width: 100%;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ===== 表单 ===== */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #334155;
    margin-bottom: 8px;
}

.form-input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    font-size: 14px;
    transition: border-color 0.2s;
    outline: none;
}

.form-input:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    font-size: 14px;
    min-height: 100px;
    resize: vertical;
    outline: none;
    font-family: inherit;
}

.form-textarea:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-select {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    font-size: 14px;
    background: #fff;
    cursor: pointer;
    outline: none;
}

.form-select:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.required {
    color: #ef4444;
}

/* ===== 面板/盒子 ===== */
.panel {
    background: #fff;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.panel-title {
    font-size: 18px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid #f1f5f9;
}

/* ===== 弹窗/模态框 ===== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal {
    background: #fff;
    border-radius: 16px;
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    font-size: 18px;
    font-weight: 600;
    color: #1e293b;
}

.modal-close {
    background: none;
    border: none;
    font-size: 20px;
    color: #94a3b8;
    cursor: pointer;
}

.modal-close:hover {
    color: #475569;
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid #f1f5f9;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* ===== 提示消息 ===== */
.alert {
    padding: 12px 16px;
    border-radius: 10px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-success {
    background: #dcfce7;
    color: #166534;
}

.alert-danger {
    background: #fee2e2;
    color: #991b1b;
}

.alert-warning {
    background: #fef3c7;
    color: #92400e;
}

.alert-info {
    background: #dbeafe;
    color: #1e40af;
}

.toast {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    background: #1e293b;
    color: #fff;
    padding: 12px 24px;
    border-radius: 10px;
    z-index: 2000;
    animation: slideDown 0.3s ease;
}

.toast.hidden {
    display: none;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* ===== 页脚 ===== */
.footer {
    background: #fff;
    border-top: 1px solid #e2e8f0;
    padding: 24px 0;
    margin-top: auto;
}

.footer-content {
    text-align: center;
    color: #64748b;
    font-size: 14px;
}

.footer-info p {
    margin-bottom: 4px;
}

.icp a {
    color: #94a3b8;
    font-size: 12px;
}

.icp a:hover {
    color: #64748b;
}

/* ===== 区块标题 ===== */
.section-header {
    margin-bottom: 16px;
}

.section-title {
    font-size: 20px;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 6px 0;
}

.section-desc {
    font-size: 14px;
    color: #64748b;
    margin: 0;
}

/* ===== Hero区域 ===== */
.hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    padding: 60px 0;
    text-align: center;
    border-radius: 20px;
    margin-bottom: 32px;
}

.hero h1 {
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 12px;
}

.hero p {
    font-size: 16px;
    opacity: 0.9;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 48px;
    margin-top: 32px;
}

.hero-stat {
    text-align: center;
}

.hero-stat-number {
    font-size: 28px;
    font-weight: 700;
}

.hero-stat-label {
    font-size: 14px;
    opacity: 0.8;
}

/* ===== 订单详情 ===== */
.order-detail {
    max-width: 500px;
    margin: 0 auto;
}

.order-status {
    text-align: center;
    margin-bottom: 24px;
}

.order-status-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    font-size: 36px;
}

.order-status-icon.success {
    background: #dcfce7;
    color: #166534;
}

.order-status-icon.warning {
    background: #fef3c7;
    color: #92400e;
}

.order-status-icon.danger {
    background: #fee2e2;
    color: #991b1b;
}

.order-status-title {
    font-size: 24px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 8px;
}

.order-status-desc {
    color: #64748b;
}

.order-info {
    background: #f8fafc;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 24px;
}

.order-info-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #e2e8f0;
}

.order-info-row:last-child {
    border-bottom: none;
}

.order-info-label {
    color: #64748b;
}

.order-info-value {
    color: #1e293b;
    font-weight: 500;
}

.order-code {
    background: #f1f5f9;
    padding: 16px;
    border-radius: 10px;
    text-align: center;
    margin-bottom: 20px;
}

.order-code-label {
    font-size: 13px;
    color: #64748b;
    margin-bottom: 8px;
}

.order-code-value {
    font-family: "Courier New", monospace;
    font-size: 18px;
    font-weight: 700;
    color: #1e293b;
    word-break: break-all;
}

.order-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

/* ===== 收款码 ===== */
.qrcode-section {
    text-align: center;
    margin-bottom: 24px;
}

.qrcode-image {
    width: 200px;
    height: 200px;
    margin: 0 auto 16px;
    background: #fff;
    padding: 10px;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.qrcode-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.qrcode-name {
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 4px;
}

.qrcode-amount {
    font-size: 24px;
    font-weight: 700;
    color: #ef4444;
}

/* ===== 查询表单 ===== */
.query-form {
    max-width: 500px;
    margin: 0 auto;
}

.query-result {
    margin-top: 32px;
}

/* ===== 空状态 ===== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-state-icon {
    width: 80px;
    height: 80px;
    background: #f1f5f9;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    font-size: 32px;
    color: #94a3b8;
}

.empty-state-title {
    font-size: 18px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 8px;
}

.empty-state-desc {
    color: #64748b;
}

/* ===== 响应式 ===== */
@media (max-width: 768px) {
    .container {
        padding: 0 12px;
    }
    
    .main-content {
        padding: 16px 0;
    }
    
    .navbar {
        padding: 0 12px;
    }
    
    .nav-wrapper {
        height: 52px;
    }
    
    .logo {
        font-size: 16px;
        gap: 6px;
    }
    
    .logo i {
        font-size: 18px;
    }
    
    .nav-menu {
        gap: 6px;
        font-size: 12px;
    }
    
    .nav-menu a {
        padding: 6px 6px;
    }
    
    .nav-menu a i {
        margin-right: 2px;
        font-size: 12px;
    }
    
    .hero {
        padding: 20px 16px;
        margin-bottom: 16px;
        border-radius: 12px;
    }
    
    .hero h1 {
        font-size: 18px;
        margin-bottom: 6px;
    }
    
    .hero p {
        font-size: 12px;
        margin: 0;
    }
    
    .hero-stats {
        gap: 16px;
        margin-top: 16px;
    }
    
    .hero-stat-number {
        font-size: 16px;
    }
    
    .hero-stat-label {
        font-size: 11px;
    }
    
    .section {
        padding: 20px 0;
    }
    
    .section-header {
        margin-bottom: 12px;
    }
    
    .section-title {
        font-size: 16px;
        margin-bottom: 4px;
    }
    
    .section-desc {
        font-size: 12px;
    }
    
    .card-grid {
        grid-template-columns: 1fr;
        gap: 12px;
        margin-top: 12px;
    }
    
    .card-item {
        border-radius: 12px;
    }
    
    .card-image {
        height: 100px !important;
    }
    
    .card-image i {
        font-size: 36px !important;
    }
    
    .card-body {
        padding: 12px !important;
    }
    
    .card-title {
        font-size: 14px !important;
        margin-bottom: 4px !important;
    }
    
    .card-desc {
        font-size: 12px !important;
        margin-bottom: 10px !important;
        display: -webkit-box;
        -webkit-line-clamp: 1;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
    
    .card-footer {
        gap: 8px;
    }
    
    .card-price {
        font-size: 18px !important;
    }
    
    .card-price small {
        font-size: 12px;
    }
    
    .card-stock {
        font-size: 11px;
    }
    
    .btn-sm {
        padding: 6px 12px !important;
        font-size: 12px !important;
    }
    
    .panel {
        padding: 16px;
        border-radius: 12px;
    }
    
    .panel-title {
        font-size: 16px;
    }
    
    .order-actions {
        grid-template-columns: 1fr;
    }
    
    .qrcode-image {
        width: 160px;
        height: 160px;
    }
    
    .qrcode-amount {
        font-size: 18px;
    }
    
    .order-info {
        padding: 12px;
    }
    
    .order-status-icon {
        width: 56px;
        height: 56px;
        font-size: 24px;
    }
    
    .order-status-title {
        font-size: 18px;
    }
    
    .footer {
        padding: 16px 12px;
        font-size: 11px;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .form-actions .btn {
        width: 100%;
        justify-content: center;
    }
    
    .form-group {
        margin-bottom: 14px;
    }
    
    .form-label {
        font-size: 13px;
        margin-bottom: 6px;
    }
    
    .form-input,
    .form-select,
    .form-textarea {
        padding: 10px 12px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .nav-menu {
        gap: 4px;
        font-size: 11px;
    }
    
    .nav-menu a {
        padding: 4px 4px;
    }
    
    .nav-menu a i {
        display: none;
    }
    
    .logo span {
        display: none;
    }
    
    .logo {
        font-size: 18px;
    }
    
    .hero {
        padding: 16px 12px;
    }
    
    .hero h1 {
        font-size: 16px;
    }
    
    .hero p {
        display: none;
    }
    
    .hero-stats {
        flex-direction: row;
        gap: 12px;
        margin-top: 12px;
    }
    
    .hero-stat-number {
        font-size: 14px;
    }
    
    .hero-stat-label {
        font-size: 10px;
    }
    
    .section-title {
        font-size: 15px;
    }
    
    .section-desc {
        display: none;
    }
    
    .card-image {
        height: 80px !important;
    }
    
    .card-image i {
        font-size: 28px !important;
    }
    
    .card-body {
        padding: 10px !important;
    }
    
    .card-title {
        font-size: 13px !important;
    }
    
    .card-price {
        font-size: 16px !important;
    }
}
