/* 基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

/* 导航栏 */
.navbar {
    background-color: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.nav-brand a {
    font-size: 1.5rem;
    font-weight: bold;
    color: #667eea;
    text-decoration: none;
}

/* 移动端菜单按钮 */
.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 30px;
    height: 24px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 10;
}

.nav-toggle span {
    width: 30px;
    height: 3px;
    background: #667eea;
    border-radius: 2px;
    transition: all 0.3s;
}

.nav-links a {
    margin-left: 1.5rem;
    color: #666;
    text-decoration: none;
    transition: color 0.3s;
}

.nav-links a:hover {
    color: #667eea;
}

/* 下拉菜单 */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-toggle {
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: #fff;
    min-width: 150px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    border-radius: 8px;
    padding: 0.5rem 0;
    margin-top: 0.5rem;
    z-index: 1000;
}

.dropdown-menu a {
    display: block;
    padding: 0.6rem 1rem;
    margin: 0;
    color: #666;
    text-decoration: none;
    white-space: nowrap;
    font-size: 0.9rem;
}

.dropdown-menu a:hover {
    background: #f8f9fa;
    color: #667eea;
}

.dropdown.active .dropdown-menu {
    display: block;
}

.dropdown.active .dropdown-toggle i {
    transform: rotate(180deg);
}

.dropdown-toggle i {
    transition: transform 0.3s;
}

/* 容器 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    min-height: calc(100vh - 140px);
}

/* 页脚 */
.footer {
    background-color: #333;
    color: #fff;
    text-align: center;
    padding: 1.5rem;
}

.footer .beian {
    margin-top: 0.5rem;
    font-size: 0.9rem;
}

.footer .beian a {
    color: #fff;
    text-decoration: none;
}

.footer .beian a:hover {
    text-decoration: underline;
}

/* 按钮 */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s;
}

.btn-primary {
    background-color: #667eea;
    color: white;
}

.btn-primary:hover {
    background-color: #5568d3;
}

.btn-secondary {
    background-color: #e0e0e0;
    color: #333;
}

.btn-secondary:hover {
    background-color: #d0d0d0;
}

.btn-danger {
    background-color: #e74c3c;
    color: white;
}

.btn-danger:hover {
    background-color: #c0392b;
}

.btn-success {
    background-color: #27ae60;
    color: white;
}

.btn-success:hover {
    background-color: #229954;
}

.btn-block {
    display: block;
    width: 100%;
    text-align: center;
}

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.875rem;
}

/* 表单 */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

.form-control:focus {
    outline: none;
    border-color: #667eea;
}

.form-control-sm {
    padding: 0.4rem;
    font-size: 0.875rem;
    width: 150px;
}

/* 验证码 */
.captcha-group {
    display: flex;
    gap: 10px;
    align-items: center;
}

.captcha-input {
    flex: 1;
}

.captcha-image {
    height: 44px;
    cursor: pointer;
    border-radius: 4px;
    border: 1px solid #ddd;
}

.captcha-image:hover {
    opacity: 0.8;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.checkbox-group input[type="checkbox"] {
    width: auto;
}

.error {
    color: #e74c3c;
    font-size: 0.875rem;
}

/* 提示框 */
.alert {
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-warning {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.alert-info {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* 主页 */
.hero {
    text-align: center;
    padding: 4rem 2rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 8px;
    margin-bottom: 2rem;
}

.hero h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.hero p {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.hero-buttons .btn {
    min-width: 150px;
}

/* 轮播栏样式 */
.carousel-container {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    margin-bottom: 2rem;
    height: 300px;
}

.carousel-wrapper {
    display: flex;
    transition: transform 0.5s ease-in-out;
    height: 300px;
}

.carousel-slide {
    min-width: 100%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    height: 300px;
    background-size: cover;
    background-position: center;
    position: relative;
}

.carousel-slide::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 1;
}

.carousel-content {
    text-align: center;
    padding: 4rem 2rem;
    color: white;
    width: 100%;
    max-width: 100%;
    position: relative;
    z-index: 2;
}

.carousel-content h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.carousel-content p {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

/* 轮播指示器 */
.carousel-indicators {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 3;
}

.indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: all 0.3s;
}

.indicator.active {
    background-color: white;
    width: 30px;
    border-radius: 6px;
}

.indicator:hover {
    background-color: rgba(255, 255, 255, 0.8);
}

/* 轮播控制按钮 */
.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 2rem;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3;
}

.carousel-btn:hover {
    background-color: rgba(255, 255, 255, 0.4);
}

.carousel-prev {
    left: 20px;
}

.carousel-next {
    right: 20px;
}

.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.feature-card {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    text-align: center;
}

.feature-card h3 {
    color: #667eea;
    margin-bottom: 1rem;
}

/* 公告区域 */
.announcements-section {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
}

.announcements-section h3 {
    color: #333;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #667eea;
}

.announcements-section h3 .icon {
    margin-right: 0.5rem;
}

.announcement-item {
    padding: 1rem;
    border-radius: 6px;
    margin-bottom: 1rem;
    border-left: 4px solid;
}

.announcement-item:last-child {
    margin-bottom: 0;
}

.announcement-normal {
    background: #f8f9fa;
    border-left-color: #3498db;
}

.announcement-important {
    background: #fff3cd;
    border-left-color: #e74c3c;
}

.announcement-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}

.announcement-title {
    font-weight: bold;
    color: #333;
    font-size: 1.1rem;
}

.announcement-badge {
    background: #e74c3c;
    color: white;
    padding: 0.15rem 0.5rem;
    border-radius: 3px;
    font-size: 0.75rem;
}

.announcement-time {
    color: #666;
    font-size: 0.875rem;
    margin-left: auto;
}

.announcement-content {
    color: #555;
    line-height: 1.6;
}

.announcement-content p {
    margin-bottom: 0.5rem;
}

.announcement-content p:last-child {
    margin-bottom: 0;
}

/* 认证页面 */
.auth-container {
    max-width: 400px;
    margin: 2rem auto;
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.auth-container h2 {
    text-align: center;
    margin-bottom: 1.5rem;
    color: #333;
}

.text-center {
    text-align: center;
}

/* 个人中心 */
.dashboard h2 {
    margin-bottom: 1.5rem;
}

.stats-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    text-align: center;
}

.stat-card h3 {
    font-size: 0.875rem;
    color: #666;
    margin-bottom: 0.5rem;
}

.stat-card .amount {
    font-size: 2rem;
    font-weight: bold;
    color: #667eea;
}

.dashboard-section {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-bottom: 1.5rem;
}

.dashboard-section h3 {
    margin-bottom: 1rem;
    color: #333;
}

/* 表格 */
.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
}

.table th {
    font-weight: 600;
    color: #666;
    background-color: #f8f9fa;
}

/* 徽章 */
.badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
    background-color: #e0e0e0;
    color: #666;
}

.badge-success {
    background-color: #d4edda;
    color: #155724;
}

.badge-warning {
    background-color: #fff3cd;
    color: #856404;
}

.badge-danger {
    background-color: #f8d7da;
    color: #721c24;
}

/* 空状态 */
.empty {
    text-align: center;
    color: #999;
    padding: 2rem;
}

.empty-state {
    text-align: center;
    padding: 3rem;
    color: #999;
}

/* 订单验证 */
.verify-container {
    max-width: 600px;
    margin: 0 auto;
}

.verify-form {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-bottom: 1.5rem;
}

.order-result {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-bottom: 1.5rem;
}

.order-result h3 {
    color: #27ae60;
    margin-bottom: 1rem;
}

.order-details {
    margin-bottom: 1.5rem;
}

.detail-row {
    display: flex;
    padding: 0.75rem 0;
    border-bottom: 1px solid #e0e0e0;
}

.detail-row .label {
    width: 100px;
    color: #666;
}

.detail-row .value {
    flex: 1;
    font-weight: 500;
}

.detail-row .value.amount {
    color: #667eea;
    font-size: 1.25rem;
}

.order-actions {
    display: flex;
    gap: 1rem;
}

.verify-help {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
}

.verify-help h4 {
    margin-bottom: 1rem;
}

.verify-help ol {
    padding-left: 1.5rem;
}

.verify-help li {
    margin-bottom: 0.5rem;
}

/* 兑换物品 */
.rewards-container h2 {
    margin-bottom: 1rem;
}

.balance-bar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.balance-bar .amount {
    font-size: 1.5rem;
    font-weight: bold;
}

.rewards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.reward-card {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.3s;
    display: flex;
    flex-direction: column;
}

.reward-card:hover {
    transform: translateY(-4px);
}

.reward-card.disabled {
    opacity: 0.6;
}

.reward-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
    flex: 1;
}

.reward-card-link:hover {
    color: inherit;
}

.reward-card h3 {
    margin-bottom: 0.5rem;
    color: #333;
}

.reward-card .description {
    color: #666;
    font-size: 0.875rem;
    margin-bottom: 1rem;
    min-height: 40px;
}

.reward-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.reward-info .price {
    font-size: 1.5rem;
    font-weight: bold;
    color: #667eea;
}

.reward-info .stock {
    font-size: 0.875rem;
    color: #666;
}

.reward-info .stock.unlimited {
    color: #27ae60;
}

.reward-info .stock.out {
    color: #e74c3c;
}

.reward-validity {
    margin-bottom: 1rem;
    color: #666;
    font-size: 0.85rem;
}

.validity-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75em;
    margin-right: 6px;
}

.validity-badge.active {
    background: #d4edda;
    color: #155724;
}

.validity-badge.not-started {
    background: #fff3cd;
    color: #856404;
}

.validity-badge.expired {
    background: #f8d7da;
    color: #721c24;
}

.reward-actions {
    display: flex;
    gap: 10px;
    margin-top: auto;
}

.reward-actions .btn {
    flex: 1;
    text-align: center;
}

.reward-actions .btn-sm {
    padding: 8px 12px;
    font-size: 0.85rem;
}

.redeem-form-inline {
    display: inline-block;
    margin: 0;
    flex: 1;
}

.redeem-form-inline button {
    width: 100%;
}

/* 兑换记录 */
.redemptions-container h2 {
    margin-bottom: 1.5rem;
}

.redemptions-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.redemption-card {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.redemption-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.redemption-header h3 {
    color: #333;
}

.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
}

.status-completed {
    background-color: #d4edda;
    color: #155724;
}

.status-pending {
    background-color: #fff3cd;
    color: #856404;
}

.status-cancelled {
    background-color: #f8d7da;
    color: #721c24;
}

.redemption-body .description {
    color: #666;
    margin-bottom: 0.75rem;
}

.redemption-info {
    display: flex;
    justify-content: space-between;
    color: #999;
    font-size: 0.875rem;
}

.redemption-info .amount {
    color: #667eea;
    font-weight: 500;
}

.remark {
    margin-top: 0.75rem;
    padding: 0.75rem;
    background: #f8f9fa;
    border-radius: 4px;
    font-size: 0.875rem;
}

/* 管理后台 */
.admin-layout {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 1.2rem;
}

.admin-sidebar {
    background: white;
    padding: 1rem 0.75rem;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
    height: fit-content;
    position: sticky;
    top: 16px;
    max-height: calc(100vh - 32px);
    overflow-y: auto;
    overflow-x: hidden;
}

.admin-sidebar::-webkit-scrollbar {
    width: 5px;
}

.admin-sidebar::-webkit-scrollbar-thumb {
    background: #e0e0e0;
    border-radius: 4px;
}

.admin-sidebar h3 {
    display: none;
}

.admin-sidebar ul {
    list-style: none;
}

.admin-sidebar li {
    margin-bottom: 0.15rem;
}

.admin-sidebar a {
    display: block;
    padding: 0.35rem 0.45rem;
    color: #666;
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.3s;
    font-size: 0.82rem;
}

.admin-sidebar a:hover {
    background-color: #f5f5f5;
    color: #667eea;
}

/* 移动端菜单切换按钮默认隐藏 */
.mobile-menu-toggle {
    display: none;
}

.admin-content {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}

.admin-content h2 {
    margin-bottom: 1.5rem;
}

.admin-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.admin-stats .stat-card {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
    text-align: center;
}

.admin-stats .stat-card h3 {
    font-size: 0.875rem;
    color: #666;
    margin-bottom: 0.5rem;
}

.admin-stats .stat-card .number {
    font-size: 2rem;
    font-weight: bold;
    color: #667eea;
}

.admin-quick-links {
    margin-top: 2rem;
}

.admin-quick-links h3 {
    margin-bottom: 1rem;
}

.quick-links {
    display: flex;
    gap: 1rem;
}

.admin-form-section {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 2rem;
}

.admin-form-section h3 {
    margin-bottom: 1rem;
}

.admin-table-section {
    margin-top: 2rem;
}

.admin-table-section h3 {
    margin-bottom: 1rem;
}

.admin-table-container {
    overflow-x: auto;
}

/* 响应式 */
@media (max-width: 768px) {
    .navbar {
        flex-direction: row;
        flex-wrap: wrap;
        padding: 1rem;
    }
    
    .nav-brand a {
        font-size: 1.1rem;
    }
    
    /* 显示移动端菜单按钮 */
    .nav-toggle {
        display: flex;
    }
    
    /* 移动端菜单样式 */
    .nav-links {
        display: none;
        width: 100%;
        flex-direction: column;
        gap: 0;
        margin-top: 1rem;
        padding-top: 1rem;
        border-top: 1px solid #eee;
    }
    
    .nav-links.active {
        display: flex;
    }
    
    .nav-links a {
        margin: 0;
        padding: 0.75rem 0;
        font-size: 0.95rem;
        border-bottom: 1px solid #f0f0f0;
    }
    
    .nav-links a:last-child {
        border-bottom: none;
    }

    /* 移动端下拉菜单适配 */
    .dropdown {
        display: block;
        width: 100%;
    }

    .dropdown-toggle {
        display: flex;
        justify-content: space-between;
        padding: 0.75rem 0;
        border-bottom: 1px solid #f0f0f0;
    }

    .dropdown-menu {
        position: static;
        display: none;
        box-shadow: none;
        border-radius: 0;
        padding: 0;
        margin: 0;
        background: #f8f9fa;
        border-left: 3px solid #667eea;
    }

    .dropdown.active .dropdown-menu {
        display: block;
    }

    .dropdown-menu a {
        padding: 0.6rem 1rem 0.6rem 1.5rem;
        font-size: 0.9rem;
        border-bottom: none;
    }

    .container {
        padding: 1rem;
    }
    
    .hero {
        padding: 2rem 1rem;
    }
    
    .hero h1 {
        font-size: 1.5rem;
    }
    
    .hero p {
        font-size: 1rem;
    }
    
    .hero-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    /* 轮播栏响应式 */
    .carousel-container {
        height: 220px !important;
        min-height: 220px !important;
        max-height: 220px !important;
        border-radius: 0;
        margin-bottom: 1rem;
        overflow: hidden;
    }
    
    .carousel-wrapper {
        height: 220px !important;
        min-height: 220px !important;
        max-height: 220px !important;
    }
    
    .carousel-slide {
        height: 220px !important;
        min-height: 220px !important;
        max-height: 220px !important;
        background-size: cover !important;
        background-position: center !important;
        background-repeat: no-repeat !important;
    }
    
    .carousel-content {
        padding: 1rem 0.75rem;
        height: 100%;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        box-sizing: border-box;
    }
    
    .carousel-content h1 {
        font-size: 1.1rem;
        margin-bottom: 0.5rem;
        line-height: 1.3;
        max-width: 90%;
        overflow: hidden;
        text-overflow: ellipsis;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
    }
    
    .carousel-content p {
        font-size: 0.8rem;
        margin-bottom: 0.75rem;
        line-height: 1.3;
        max-width: 90%;
        overflow: hidden;
        text-overflow: ellipsis;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
    }
    
    .carousel-content .hero-buttons {
        margin-top: 0.5rem;
        flex-direction: row !important;
        align-items: center !important;
    }
    
    .carousel-content .hero-buttons .btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
        width: auto !important;
        margin-bottom: 0 !important;
    }
    
    .carousel-btn {
        width: 28px;
        height: 28px;
        font-size: 1rem;
    }
    
    .carousel-prev {
        left: 5px;
    }
    
    .carousel-next {
        right: 5px;
    }
    
    .carousel-indicators {
        bottom: 8px;
        gap: 6px;
    }
    
    .indicator {
        width: 8px;
        height: 8px;
    }
    
    .indicator.active {
        width: 20px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    /* 后台移动端适配 */
    .admin-layout {
        display: flex;
        flex-direction: column;
        gap: 1rem;
    }

    .admin-sidebar {
        order: -1;
        padding: 0.8rem 1rem;
        width: 100%;
        overflow: visible;
        position: relative;
        max-height: none;
    }

    .admin-sidebar .sidebar-brand {
        display: none;
    }

    .admin-sidebar h3 {
        display: none;
    }

    /* 桌面端菜单隐藏 */
    .admin-sidebar .desktop-menu {
        display: none !important;
    }

    /* 移动端菜单切换按钮 */
    .mobile-menu-toggle {
        display: flex !important;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
        padding: 12px 15px;
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        border: none;
        border-radius: 12px;
        color: white;
        font-size: 0.95rem;
        font-weight: 500;
        cursor: pointer;
        transition: all 0.2s ease;
        width: 100%;
    }

    .mobile-menu-toggle .toggle-main {
        display: flex;
        align-items: center;
        gap: 10px;
    }

    .mobile-menu-toggle i {
        font-size: 1rem;
    }

    .mobile-menu-toggle .toggle-arrow {
        transition: transform 0.2s ease;
    }

    .mobile-menu-toggle.active .toggle-arrow {
        transform: rotate(180deg);
    }

    .mobile-menu-toggle:hover {
        opacity: 0.95;
    }

    /* 移动端菜单默认折叠 */
    .admin-sidebar .mobile-menu {
        display: none !important;
        margin-top: 12px;
        padding: 12px;
        background: #fafbff;
        border-radius: 12px;
    }

    /* 移动端菜单展开状态 */
    .admin-sidebar .mobile-menu.show {
        display: block !important;
        /* 使用 dvh 动态视口高度，避免 iOS 工具栏遮挡 */
        max-height: calc(100dvh - 200px);
        max-height: calc(100vh - 180px); /* 兜底 */
        overflow-y: auto;
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior-y: contain;
        touch-action: pan-y;
        padding-bottom: 20px;
        position: relative;
        z-index: 5;
    }

    .mobile-menu .menu-section {
        margin-bottom: 18px;
    }

    .mobile-menu .menu-section:last-child {
        margin-bottom: 0;
    }

    .mobile-menu .menu-title {
        display: flex;
        align-items: center;
        gap: 6px;
        font-size: 0.75rem;
        color: #888;
        margin-bottom: 10px;
        font-weight: 600;
        letter-spacing: 0.5px;
    }

    .mobile-menu .menu-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .mobile-menu .menu-item {
        position: relative;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 6px;
        padding: 14px 8px;
        background: white;
        border-radius: 12px;
        text-align: center;
        font-size: 0.8rem;
        color: #444;
        text-decoration: none;
        transition: all 0.15s ease;
        border: 1px solid #e9ecef;
        min-height: 72px;
        line-height: 1.3;
        word-break: break-all;
        touch-action: pan-y;
        -webkit-tap-highlight-color: transparent;
        user-select: none;
    }

    .mobile-menu .menu-item i:first-child {
        font-size: 1.25rem;
        color: #667eea;
        margin-bottom: 2px;
    }

    .mobile-menu .menu-item:hover {
        background: #f5f7ff;
        border-color: #667eea;
        color: #667eea;
    }

    .mobile-menu .menu-item.active,
    .mobile-menu .menu-item:focus {
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        color: white;
        border-color: transparent;
        box-shadow: 0 4px 12px rgba(102, 126, 234, 0.25);
    }

    .mobile-menu .menu-item.active i:first-child,
    .mobile-menu .menu-item:focus i:first-child {
        color: white;
    }

    .mobile-menu .danger-section {
        margin-top: 12px;
        padding-top: 12px;
        border-top: 1px dashed #f5c6cb;
    }

    .mobile-menu .danger-item {
        background: #fff5f5;
        color: #dc3545;
        border: 1px solid #f5c6cb;
        font-weight: 500;
    }

    .mobile-menu .danger-item:hover,
    .mobile-menu .danger-item:active {
        background: #dc3545;
        color: white;
        border-color: #dc3545;
    }

    /* 角标样式优化 */
    .mobile-menu .menu-item .badge {
        position: absolute;
        top: 2px;
        right: 2px;
        min-width: 16px;
        height: 16px;
        padding: 0 4px;
        font-size: 10px;
        line-height: 16px;
        border-radius: 8px;
        background: #ef4444;
        color: white;
        font-weight: bold;
    }

    .admin-content {
        padding: 1rem;
        width: 100%;
    }

    .admin-content h2 {
        font-size: 1.25rem;
        margin-bottom: 1rem;
    }
    
    .admin-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
    
    .admin-stats .stat-card {
        padding: 1rem;
    }
    
    .admin-stats .stat-card .number {
        font-size: 1.5rem;
    }
    
    .admin-form-section {
        padding: 1rem;
        margin-bottom: 1rem;
    }
    
    .admin-form-section h3 {
        font-size: 1rem;
    }
    
    /* 表格横向滚动 */
    .admin-table-container,
    .table-scroll-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin: 0 -1rem;
        padding: 0 1rem;
    }
    
    .admin-table {
        min-width: 700px;
        font-size: 0.8rem;
    }
    
    .admin-table th,
    .admin-table td {
        padding: 0.5rem 0.4rem;
        white-space: nowrap;
    }
    
    /* 轮播管理页面移动端适配 */
    .admin-form-section .form-group small {
        font-size: 0.75rem;
        color: #666;
    }
    
    .admin-form-section .checkbox-group {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .admin-form-section .checkbox-group label {
        font-size: 0.9rem;
    }
    
    .admin-form-section input[type="color"].form-control {
        height: 36px;
        padding: 2px;
    }
    
    .admin-form-section .form-actions {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .admin-form-section .form-actions .btn {
        width: 100%;
        margin-right: 0;
        text-align: center;
    }
    
    .admin-table-section .badge {
        font-size: 0.7rem;
        padding: 0.2rem 0.4rem;
    }
    
    .admin-table td .btn-sm {
        padding: 0.25rem 0.5rem;
        font-size: 0.75rem;
        margin: 0.1rem;
    }
    
    /* 按钮适配 */
    .btn {
        padding: 0.6rem 1rem;
        font-size: 0.9rem;
    }
    
    .btn-sm {
        padding: 0.3rem 0.6rem;
        font-size: 0.8rem;
    }
    
    .order-actions {
        flex-direction: column;
    }
    
    /* 兑换卡片适配 */
    .rewards-grid {
        grid-template-columns: 1fr;
    }
    
    .reward-card {
        padding: 1rem;
    }
    
    /* 详情页适配 */
    .detail-row {
        flex-direction: column;
        gap: 0.25rem;
    }
    
    .detail-row .label {
        width: auto;
        font-size: 0.85rem;
    }
    
    /* 认证页面适配 */
    .auth-container {
        margin: 1rem;
        padding: 1.5rem;
    }
    
    /* 统计卡片适配 */
    .stats-cards {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    .stat-card .amount {
        font-size: 1.5rem;
    }
}

/* 通用自适应样式 */
img {
    max-width: 100%;
    height: auto;
}

table {
    max-width: 100%;
}

/* 超小屏幕适配 */
@media (max-width: 480px) {
    .nav-brand a {
        font-size: 0.95rem;
    }
    
    .admin-sidebar a {
        padding: 0.3rem 0.5rem;
        font-size: 0.8rem;
    }
    
    .admin-stats {
        grid-template-columns: 1fr;
    }
    
    .stats-cards {
        grid-template-columns: 1fr;
    }
    
    .hero h1 {
        font-size: 1.25rem;
    }
    
    .captcha-group {
        flex-direction: column;
        align-items: stretch;
    }
    
    .captcha-image {
        height: 50px;
        align-self: center;
    }
    
    /* 更小屏幕的容器padding */
    .container {
        padding: 0.75rem;
    }
    
    /* 按钮全宽 */
    .btn {
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    .btn:last-child {
        margin-bottom: 0;
    }
    
    /* 页脚适配 */
    .footer {
        padding: 1rem;
        font-size: 0.85rem;
    }
    
    .footer p {
        margin: 0;
        line-height: 1.5;
    }
}
