/* PHP后端样式文件 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f7fa;
    color: #333;
    line-height: 1.6;
}

/* 登录页面样式 */
.login-body {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 20px;
}

.login-box {
    background: white;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
}

.login-box h2 {
    text-align: center;
    margin-bottom: 30px;
    color: #333;
    font-size: 28px;
}

.login-form .form-group {
    margin-bottom: 20px;
}

.login-form label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #555;
}

.login-form input {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.login-form input:focus {
    outline: none;
    border-color: #667eea;
}

.login-btn {
    width: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
    transition: transform 0.2s;
}

.login-btn:hover {
    transform: translateY(-2px);
}

.login-info {
    margin-top: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 5px;
    font-size: 14px;
}

.login-info p {
    margin-bottom: 5px;
}

.error-message {
    background: #ffebee;
    color: #c62828;
    padding: 10px;
    border-radius: 5px;
    margin-bottom: 20px;
    text-align: center;
}

/* 主布局样式 */
.container {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 250px;
    background: #2c3e50;
    color: white;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
}

.logo {
    padding: 30px 20px;
    border-bottom: 1px solid #34495e;
}

.logo h2 {
    font-size: 24px;
    font-weight: 600;
}

.nav-menu {
    padding: 20px 0;
}

.nav-menu ul {
    list-style: none;
}

.nav-menu li {
    margin-bottom: 5px;
}

.nav-link {
    display: block;
    padding: 12px 20px;
    color: #bdc3c7;
    text-decoration: none;
    transition: all 0.3s;
}

.nav-link:hover,
.nav-link.active {
    background: #34495e;
    color: white;
    border-left: 4px solid #3498db;
}

.main-content {
    flex: 1;
    margin-left: 250px;
    min-height: 100vh;
}

.header {
    background: white;
    padding: 20px 30px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header h1 {
    color: #2c3e50;
    font-size: 24px;
}

.user-info {
    color: #7f8c8d;
}

.user-info a {
    color: #e74c3c;
    text-decoration: none;
}

.content {
    padding: 30px;
}

/* 仪表板样式 */
.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.stat-card h3 {
    color: #7f8c8d;
    font-size: 16px;
    margin-bottom: 10px;
}

.stat-number {
    font-size: 36px;
    font-weight: bold;
    color: #2c3e50;
}

.recent-activity {
    background: white;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.recent-activity h3 {
    margin-bottom: 15px;
    color: #2c3e50;
}

/* 密钥管理样式 */
.form-section {
    background: white;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
}

.form-section h3 {
    margin-bottom: 20px;
    color: #2c3e50;
}

.form-row {
    display: flex;
    gap: 20px;
    align-items: end;
}

.form-group {
    flex: 1;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #555;
}

.form-group input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.keys-section {
    background: white;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.keys-section h3 {
    margin-bottom: 20px;
    color: #2c3e50;
}

.keys-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.keys-table th,
.keys-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
}

.keys-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #555;
}

.api-key {
    position: relative;
}

.show-key {
    background: #3498db;
    color: white;
    border: none;
    padding: 4px 8px;
    border-radius: 3px;
    font-size: 12px;
    cursor: pointer;
    margin-left: 10px;
}

.full-key {
    font-family: monospace;
    background: #f8f9fa;
    padding: 2px 6px;
    border-radius: 3px;
}

.status {
    padding: 4px 8px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 500;
}

.status.active {
    background: #e8f5e8;
    color: #2e7d32;
}

.status.expired {
    background: #ffebee;
    color: #c62828;
}

.btn-primary {
    background: #3498db;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.btn-danger {
    background: #e74c3c;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
    text-decoration: none;
}

.btn-primary:hover {
    background: #2980b9;
}

.btn-danger:hover {
    background: #c0392b;
}

.message {
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 20px;
}

.message.success {
    background: #e8f5e8;
    color: #2e7d32;
    border: 1px solid #c8e6c9;
}

.message.error {
    background: #ffebee;
    color: #c62828;
    border: 1px solid #ffcdd2;
}

/* 记录中心样式 */
.records-section {
    background: white;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
}

.records-section h3 {
    margin-bottom: 20px;
    color: #2c3e50;
    font-size: 20px;
    border-bottom: 2px solid #3498db;
    padding-bottom: 10px;
}

.no-records {
    text-align: center;
    padding: 40px;
    color: #7f8c8d;
}

.no-records p {
    font-size: 16px;
}

.records-table {
    overflow-x: auto;
}

.records-table table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    min-width: 800px;
}

.records-table th {
    background: #3498db;
    color: white;
    padding: 12px 15px;
    text-align: left;
    font-weight: 600;
    position: sticky;
    top: 0;
}

.records-table th:first-child {
    border-top-left-radius: 6px;
}

.records-table th:last-child {
    border-top-right-radius: 6px;
}

.records-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #f0f0f0;
    vertical-align: top;
}

.records-table tr:hover {
    background: #f8f9fa;
}

.records-table tr:nth-child(even) {
    background: #fafafa;
}

.records-table tr:nth-child(even):hover {
    background: #f0f0f0;
}

.label-data {
    max-width: 300px;
    word-wrap: break-word;
    line-height: 1.4;
    font-family: 'Courier New', monospace;
    background: #f8f9fa;
    padding: 8px;
    border-radius: 4px;
    border: 1px solid #e0e0e0;
}

.info-section {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.info-section h3 {
    margin-bottom: 15px;
    color: #2c3e50;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
}

.info-item {
    padding: 10px;
    background: #f8f9fa;
    border-radius: 4px;
    border-left: 4px solid #3498db;
}

.info-item strong {
    color: #2c3e50;
}

/* 记录操作按钮 */
.record-actions {
    margin-top: 20px;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.btn-secondary {
    background: #95a5a6;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.btn-secondary:hover {
    background: #7f8c8d;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .form-row {
        flex-direction: column;
    }
    
    .keys-table {
        font-size: 12px;
    }
    
    .records-table table {
        min-width: auto;
        font-size: 12px;
    }
    
    .records-table th,
    .records-table td {
        padding: 8px 10px;
    }
    
    .label-data {
        max-width: 150px;
        font-size: 11px;
    }
    
    .info-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .records-table {
        font-size: 11px;
    }
    
    .records-table th,
    .records-table td {
        padding: 6px 8px;
    }
    
    .label-data {
        max-width: 120px;
    }
}