* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #f5f5f5;
    color: #333;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

/* 登录/注册页面 */
.auth-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.auth-card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 400px;
    padding: 40px;
}

.auth-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 30px;
    border-bottom: 2px solid #eee;
}

.auth-tab {
    flex: 1;
    padding: 12px;
    text-align: center;
    cursor: pointer;
    border: none;
    background: none;
    font-size: 16px;
    color: #999;
    transition: all 0.3s;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
}

.auth-tab.active {
    color: #667eea;
    border-bottom-color: #667eea;
}

.auth-form {
    display: none;
}

.auth-form.active {
    display: block;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
}

.form-group input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.btn {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 50px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5568d3;
}

.btn-primary:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.error-message {
    color: #e74c3c;
    font-size: 14px;
    margin-top: 10px;
    text-align: center;
}

.success-message {
    color: #27ae60;
    font-size: 14px;
    margin-top: 10px;
    text-align: center;
}

/* 平台列表页面 */
.platform-page {
    display: none;
}

.platform-page.active {
    display: block;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.page-header h1 {
    font-size: 28px;
    color: #333;
}

.btn-logout {
    background: #e74c3c;
    color: white;
    padding: 10px 24px;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    font-size: 14px;
}

.btn-logout:hover {
    background: #c0392b;
}

.btn-create {
    background: #667eea;
    color: white;
    padding: 8px 20px;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
}

.btn-create:hover {
    background: #5568d3;
}

/* 平台列表标题区域 */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.section-header h2 {
    font-size: 20px;
    color: #333;
    margin: 0;
}

.platform-list {
    display: grid;
    gap: 15px;
    margin-top: 20px;
}

.platform-item {
    background: white;
    border-radius: 8px;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: box-shadow 0.3s;
}

.platform-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* 平台图标 */
.platform-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
    flex-shrink: 0;
}

.platform-icon.github {
    background: #24292e;
}

.platform-icon svg {
    width: 24px;
    height: 24px;
    fill: white;
}

.platform-info {
    flex: 1;
}

.platform-name {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
}

.platform-user-id {
    font-size: 14px;
    color: #999;
}

.platform-actions {
    display: flex;
    gap: 15px;
    align-items: center;
}

/* Switch 开关 */
.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.3s;
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: #667eea;
}

input:checked + .slider:before {
    transform: translateX(26px);
}

.btn-delete {
    background: #e74c3c;
    color: white;
    padding: 8px 20px;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    font-size: 14px;
}

.btn-delete:hover {
    background: #c0392b;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.empty-state-icon {
    font-size: 48px;
    margin-bottom: 20px;
}

.empty-state-text {
    font-size: 16px;
    margin-bottom: 20px;
}

/* 模态框 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal.active {
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: white;
    padding: 30px;
    border-radius: 8px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.modal-header {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 20px;
    color: #333;
}

.modal-body {
    margin-bottom: 20px;
}

.modal-footer {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.btn-cancel {
    background: #eee;
    color: #333;
    padding: 10px 24px;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    font-size: 14px;
}

.btn-cancel:hover {
    background: #ddd;
}

.btn-confirm {
    background: #667eea;
    color: white;
    padding: 10px 24px;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    font-size: 14px;
}

.btn-confirm:hover {
    background: #5568d3;
}

/* 加载状态 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 响应式 */
@media (max-width: 600px) {
    .container {
        padding: 10px;
    }

    .auth-card {
        padding: 20px;
    }

    .platform-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .platform-actions {
        width: 100%;
        margin-top: 15px;
        justify-content: space-between;
    }

    .page-header {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }
}

/* Toast 通知样式 */
.toast-container {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    border-radius: 8px;
    background: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s ease;
    min-width: 200px;
    max-width: 350px;
}

.toast.show {
    opacity: 1;
    transform: translateX(0);
}

.toast-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 14px;
    font-weight: bold;
    flex-shrink: 0;
}

.toast-success .toast-icon {
    background: #27ae60;
}

.toast-error .toast-icon {
    background: #e74c3c;
}

.toast-warning .toast-icon {
    background: #f39c12;
}

.toast-info .toast-icon {
    background: #3498db;
}

.toast-message {
    font-size: 14px;
    color: #333;
    word-break: break-word;
}

/* 语言切换按钮 */
.language-switch {
    display: flex;
    gap: 8px;
    margin-left: auto;
}

.lang-btn {
    padding: 6px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white;
    color: #666;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s;
}

.lang-btn:hover {
    background: #f5f5f5;
}

.lang-btn.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

/* 表单错误消息样式 */
.form-error {
    color: #e74c3c;
    font-size: 13px;
    margin-top: 6px;
    display: none;
}

.form-error.show {
    display: block;
}

.form-error::before {
    content: '⚠ ';
}

/* 胶囊型语言切换按钮 - 固定在右上角 */
.lang-capsule {
    position: fixed;
    top: 20px;
    right: 20px;
    display: flex;
    background: white;
    border-radius: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    z-index: 10000;
    border: 1px solid #e0e0e0;
}

.lang-half {
    padding: 6px 14px;
    border: none;
    background: transparent;
    color: #666;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.lang-half:first-child {
    border-right: 1px solid #e0e0e0;
}

.lang-half:hover {
    background: #f5f5f5;
}

.lang-half.active {
    background: #667eea;
    color: white;
}

/* 认证页面链接 */
.auth-link {
    text-align: center;
    margin-top: 20px;
    color: #666;
}

.auth-link a {
    color: #667eea;
    text-decoration: none;
}

.auth-link a:hover {
    text-decoration: underline;
}
