* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f7f7f7;
    padding: 0;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    background-color: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

h1 {
    margin-bottom: 30px;
    color: #2c3e50;
    text-align: center;
}

h2 {
    margin: 25px 0 15px;
    color: #2c3e50;
}

h3 {
    margin: 20px 0 10px;
    color: #2c3e50;
}

.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
}

input[type="url"], 
select,
input[type="date"],
input#api_key {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

input[type="url"]:focus, 
select:focus,
input[type="date"]:focus {
    border-color: #3498db;
    outline: none;
}

/* 日期选择器特定样式 */
input[type="date"] {
    appearance: none;
    -webkit-appearance: none;
    background-color: #fff;
    cursor: pointer;
}

input[type="date"]::-webkit-calendar-picker-indicator {
    padding: 0 8px;
    color: #3498db;
    opacity: 0.7;
    cursor: pointer;
}

input[type="date"]::-webkit-calendar-picker-indicator:hover {
    opacity: 1;
}

/* 帮助文本样式 */
.form-text {
    display: block;
    margin-top: 5px;
    font-size: 14px;
    color: #6c757d;
}

.form-actions {
    margin-top: 30px;
}

button {
    background-color: #3498db;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s;
}

button:hover {
    background-color: #2980b9;
}

.message {
    margin: 20px 0;
    padding: 15px;
    border-radius: 4px;
}

.message.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.message.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.result {
    margin-top: 30px;
    padding: 20px;
    background-color: #f8f9fa;
    border-radius: 4px;
}

.api-key {
    display: flex;
    align-items: center;
    margin: 15px 0;
    padding: 12px;
    background-color: #e9ecef;
    border-radius: 4px;
    overflow-x: auto;
}

.api-key code {
    font-family: monospace;
    font-size: 16px;
    flex-grow: 1;
    word-break: break-all;
}

.api-key button {
    margin-left: 10px;
    padding: 8px 12px;
    font-size: 14px;
}

.api-info {
    margin: 15px 0;
}

.api-usage pre {
    background-color: #e9ecef;
    padding: 15px;
    border-radius: 4px;
    overflow-x: auto;
    margin: 10px 0;
    font-family: monospace;
}

.admin-panel {
    margin-top: 20px;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.panel-header h2 {
    margin: 0;
}

.panel-actions {
    display: flex;
    gap: 10px;
}

.btn {
    display: inline-block;
    padding: 10px 20px;
    background-color: #3498db;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    font-size: 14px;
    transition: background-color 0.3s;
}

.btn:hover {
    background-color: #2980b9;
}

.btn-primary {
    background-color: #3498db;
}

.empty-state {
    padding: 40px;
    text-align: center;
    background-color: #f8f9fa;
    border-radius: 4px;
    margin-top: 20px;
}

.empty-state p {
    color: #6c757d;
    font-size: 16px;
}

.table-responsive {
    overflow-x: auto;
    margin-top: 20px;
}

.api-keys-table {
    width: 100%;
    border-collapse: collapse;
}

.api-keys-table th, 
.api-keys-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #e9ecef;
}

.api-keys-table thead th {
    background-color: #f8f9fa;
    color: #495057;
    font-weight: 600;
}

.api-keys-table tbody tr:hover {
    background-color: #f8f9fa;
}

.api-key-cell {
    display: flex;
    align-items: center;
}

.api-key-code {
    font-family: monospace;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.copy-btn {
    margin-left: 10px;
    padding: 4px 8px;
    font-size: 12px;
    background-color: #6c757d;
}

.copy-btn:hover {
    background-color: #5a6268;
}

.copy-btn.success {
    background-color: #28a745;
}

.status-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
}

.status-badge.active {
    background-color: #d4edda;
    color: #155724;
}

.status-badge.inactive {
    background-color: #f8d7da;
    color: #721c24;
}

.action-buttons {
    display: flex;
    gap: 5px;
}

.btn-toggle {
    background-color: #6c757d;
    padding: 6px 10px;
    font-size: 12px;
}

.btn-delete {
    background-color: #dc3545;
    padding: 6px 10px;
    font-size: 12px;
}

.btn-delete:hover {
    background-color: #c82333;
}

.fade-out {
    opacity: 0;
    transition: opacity 0.5s;
}

.notification-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    max-width: 300px;
}

.notification {
    padding: 15px;
    margin-bottom: 10px;
    border-radius: 4px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    position: relative;
    animation: slideIn 0.3s ease;
}

.notification.info {
    background-color: #d1ecf1;
    color: #0c5460;
}

.notification.success {
    background-color: #d4edda;
    color: #155724;
}

.notification.error {
    background-color: #f8d7da;
    color: #721c24;
}

.notification-close {
    position: absolute;
    top: 5px;
    right: 10px;
    cursor: pointer;
    font-size: 16px;
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@media (max-width: 768px) {
    .panel-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .api-keys-table th,
    .api-keys-table td {
        padding: 8px 10px;
    }
    
    .action-buttons {
        flex-direction: column;
    }
}

/* 分页相关样式 */
.pagination-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 20px;
    padding: 10px;
    background-color: #f9f9f9;
    border-radius: 4px;
}

.pagination {
    display: flex;
    margin-right: 15px;
}

.page-btn {
    display: flex;
    justify-content: center;
    align-items: center;
    min-width: 32px;
    height: 32px;
    margin: 0 2px;
    padding: 0 8px;
    border-radius: 2px;
    background-color: #fff;
    border: 1px solid #d9d9d9;
    color: rgba(0, 0, 0, 0.85);
    text-decoration: none;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    transition: all 0.3s;
}

.page-btn:hover {
    border-color: #1890ff;
    color: #1890ff;
}

.page-btn.active {
    background-color: #1890ff;
    border-color: #1890ff;
    color: #fff;
}

.page-btn.disabled {
    color: rgba(0, 0, 0, 0.25);
    border-color: #d9d9d9;
    cursor: not-allowed;
}

.prev, .next {
    font-weight: bold;
}

.page-size-selector {
    margin: 0 15px;
}

.page-size-selector select {
    padding: 5px 10px;
    border: 1px solid #d9d9d9;
    border-radius: 2px;
    font-size: 14px;
    height: 32px;
}

.pagination-info {
    display: flex;
    align-items: center;
    font-size: 14px;
}

.pagination-info input {
    width: 50px;
    height: 32px;
    margin: 0 5px;
    padding: 0 5px;
    border: 1px solid #d9d9d9;
    border-radius: 2px;
    text-align: center;
}

.pagination-info button {
    margin-left: 5px;
    padding: 0 15px;
    height: 32px;
    /* background-color: #fff; */
    border: 1px solid #d9d9d9;
    border-radius: 2px;
    cursor: pointer;
    transition: all 0.3s;
}

.pagination-info button:hover {
    border-color: #1890ff;
    color: white;
} 
input#api_key {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

/* 登录页面样式 */
.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background-color: #f5f5f5;
}

.login-page .main-content {
    margin-left: 0;
    background-color: transparent;
    box-shadow: none;
}

.login-page .content-wrapper {
    padding: 0;
}

.full-width {
    width: 100%;
}

/* 模态窗口样式改进 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    position: relative;
    background-color: #ffffff;
    margin: 8% auto;
    padding: 25px;
    border: none;
    width: 400px;
    max-width: 90%;
    border-radius: 8px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from { transform: translateY(-50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* 关闭按钮样式 */
.close-modal {
    position: absolute;
    right: 15px;
    top: 15px;
    font-size: 24px;
    font-weight: normal;
    cursor: pointer;
    color: #9e9e9e;
    transition: color 0.2s;
    line-height: 1;
}

.close-modal:hover,
.close-modal:focus {
    color: #333;
}

/* 弹窗标题样式 */
.modal-content h2 {
    margin: 0 0 25px 0;
    padding-bottom: 15px;
    color: #333;
    font-size: 18px;
    font-weight: 600;
    border-bottom: 1px solid #eee;
    text-align: center;
}

/* 表单组样式 */
.form-group {
    margin-bottom: 22px;
}

.form-group label {
    display: block;
    margin-bottom: 10px;
    font-weight: 500;
    color: #333;
    font-size: 14px;
}

/* 自定义单选按钮样式 */
.radio-group {
    display: flex;
    flex-direction: row;
    justify-content: space-around;
    gap: 10px;
    margin-bottom: 20px;
}

.radio-item {
    display: flex;
    align-items: center;
    position: relative;
    padding: 12px 15px;
    background-color: #f9f9f9;
    border-radius: 6px;
    transition: all 0.2s;
    border: 1px solid #eee;
    width: 45%;
    justify-content: center;
}

.radio-item:hover {
    background-color: #f0f0f0;
}

.radio-item input[type="radio"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.radio-item label {
    margin-bottom: 0;
    cursor: pointer;
    font-weight: 500;
    padding-left: 25px;
    position: relative;
}

.radio-item label:before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    border: 2px solid #ddd;
    border-radius: 50%;
    background-color: #fff;
    transition: all 0.2s;
}

.radio-item input[type="radio"]:checked + label:before {
    border-color: #3498db;
}

.radio-item input[type="radio"]:checked + label:after {
    content: '';
    position: absolute;
    left: 5px;
    top: 50%;
    transform: translateY(-50%);
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #3498db;
}

.radio-item input[type="radio"]:checked ~ label {
    color: #3498db;
}

.radio-item input[type="radio"]:checked {
    background-color: rgba(52, 152, 219, 0.05);
    border-color: rgba(52, 152, 219, 0.2);
}

/* 日期选择器样式 */
#date-picker-group {
    margin-top: 20px;
    position: relative;
}

input[type="datetime-local"] {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    background-color: #f9f9f9;
    transition: all 0.2s;
}

input[type="datetime-local"]:focus {
    border-color: #3498db;
    background-color: #fff;
    outline: none;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.15);
}

/* 给日期选择器添加图标 */
#date-picker-group::after {
   
    position: absolute;
    right: 15px;
    top: 42px;
    font-size: 16px;
    color: #aaa;
    pointer-events: none;
}

/* 按钮样式 */
.form-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 30px;
    gap: 10px;
}

.btn {
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
    border: none;
}

.btn-primary {
    background-color: #3498db;
    color: white;
}

.btn-primary:hover {
    background-color: #2980b9;
}

.btn-secondary {
    background-color: #f3f3f3;
    color: #444;
    border: 1px solid #ddd;
}

.btn-secondary:hover {
    background-color: #e9e9e9;
}

/* 删除状态样式 */
.status-badge.deleted {
    background-color: #e74c3c;
    color: white;
}

.status-badge.normal {
    background-color: #2ecc71;
    color: white;
}

/* 按钮样式 */
.btn-edit {
    background-color: #3498db;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 3px;
    cursor: pointer;
    margin-right: 5px;
}

.btn-edit:hover {
    background-color: #2980b9;
}

.btn-restore {
    background-color: #2ecc71;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 3px;
    cursor: pointer;
}

.btn-restore:hover {
    background-color: #27ae60;
}

/* 确保日期选择器样式一致 */
input[type="datetime-local"] {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

input[type="datetime-local"]:focus {
    border-color: #3498db;
    outline: none;
}