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

body {
    font-family: 'Arial', sans-serif;
    background-color: #f5f5f5;
    color: #333;
}

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

/* 顶部导航区域 */
.header-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #fff;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.header-section h1 {
    color: #1e90ff;
    font-size: 28px;
    font-weight: bold;
}

/* 用户登录状态 */
.user-login-status {
    display: flex;
    align-items: center;
    gap: 15px;
}

.login-link {
    text-decoration: none;
    color: #1e90ff;
    font-size: 16px;
    font-weight: bold;
    padding: 8px 15px;
    border: 2px solid #1e90ff;
    border-radius: 5px;
    transition: all 0.3s ease;
}

.login-link:hover {
    background-color: #1e90ff;
    color: #fff;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
}

.username {
    font-weight: bold;
    color: #333;
}

.logout-btn {
    background-color: #dc3545;
    color: #fff;
    border: none;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s ease;
}

.logout-btn:hover {
    background-color: #c82333;
}

/* 顶部充值系统 */
.top-section {
    background-color: #fff;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.recharge-system h2 {
    color: #1e90ff;
    margin-bottom: 15px;
    text-align: center;
}

.recharge-form {
    display: flex;
    gap: 15px;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
}

.recharge-form input {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
    min-width: 150px;
}

.recharge-form button {
    padding: 10px 20px;
    background-color: #1e90ff;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s;
}

.recharge-form button:hover {
    background-color: #187bcd;
}

/* 主内容区域 */
.main-content {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

/* 左侧刷卡区域 */
.left-section {
    flex: 1;
    min-width: 300px;
    background-color: #fff;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.card-area {
    text-align: center;
}

.card-prompt {
    font-size: 24px;
    font-weight: bold;
    color: #1e90ff;
    margin-bottom: 20px;
    padding: 20px;
    background-color: #f0f8ff;
    border-radius: 10px;
}

.nfc-toggle {
    margin-bottom: 20px;
    font-size: 16px;
}

.preset-cards {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 20px;
}

.card-item {
    padding: 10px;
    border-radius: 15px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.3s;
    border: 1px solid #ddd;
    min-height: 180px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.card-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

/* 卡片模板样式 */
.card-template {
    background-size: cover;
    background-position: center;
    color: white;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

.card-hangzhou {
    background: linear-gradient(135deg, #66cc66, #339933);
}

.card-shanghai {
    background: linear-gradient(135deg, #ff3333, #cc0000);
}

.card-municipal {
    background: linear-gradient(135deg, #0066cc, #3399ff);
}

.card-single {
    background: linear-gradient(135deg, #99cc00, #669900);
}

.card-tourist {
    background: linear-gradient(135deg, #ff9966, #cc6633);
}

.card-item .card-number {
    font-size: 16px;
    background-color: rgba(0, 0, 0, 0.3);
    padding: 5px 10px;
    border-radius: 5px;
    text-align: center;
    margin-top: 10px;
    font-weight: bold;
}

.card-item .card-balance {
    font-size: 14px;
    background-color: rgba(255, 255, 255, 0.9);
    color: #333;
    padding: 5px 10px;
    border-radius: 5px;
    text-align: center;
    font-weight: bold;
}

.card-item .card-name {
    font-size: 24px;
    font-weight: bold;
    text-align: center;
    margin: 10px 0;
}

.card-item .card-subtitle {
    font-size: 12px;
    text-align: center;
    opacity: 0.9;
}

.card-item .china-union {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 60px;
    height: 30px;
    background-color: rgba(255, 0, 0, 0.8);
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: bold;
}

.card-item .china-union::after {
    content: "交通联合";
    display: block;
    text-align: center;
}

/* 右侧状态显示 */
.right-section {
    flex: 1;
    min-width: 300px;
    background-color: #fff;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.status-display h3 {
    color: #1e90ff;
    margin-bottom: 20px;
    text-align: center;
}

.balance {
    font-size: 28px;
    font-weight: bold;
    text-align: center;
    margin-bottom: 20px;
    padding: 20px;
    background-color: #f0f8ff;
    border-radius: 10px;
}

.status {
    font-size: 20px;
    text-align: center;
    padding: 20px;
    border-radius: 10px;
    background-color: #f9f9f9;
}

.status.valid {
    color: #28a745;
    background-color: #d4edda;
}

.status.invalid {
    color: #dc3545;
    background-color: #f8d7da;
}

/* 地铁闸机屏幕样式 */
.screen-container {
    background-color: #fff;
    border-radius: 15px;
    padding: 15px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    margin-bottom: 20px;
    border: 2px solid #ddd;
}

.screen {
    background: linear-gradient(135deg, #0066cc, #3399ff);
    border-radius: 10px;
    padding: 30px 20px;
    text-align: center;
    color: #fff;
    min-height: 300px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.screen-icon {
    margin-bottom: 20px;
}

.screen-message {
    font-size: 32px;
    font-weight: bold;
    margin-bottom: 10px;
    color: #ffcc00;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

.screen-message-en {
    font-size: 18px;
    font-weight: 500;
    opacity: 0.9;
}

.balance-display {
    text-align: center;
    background-color: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.balance-label {
    font-size: 16px;
    color: #666;
    margin-bottom: 5px;
}

.balance {
    font-size: 36px;
    font-weight: bold;
    color: #28a745;
}

/* 左侧卡片区域优化 */
.card-area {
    background-color: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    border: 1px solid #e9ecef;
}

/* 弹窗样式 */
.donor-modal, .add-card-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 20px;
    border-radius: 10px;
    width: 80%;
    max-width: 600px;
    position: relative;
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover {
    color: #000;
}

.payment-codes {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin: 20px 0;
    flex-wrap: wrap;
}

.code-item {
    text-align: center;
}

.qr-code {
    width: 200px;
    height: 200px;
    background-color: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #ddd;
    border-radius: 5px;
    margin: 10px 0;
    font-size: 14px;
    color: #666;
}

.donor-settings {
    margin: 20px 0;
    padding: 20px;
    background-color: #f5f5f5;
    border-radius: 5px;
}

.donor-settings h3 {
    margin-bottom: 15px;
    text-align: center;
}

.description-editor {
    margin-bottom: 15px;
    text-align: center;
}

.description-editor textarea {
    width: 100%;
    max-width: 400px;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    margin-bottom: 10px;
    font-size: 14px;
}

.description-editor button {
    padding: 10px 20px;
    background-color: #28a745;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

.donor-status {
    text-align: center;
    font-size: 16px;
}

.donor-description {
    text-align: center;
    margin: 20px 0;
    padding: 15px;
    background-color: #f0f8ff;
    border-radius: 5px;
}

.add-card-options {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin: 20px 0;
}

.add-card-options button {
    padding: 15px 30px;
    background-color: #1e90ff;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 18px;
}

.manual-form {
    display: flex;
    gap: 15px;
    justify-content: center;
    align-items: center;
    margin-top: 20px;
    flex-wrap: wrap;
}

.manual-form input {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
}

.manual-form button {
    padding: 10px 20px;
    background-color: #28a745;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .main-content {
        flex-direction: column;
    }
    
    .recharge-form {
        flex-direction: column;
        align-items: stretch;
    }
    
    .payment-codes {
        flex-direction: column;
        align-items: center;
    }
}