/* 全局样式 */
* {
    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;
    color: #333;
}

/* 登录页面 */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.login-box {
    background: white;
    border-radius: 12px;
    padding: 40px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 400px;
}

.login-box h1 {
    text-align: center;
    margin-bottom: 30px;
    color: #667eea;
}

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

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

.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="number"],
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s;
}

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

.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: auto;
    margin-right: 8px;
    cursor: pointer;
}

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

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5568d3;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-small {
    padding: 6px 12px;
    font-size: 12px;
}

/* 错误消息 */
.error-message {
    background: #fee;
    color: #c33;
    padding: 12px;
    border-radius: 6px;
    margin-top: 10px;
    border-left: 4px solid #c33;
}

/* 主界面 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.header {
    background: white;
    padding: 20px 30px;
    border-radius: 12px;
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.header > div {
    display: flex;
    align-items: center;
    gap: 15px;
}

.header h1 {
    color: #667eea;
    font-size: 24px;
    margin: 0;
}

.admin-badge {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(118, 75, 162, 0.3);
}

.main-content {
    display: grid;
    gap: 30px;
}

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

.section h2 {
    color: #667eea;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0f0f0;
}

/* 提取区域 */
.extract-area {
    margin-bottom: 20px;
}

.result-area {
    margin-top: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.result-header h3 {
    font-size: 16px;
    color: #333;
}

.result-content {
    background: white;
    padding: 15px;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
    white-space: pre-wrap;
    word-wrap: break-word;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    max-height: 300px;
    overflow-y: auto;
}

/* 管理员区域 */
.admin-section {
    margin-top: 30px;
    padding-top: 30px;
    border-top: 2px solid #f0f0f0;
}

.admin-section h3 {
    color: #764ba2;
    margin-bottom: 20px;
}

.admin-block {
    margin-bottom: 25px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.admin-block h4 {
    margin-bottom: 15px;
    color: #555;
    font-size: 16px;
}

.admin-block textarea,
.import-block textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 14px;
    font-family: 'Courier New', monospace;
    resize: vertical;
    margin-bottom: 10px;
}

/* 导入区域样式 */
.import-section {
    margin-top: 30px;
    padding-top: 30px;
    border-top: 2px solid #f0f0f0;
}

.import-section h3 {
    color: #667eea;
    margin-bottom: 20px;
}

.import-block {
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.import-block h4 {
    margin-bottom: 15px;
    color: #555;
    font-size: 16px;
}

.import-form {
    margin-bottom: 20px;
}

.import-form .form-group {
    margin-bottom: 15px;
}

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

.form-input {
    width: 100%;
    padding: 10px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s;
}

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

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.btn-success {
    background: #28a745;
    color: white;
}

.btn-success:hover {
    background: #218838;
}

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

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

.games-list {
    margin-top: 20px;
}

.games-list-header {
    font-weight: 600;
    color: #555;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 2px solid #e0e0e0;
}

.games-list-items {
    max-height: 300px;
    overflow-y: auto;
}

.game-list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    margin-bottom: 8px;
}

.game-item-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.game-item-name {
    font-weight: 500;
    color: #333;
}

.game-item-url {
    font-size: 12px;
    color: #666;
    word-break: break-all;
}

.empty-list {
    text-align: center;
    padding: 20px;
    color: #999;
    font-size: 14px;
}

.settings-form {
    display: grid;
    gap: 15px;
}

.settings-form .form-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.settings-form label {
    min-width: 120px;
    margin-bottom: 0;
}

.settings-form input[type="number"] {
    width: 100px;
    padding: 8px;
}

.message {
    margin-top: 10px;
    padding: 10px;
    border-radius: 6px;
    display: none;
}

.message.success {
    background: #d4edda;
    color: #155724;
    border-left: 4px solid #28a745;
    display: block;
}

.message.error {
    background: #f8d7da;
    color: #721c24;
    border-left: 4px solid #dc3545;
    display: block;
}

/* 搜索区域 */
.search-area {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.search-input {
    flex: 1;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 14px;
}

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

/* 游戏结果 */
.game-results {
    margin-top: 20px;
}

.game-list {
    display: grid;
    gap: 15px;
}

.game-item {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
}

.game-name {
    font-weight: 500;
    color: #333;
    flex: 0 0 150px;
}

.game-url {
    flex: 1;
    color: #666;
    font-size: 14px;
    word-break: break-all;
}

.game-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.copy-game-btn {
    flex-shrink: 0;
}

.btn-warning {
    background: #ffc107;
    color: #333;
}

.btn-warning:hover {
    background: #e0a800;
}

.no-results {
    text-align: center;
    padding: 40px;
    color: #999;
    font-size: 16px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    .search-area {
        flex-direction: column;
    }

    .game-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .game-name,
    .game-url {
        flex: none;
        width: 100%;
    }

    .game-actions {
        width: 100%;
        justify-content: flex-start;
        margin-top: 10px;
    }

    .settings-form .form-group {
        flex-direction: column;
        align-items: flex-start;
    }

    .settings-form label {
        min-width: auto;
    }

    .game-actions {
        width: 100%;
        justify-content: flex-start;
        margin-top: 10px;
    }
}

/* 最新密码提示样式 */
.password-notice-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
}

.password-notice {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 15px;
    font-size: 16px;
}

.password-label {
    font-weight: 500;
    opacity: 0.9;
}

.password-value {
    font-weight: 600;
    font-size: 18px;
    padding: 5px 15px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    min-width: 80px;
    text-align: center;
}

.password-value.password-loaded {
    background: rgba(255, 255, 255, 0.25);
    animation: pulse 2s infinite;
}

.password-value.password-error {
    background: rgba(220, 53, 69, 0.3);
    color: #ffcccc;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.8;
    }
}

/* 弹窗样式 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal-content {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s;
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 2px solid #f0f0f0;
}

.modal-header h3 {
    margin: 0;
    color: #667eea;
    font-size: 20px;
}

.modal-close {
    background: none;
    border: none;
    font-size: 28px;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s;
}

.modal-close:hover {
    background: #f0f0f0;
    color: #333;
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 20px;
    border-top: 2px solid #f0f0f0;
}

