/* 全局样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    background-color: #f4f4f4;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* 头部样式 */
header {
    background-color: #333;
    color: #fff;
    padding: 20px;
    border-radius: 5px;
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header h1 {
    font-size: 24px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-info span {
    font-size: 16px;
}

/* 按钮样式 */
.btn {
    display: inline-block;
    padding: 10px 20px;
    background-color: #4CAF50;
    color: white;
    text-decoration: none;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s;
}

.btn:hover {
    background-color: #45a049;
}

.btn-primary {
    background-color: #008CBA;
}

.btn-primary:hover {
    background-color: #007bb5;
}

/* 登录表单样式 */
.login-form {
    max-width: 400px;
    margin: 50px auto;
    background-color: white;
    padding: 30px;
    border-radius: 5px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.login-form h1 {
    color: #333;
    margin-bottom: 10px;
}

.login-form h2 {
    color: #666;
    margin-bottom: 30px;
    font-size: 18px;
}

/* 绑定表单样式 */
.bind-form {
    max-width: 600px;
    margin: 30px auto;
    background-color: white;
    padding: 30px;
    border-radius: 5px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

.bind-form h2 {
    color: #333;
    margin-bottom: 20px;
    text-align: center;
}

.form-section {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.form-section h3 {
    color: #666;
    margin-bottom: 15px;
    font-size: 16px;
}

/* 表单组样式 */
.form-group {
    margin-bottom: 20px;
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    color: #666;
    font-weight: bold;
}

.form-group input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

.form-group input:focus {
    outline: none;
    border-color: #008CBA;
    box-shadow: 0 0 5px rgba(0, 140, 186, 0.3);
}

/* 验证码输入组样式 */
.code-input-group {
    display: flex;
    gap: 10px;
}

.code-input-group input {
    flex: 1;
}

.code-input-group .btn {
    white-space: nowrap;
    min-width: 120px;
}

/* 辅助按钮样式 */
.btn-secondary {
    background-color: #6c757d;
}

.btn-secondary:hover {
    background-color: #5a6268;
}

/* 已绑定状态样式 */
.bound-status {
    background-color: #f8f9fa;
    padding: 20px;
    border-radius: 5px;
    margin-top: 15px;
}

.bound-status p {
    margin-bottom: 10px;
}

.bound-hint {
    margin-top: 10px;
    font-size: 14px;
    color: #666;
    font-style: italic;
}

/* 卡密生成器样式 */
.card-generator {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.card-generator h4 {
    color: #333;
    margin-bottom: 15px;
    font-size: 16px;
}

/* 卡密信息样式 */
.card-info {
    background-color: #e3f2fd;
    padding: 15px;
    border-radius: 5px;
    margin-top: 10px;
    border-left: 4px solid #2196f3;
}

.card-info p {
    margin-bottom: 8px;
    font-size: 14px;
}

/* 表单组样式增强 */
.form-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    background-color: white;
}

.form-group select:focus {
    outline: none;
    border-color: #008CBA;
    box-shadow: 0 0 5px rgba(0, 140, 186, 0.3);
}

/* 卡密列表样式 */
.card-list {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

/* 列表头部样式 */
.list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding: 10px 15px;
    background-color: #f8f9fa;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.list-header:hover {
    background-color: #e9ecef;
}

.list-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.cards-container {
    margin-top: 10px;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.list-header h4 {
    color: #333;
    margin: 0;
    font-size: 16px;
}

/* 小型按钮样式 */
.btn-sm {
    padding: 5px 10px;
    font-size: 12px;
    border-radius: 3px;
}

/* 成功状态按钮样式 */
.btn-success {
    background-color: #4CAF50;
}

.btn-success:hover {
    background-color: #45a049;
}

/* 额度信息样式 */
.quota-info {
    background-color: #f0f8ff;
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 20px;
    border-left: 4px solid #1e90ff;
}

.quota-info p {
    margin-bottom: 5px;
    font-size: 14px;
}

.quota-info strong {
    color: #1e90ff;
}

.no-cards {
    color: #666;
    font-style: italic;
    text-align: center;
    padding: 20px;
    background-color: #f9f9f9;
    border-radius: 5px;
}

/* 卡密表格样式 */
.cards-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    margin-bottom: 20px;
    font-size: 14px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    border-radius: 8px;
    overflow: hidden;
    background-color: white;
}

.cards-table th,
.cards-table td {
    padding: 16px 20px;
    text-align: left;
    border-bottom: 1px solid #f0f0f0;
}

.cards-table th {
    background-color: #f8f9fa;
    font-weight: bold;
    color: #333;
    border-bottom: 2px solid #e9ecef;
    font-size: 15px;
}

.cards-table tr:hover {
    background-color: #f8f9fa;
}

/* 交替行颜色 */
.cards-table tr:nth-child(even) {
    background-color: #f9f9f9;
}

/* 操作列样式 */
.cards-table td:last-child {
    white-space: nowrap;
    width: 100px;
}

/* 卡密列表容器 */
.card-list {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #eee;
    background-color: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

/* 卡密状态样式增强 */
.status-unused {
    color: #28a745;
    font-weight: bold;
    background-color: #d4edda;
    padding: 2px 6px;
    border-radius: 3px;
    display: inline-block;
}

.status-used {
    color: #dc3545;
    font-weight: bold;
    background-color: #f8d7da;
    padding: 2px 6px;
    border-radius: 3px;
    display: inline-block;
}

/* 现代化卡片布局 */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.card-item {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid #f0f0f0;
}

.card-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.card-item-header {
    padding: 15px 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-status {
    font-size: 12px;
    font-weight: bold;
    padding: 4px 12px;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.card-status.status-unused {
    background-color: #e8f5e9;
    color: #2e7d32;
}

.card-status.status-used {
    background-color: #ffebee;
    color: #c62828;
}

.card-item-body {
    padding: 20px;
}

.card-detail {
    margin-bottom: 15px;
}

.card-detail:last-child {
    margin-bottom: 0;
}

.card-detail label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #666;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.card-detail span {
    font-size: 14px;
    color: #333;
    line-height: 1.4;
}

.card-code {
    font-family: 'Courier New', monospace;
    background: #f8f9fa;
    padding: 8px 12px;
    border-radius: 6px;
    display: block;
    word-break: break-all;
    border: 1px solid #e9ecef;
}

.card-item-footer {
    padding: 15px 20px;
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
    display: flex;
    justify-content: flex-end;
}

.card-item-footer .btn {
    font-size: 13px;
    padding: 8px 16px;
}

/* 响应式卡片布局 */
@media (max-width: 768px) {
    .cards-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .card-item {
        margin-bottom: 0;
    }
    
    .card-item-body {
        padding: 15px;
    }
    
    .card-item-header,
    .card-item-footer {
        padding: 12px 15px;
    }
}

/* 只读输入框样式 */
input[readonly] {
    background-color: #f5f5f5;
    cursor: not-allowed;
}

/* 错误和成功消息 */
.error-message {
    background-color: #f8d7da;
    color: #721c24;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 20px;
    text-align: center;
}

.success-message {
    background-color: #d4edda;
    color: #155724;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 20px;
    text-align: center;
}

.info-message {
    background-color: #d1ecf1;
    color: #0c5460;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
    text-align: center;
    border: 1px solid #bee5eb;
}

.info-message h3 {
    margin-bottom: 15px;
    color: #0c5460;
}

.access-key-verification {
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 30px;
    margin-bottom: 30px;
    text-align: center;
}

.access-key-verification h3 {
    margin-bottom: 20px;
    color: #333;
}

.access-key-verification .form-group {
    max-width: 400px;
    margin: 0 auto 20px;
    text-align: left;
}

.access-key-verification input[type="text"] {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

.access-key-verification input[type="text"]:focus {
    outline: none;
    border-color: #008CBA;
    box-shadow: 0 0 5px rgba(0, 140, 186, 0.3);
}

/* 仪表盘样式 */
.dashboard {
    background-color: white;
    padding: 30px;
    border-radius: 5px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

.dashboard h2 {
    color: #333;
    margin-bottom: 30px;
    text-align: center;
}

.status-cards {
    display: flex;
    justify-content: space-around;
    gap: 20px;
    flex-wrap: wrap;
}

.card {
    background-color: #f9f9f9;
    padding: 30px;
    border-radius: 5px;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.05);
    flex: 1;
    min-width: 250px;
    text-align: center;
}

.card h3 {
    color: #666;
    margin-bottom: 15px;
    font-size: 16px;
}

.card p {
    font-size: 18px;
    margin-bottom: 20px;
    color: #333;
}

/* 申请免绑定样式 */
.bind-exemption {
    margin-top: 40px;
    padding: 20px;
    background-color: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #6c757d;
}

.bind-exemption h3 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #333;
}

.bind-exemption p {
    margin-bottom: 15px;
    color: #666;
}

.exemption-info {
    margin-bottom: 20px;
    padding: 15px;
    background-color: white;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

.exemption-info p {
    margin-bottom: 10px;
}

.exemption-info p:last-child {
    margin-bottom: 0;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    header {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .user-info {
        flex-direction: column;
        gap: 10px;
    }
    
    .status-cards {
        flex-direction: column;
        align-items: center;
    }
    
    .card {
        width: 100%;
        max-width: 400px;
    }
    
    /* 响应式表格 */
    .card-list {
        padding: 10px;
        overflow-x: auto;
    }
    
    .cards-table {
        font-size: 13px;
    }
    
    .cards-table th,
    .cards-table td {
        padding: 10px 12px;
    }
    
    /* 表格容器横向滚动 */
    .card-list {
        overflow-x: auto;
    }
    
    .cards-table {
        min-width: 500px;
    }
    
    /* 响应式申请免绑定 */
    .bind-exemption {
        margin-top: 30px;
        padding: 15px;
    }
}