* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 500px;
    margin: 0 auto;
}

.card {
    background: white;
    border-radius: 24px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    margin-bottom: 20px;
}

.card-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 30px 20px;
    text-align: center;
    color: white;
}

.card-header h1 {
    font-size: 28px;
    margin-bottom: 8px;
    font-weight: 600;
}

.card-header p {
    font-size: 14px;
    opacity: 0.9;
}

.card-body {
    padding: 24px 20px;
}

.search-section {
    margin-bottom: 24px;
}

.input-group {
    display: flex;
    gap: 12px;
}

.input-group input {
    flex: 1;
    padding: 14px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 16px;
    font-size: 16px;
    transition: all 0.3s;
    outline: none;
}

.input-group input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

.btn {
    padding: 14px 24px;
    border: none;
    border-radius: 16px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    min-height: 48px;
    -webkit-tap-highlight-color: transparent;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
}

.score-card {
    background: linear-gradient(135deg, #f5f7fa 0%, #e4e8f0 100%);
    border-radius: 20px;
    padding: 20px;
    text-align: center;
    margin-bottom: 24px;
}

.score-label {
    font-size: 14px;
    color: #666;
    margin-bottom: 8px;
}

.score-value {
    font-size: 48px;
    font-weight: 700;
    color: #667eea;
}

.score-unit {
    font-size: 16px;
    color: #999;
}

.user-info {
    background: #f8f9fa;
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 24px;
}

.user-info-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #eee;
}

.user-info-item:last-child {
    border-bottom: none;
}

.user-info-label {
    color: #666;
    font-size: 14px;
}

.user-info-value {
    font-weight: 500;
    color: #333;
}

.exchange-section {
    margin-top: 20px;
}

.section-title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.exchange-buttons {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.exchange-card {
    flex: 1;
    min-width: 140px;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 20px;
    padding: 16px;
    text-align: center;
    transition: all 0.3s;
    cursor: pointer;
    min-height: 120px;
    -webkit-tap-highlight-color: transparent;
}

.exchange-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.exchange-card.selected {
    border-color: #667eea;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
}

.exchange-card.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    filter: grayscale(0.3);
}

.exchange-card.disabled:hover {
    transform: none;
    box-shadow: none;
}

.exchange-name.one-yuan {
    color: #f5576c;
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 8px;
}

.exchange-name.two-yuan {
    color: #667eea;
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 8px;
}

.exchange-price {
    font-size: 12px;
    color: #999;
}

.exchange-score {
    font-size: 14px;
    font-weight: 600;
    margin-top: 8px;
}

.exchange-score.available {
    color: #10b981;
}

.exchange-score.unavailable {
    color: #ef4444;
}

.current-setting {
    background: #f3f4f6;
    border-radius: 12px;
    padding: 12px 16px;
    margin-top: 16px;
    text-align: center;
    font-size: 14px;
    color: #6b7280;
}

.current-setting span {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.setting-none {
    background: #e5e7eb;
    color: #4b5563;
}

.setting-one {
    background: #fee2e2;
    color: #dc2626;
}

.setting-two {
    background: #e0e7ff;
    color: #4f46e5;
}

.btn-confirm {
    width: 100%;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    padding: 16px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 16px;
    margin-top: 20px;
    min-height: 56px;
}

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

/* 闲鱼购买链接样式 */
.purchase-link {
    text-align: center;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #f0f0f0;
}

.purchase-link a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #ff6b6b;
    color: white;
    padding: 10px 24px;
    border-radius: 40px;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(255, 107, 107, 0.3);
}

.purchase-link a:hover {
    transform: translateY(-2px);
    background: #ff4757;
    box-shadow: 0 4px 12px rgba(255, 71, 87, 0.4);
}

.purchase-url {
    font-size: 11px;
    color: #999;
    margin-top: 8px;
    word-break: break-all;
}

.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 12px 24px;
    border-radius: 50px;
    font-size: 14px;
    z-index: 1000;
    animation: fadeInUp 0.3s ease;
}

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

/* 弹窗样式 */
.guide-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    animation: fadeIn 0.3s ease;
}

.guide-card {
    background: white;
    border-radius: 28px;
    max-width: 340px;
    width: 85%;
    overflow: hidden;
    animation: slideUp 0.3s ease;
}

.guide-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px 16px;
    text-align: center;
    color: white;
}

.guide-header h3 {
    font-size: 20px;
    margin-bottom: 4px;
}

.guide-header p {
    font-size: 12px;
    opacity: 0.9;
}

.guide-body {
    padding: 20px 16px;
}

.rule-item {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    padding: 10px 12px;
    background: #f8f9fa;
    border-radius: 16px;
}

.rule-icon {
    font-size: 24px;
    flex-shrink: 0;
    min-width: 36px;
    text-align: center;
}

.rule-text {
    flex: 1;
}

.rule-title {
    font-weight: 600;
    color: #333;
    margin-bottom: 2px;
    font-size: 14px;
}

.rule-desc {
    font-size: 11px;
    color: #666;
    line-height: 1.3;
}

/* 弹窗双按钮容器 */
.guide-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 0 16px 20px 16px;
}

/* 弹窗按钮统一样式 */
.btn-guide {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 12px 20px;
    border: none;
    border-radius: 40px;
    font-size: 15px;
    font-weight: 600;
    width: 100%;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    display: block;
    box-sizing: border-box;
    transition: all 0.3s ease;
}

.btn-guide:hover {
    transform: translateY(-1px);
    opacity: 0.95;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { transform: translateY(50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid white;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #999;
}

.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.status-active {
    background: #d1fae5;
    color: #059669;
}

/* 到期提醒样式 */
.expire-warning {
    color: #ef4444 !important;
    font-weight: 600;
    animation: pulse 1.5s ease-in-out infinite;
}

.expire-expired {
    color: #dc2626 !important;
    font-weight: 600;
    text-decoration: line-through;
}

/* 修改状态标签，使其在作为链接时也保持一致 */
.status-badge.status-inactive {
    background: #fee2e2;
    color: #dc2626;
}

/* 为过期时间添加的链接增加悬停效果 */
.user-info-value a:hover {
    text-decoration: underline;
}

/* 续费提醒模态框 */
.renew-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    backdrop-filter: blur(4px);
}

.renew-modal-content {
    background: white;
    border-radius: 24px;
    width: 85%;
    max-width: 320px;
    overflow: hidden;
    animation: modalSlideIn 0.3s ease;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.renew-modal-header {
    background: linear-gradient(135deg, #fff5f5 0%, #ffe0e0 100%);
    padding: 20px;
    text-align: center;
    border-bottom: 1px solid #fee2e2;
}

.renew-modal-icon {
    font-size: 48px;
    display: block;
    margin-bottom: 8px;
}

.renew-modal-header h3 {
    font-size: 18px;
    color: #dc2626;
    font-weight: 600;
    margin: 0;
}

.renew-modal-body {
    padding: 24px 20px;
    text-align: center;
}

.renew-modal-body p {
    font-size: 16px;
    color: #333;
    margin-bottom: 8px;
}

.renew-modal-tip {
    font-size: 13px;
    color: #999;
}

.renew-modal-footer {
    display: flex;
    gap: 12px;
    padding: 16px 20px 24px;
    border-top: 1px solid #f0f0f0;
}

.renew-modal-btn {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 40px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.renew-modal-btn-cancel {
    background: #f3f4f6;
    color: #6b7280;
}

.renew-modal-btn-cancel:hover {
    background: #e5e7eb;
}

.renew-modal-btn-confirm {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.renew-modal-btn-confirm:hover {
    transform: translateY(-1px);
    opacity: 0.95;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* 通知弹窗样式 */
.notice-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 20000;
    animation: fadeIn 0.3s ease;
}

.notice-card {
    background: white;
    border-radius: 28px;
    max-width: 340px;
    width: 85%;
    overflow: hidden;
    animation: slideUp 0.3s ease;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.notice-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px 16px;
    text-align: center;
    color: white;
}

.notice-icon {
    font-size: 36px;
    display: block;
    margin-bottom: 8px;
}

.notice-header h3 {
    font-size: 20px;
    font-weight: 600;
    margin: 0;
}

.notice-body {
    padding: 20px 16px;
}

.notice-text {
    font-size: 14px;
    color: #333;
    line-height: 1.8;
    margin-bottom: 16px;
    text-align: justify;
}

.notice-warn {
    font-size: 14px;
    font-weight: 600;
    color: #dc2626;
    line-height: 1.8;
    background: #fef2f2;
    padding: 12px 14px;
    border-radius: 12px;
    border-left: 3px solid #dc2626;
}

.notice-footer {
    padding: 0 16px 20px;
}

.btn-notice {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 12px 20px;
    border: none;
    border-radius: 40px;
    font-size: 15px;
    font-weight: 600;
    width: 100%;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-notice:hover {
    transform: translateY(-1px);
    opacity: 0.95;
}

/* 自动抢券开关样式 */
.auto-grab-row {
    padding: 10px 0 !important;
}

.toggle-switch {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    vertical-align: middle;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.toggle-slider {
    position: relative;
    width: 50px;
    height: 28px;
    background-color: #d1d5db;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 28px;
    flex-shrink: 0;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

.toggle-switch input:checked + .toggle-slider {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    box-shadow: 0 0 12px rgba(16, 185, 129, 0.3);
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(22px);
}

.toggle-switch input:disabled + .toggle-slider {
    opacity: 0.5;
    cursor: not-allowed;
}

.toggle-status {
    font-size: 12px;
    font-weight: 600;
    color: #9ca3af;
    transition: color 0.3s;
    min-width: 28px;
}

.toggle-switch input:checked ~ .toggle-status {
    color: #059669;
}

/* 自动抢券提示文字 */
.auto-grab-hint {
    font-size: 12px;
    color: #92400e;
    text-align: center;
    padding: 8px 12px;
    background: #fef3c7;
    border-radius: 10px;
    margin-top: 8px;
    line-height: 1.5;
}

@media (max-width: 480px) {
    .exchange-buttons {
        flex-direction: column;
    }
    .exchange-card {
        min-width: auto;
    }
    .input-group {
        flex-direction: column;
    }
    .purchase-link a {
        width: 90%;
        justify-content: center;
    }
}