/**
 * SDK 样式文件
 */

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body { 
    width: 100%; 
    height: 100%; 
    overflow: hidden; 
    background: #000;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* ========== 游戏容器 ========== */
#game-container {
    width: 100%;
    height: 100%;
    position: relative;
}
#game-frame {
    width: 100%;
    height: 100%;
    border: none;
}

/* ========== 弹窗通用样式 ========== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    z-index: 100000;
    display: none;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}
.modal-overlay.show {
    display: flex;
}
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes slideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}
.modal-content {
    background: linear-gradient(145deg, #1e1e2e 0%, #2a2a3e 100%);
    border-radius: 20px;
    padding: 0;
    max-width: 90%;
    max-height: 85%;
    overflow: hidden;
    color: #fff;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.5);
    animation: slideUp 0.3s ease;
}
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    background: rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.modal-title {
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}
.modal-title svg {
    width: 22px;
    height: 22px;
    fill: #667eea;
}
.modal-close {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}
.modal-close:hover {
    background: rgba(255, 100, 100, 0.3);
    transform: rotate(90deg);
}
.modal-body {
    padding: 24px;
    overflow-y: auto;
    max-height: calc(85vh - 80px);
}

/* ========== SDK 菜单样式 ========== */
.sdk-menu-content {
    width: 320px;
}
.sdk-menu-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}
.sdk-menu-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px 8px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
    background: rgba(255, 255, 255, 0.05);
}
.sdk-menu-item:hover {
    background: rgba(102, 126, 234, 0.2);
    transform: translateY(-2px);
}
.sdk-menu-item .icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}
.sdk-menu-item svg {
    width: 22px;
    height: 22px;
    fill: #fff;
}
.sdk-menu-item .fa {
    font-size: 20px;
    color: #fff;
}
.sdk-menu-item img {
    width: 22px;
    height: 22px;
}
.sdk-menu-item .name {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.8);
    text-align: center;
}

/* ========== 组件通用样式 ========== */
.component-modal {
    width: 380px;
}
.component-input {
    width: 100%;
    padding: 14px 16px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    font-size: 15px;
    transition: all 0.2s;
    resize: none;
}
.component-input:focus {
    outline: none;
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.1);
}
.component-input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}
.component-select {
    width: 100%;
    padding: 14px 16px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    font-size: 15px;
    cursor: pointer;
}
.component-select option {
    background: #2a2a3e;
    color: #fff;
}
.component-btn {
    width: 100%;
    padding: 14px 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 12px;
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}
.component-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}
.component-btn:active {
    transform: translateY(0);
}
.component-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}
.component-result {
    margin-top: 12px;
    padding: 12px;
    border-radius: 8px;
    font-size: 13px;
    background: rgba(255, 255, 255, 0.05);
}
.component-result.success {
    background: rgba(78, 205, 196, 0.2);
    color: #4ecdc4;
}
.component-result.error {
    background: rgba(255, 107, 107, 0.2);
    color: #ff6b6b;
}
.form-group {
    margin-bottom: 16px;
}
.form-label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
}

/* ========== 空状态 ========== */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: rgba(255, 255, 255, 0.5);
}
.empty-state svg {
    width: 60px;
    height: 60px;
    fill: rgba(255, 255, 255, 0.3);
    margin-bottom: 16px;
}

/* ========== 列表样式 ========== */
.list-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: all 0.2s;
}
.list-item:last-child {
    margin-bottom: 0;
}
.list-item:hover {
    background: rgba(102, 126, 234, 0.2);
}
.list-item .icon-box {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.list-item .icon-box svg {
    width: 24px;
    height: 24px;
    fill: #fff;
}
.list-item .info h4 {
    font-size: 16px;
    margin-bottom: 4px;
}
.list-item .info p {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.6);
}

/* ========== 加载状态 ========== */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
}
.loading::after {
    content: '';
    width: 30px;
    height: 30px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}
