/* 基础样式 */
* {
    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: 900px;
    margin: 0 auto;
}

.card {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.card-small {
    max-width: 400px;
    margin: 0 auto;
}

h1 {
    color: #333;
    margin-bottom: 10px;
    font-size: 28px;
}

h2 {
    color: #555;
    margin: 25px 0 15px;
    font-size: 18px;
    border-bottom: 2px solid #eee;
    padding-bottom: 10px;
}

.subtitle {
    color: #888;
    margin-bottom: 25px;
}

/* 表单样式 */
.form-group {
    margin-bottom: 20px;
}

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

.form-group input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s;
}

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

.form-row {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.form-row input {
    flex: 1;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
}

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

/* 按钮样式 */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
}

.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);
}

.btn-secondary {
    background: #f0f0f0;
    color: #555;
}

.btn-secondary:hover {
    background: #e0e0e0;
}

.btn-danger {
    background: #ff4757;
    color: white;
}

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

.btn-small {
    padding: 8px 16px;
    font-size: 14px;
}

.btn-full {
    width: 100%;
}

/* 结果显示 */
.result {
    margin-top: 25px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.result-item {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #e0e0e0;
}

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

.result-item .label {
    color: #888;
}

.result-item .value {
    color: #333;
    font-weight: 500;
}

.result-item .highlight {
    color: #667eea;
    font-size: 20px;
}

.status-active {
    color: #2ed573;
}

.status-inactive {
    color: #ff4757;
}

.status-warning {
    color: #ffa502;
}

/* 分隔线 */
.divider {
    border: none;
    border-top: 2px solid #e0e0e0;
    margin: 15px 0;
}

/* 错误提示 */
.error {
    background: #fff0f0;
    color: #ff4757;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
}

/* 新 Key 提示 */
.new-key {
    background: #e8f5e9;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    align-items: center;
    gap: 10px;
}

.new-key code {
    background: #333;
    color: #fff;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 14px;
}

/* 统计栏 */
.stats-bar {
    display: flex;
    gap: 20px;
    margin-bottom: 25px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.stat-item {
    text-align: center;
    flex: 1;
}

.stat-label {
    display: block;
    color: #888;
    font-size: 14px;
    margin-bottom: 5px;
}

.stat-value {
    display: block;
    color: #667eea;
    font-size: 28px;
    font-weight: bold;
}

/* 表格样式 */
.user-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

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

.user-table th {
    background: #f8f9fa;
    color: #555;
    font-weight: 500;
}

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

.user-table code {
    background: #f0f0f0;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 13px;
}

.user-table .key-cell {
    display: flex;
    align-items: center;
    gap: 8px;
}

.user-table .full-key {
    background: #f5f5f5;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-family: 'Consolas', 'Monaco', monospace;
    color: #333;
    word-break: break-all;
    max-width: 200px;
}

.btn-copy {
    background: #667eea;
    color: white;
    padding: 4px 8px;
    font-size: 12px;
}

.btn-copy:hover {
    background: #5a6fd6;
}

.btn-copy.copied {
    background: #2ed573;
}

.user-table .actions {
    display: flex;
    gap: 8px;
}

/* 状态徽章 */
.status-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.status-badge.active {
    background: #e8f5e9;
    color: #2ed573;
}

.status-badge.inactive {
    background: #ffebee;
    color: #ff4757;
}

/* 头部行 */
.header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.header-row h1 {
    margin-bottom: 0;
}

/* 空消息 */
.empty-message {
    text-align: center;
    color: #888;
    padding: 40px;
}

/* 页脚 */
.footer {
    text-align: center;
    margin-top: 20px;
}

.footer a {
    color: white;
    text-decoration: none;
    opacity: 0.8;
}

.footer a:hover {
    opacity: 1;
}

/* 响应式 */
@media (max-width: 600px) {
    .card {
        padding: 20px;
    }

    .form-row {
        flex-direction: column;
    }

    .stats-bar {
        flex-direction: column;
        gap: 15px;
    }

    .user-table {
        font-size: 14px;
    }

    .user-table th,
    .user-table td {
        padding: 10px 8px;
    }
}

/* 弹窗样式 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 12px;
    max-width: 400px;
    width: 90%;
}

.modal-content h3 {
    margin-bottom: 20px;
    color: #333;
}

.modal-content .form-row {
    justify-content: space-between;
}

/* 有效期徽章 */
.expire-badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.expire-badge.permanent {
    background: #e3f2fd;
    color: #1976d2;
}

.expire-badge.expired {
    background: #ffebee;
    color: #ff4757;
}

.expire-badge:not(.permanent):not(.expired) {
    background: #fff3e0;
    color: #f57c00;
}