/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

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

.login-box {
    background: white;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.login-box h1 {
    color: #333;
    margin-bottom: 10px;
    font-size: 24px;
}

.subtitle {
    color: #666;
    margin-bottom: 30px;
    font-size: 14px;
}

.login-form {
    margin-bottom: 30px;
}

.form-group {
    margin-bottom: 20px;
    text-align: left;
}

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

.form-group input {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    text-align: center;
    letter-spacing: 2px;
    transition: border-color 0.3s;
}

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

.login-btn {
    width: 100%;
    padding: 12px;
    background: #333;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.login-btn:hover {
    background: #000;
}

.error-message {
    background: #f8f8f8;
    color: #d32f2f;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 20px;
    border-left: 4px solid #d32f2f;
}

.totp-info {
    background: #f8f8f8;
    padding: 20px;
    border-radius: 4px;
    text-align: left;
}

.totp-info h3 {
    color: #333;
    margin-bottom: 10px;
    font-size: 16px;
}

.totp-info p {
    color: #666;
    font-size: 14px;
    margin-bottom: 8px;
}

.totp-info code {
    background: #e0e0e0;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    color: #333;
}

/* 主页面样式 */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

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

.header h1 {
    color: #333;
    font-size: 28px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

.api-key {
    background: #f0f0f0;
    padding: 8px 12px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    color: #666;
    font-size: 12px;
}

.logout-btn {
    background: #666;
    color: white;
    padding: 8px 16px;
    text-decoration: none;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.logout-btn:hover {
    background: #333;
}

.main-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

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

.api-panel h2, .result-panel h2 {
    color: #333;
    margin-bottom: 20px;
    font-size: 20px;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 10px;
}

.function-selector {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.function-selector select {
    flex: 1;
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.function-selector select:focus {
    outline: none;
    border-color: #333;
}

.function-info {
    border: 2px solid #f0f0f0;
    border-radius: 8px;
    padding: 20px;
    background: #fafafa;
}

.function-info h3 {
    color: #333;
    margin-bottom: 10px;
    font-size: 18px;
}

.function-info p {
    color: #666;
    margin-bottom: 20px;
}

.parameters-section h4 {
    color: #333;
    margin: 20px 0 10px 0;
    font-size: 16px;
}

.params-container {
    display: grid;
    gap: 10px;
    margin-bottom: 15px;
}

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

.param-group label {
    min-width: 120px;
    color: #333;
    font-weight: 500;
    font-size: 14px;
}

.param-group input, .param-group select {
    flex: 1;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.param-group input:focus, .param-group select:focus {
    outline: none;
    border-color: #333;
}

.action-buttons {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
}

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

.btn-primary:hover {
    background: #000;
}

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

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

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

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #f0f0f0;
}

.request-url {
    font-family: 'Courier New', monospace;
    color: #666;
    font-size: 12px;
    word-break: break-all;
}

.result-actions {
    display: flex;
    gap: 5px;
}

.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 40px;
    color: #666;
}

.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #f0f0f0;
    border-top: 2px solid #333;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

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

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

.api-docs h2 {
    color: #333;
    margin-bottom: 15px;
    font-size: 20px;
}

.api-docs p {
    color: #666;
    margin-bottom: 20px;
}

.api-docs a {
    color: #333;
    text-decoration: underline;
}

.api-docs a:hover {
    color: #000;
}

.common-examples h3 {
    color: #333;
    margin-bottom: 15px;
    font-size: 18px;
}

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

.example-card {
    background: #f8f8f8;
    padding: 15px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
    border: 2px solid transparent;
}

.example-card:hover {
    background: #f0f0f0;
    border-color: #ddd;
}

.example-card h4 {
    color: #333;
    margin-bottom: 8px;
    font-size: 16px;
}

.example-card p {
    color: #666;
    font-size: 14px;
    margin: 0;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .main-content {
        grid-template-columns: 1fr;
    }
    
    .header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .header-actions {
        flex-direction: column;
        gap: 10px;
    }
    
    .function-selector {
        flex-direction: column;
    }
    
    .result-header {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }
    
    .example-grid {
        grid-template-columns: 1fr;
    }
}