/* MiniMax H3 提示词优化器 - 前台样式 */
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    background: #0f1117;
    color: #e4e6eb;
    min-height: 100vh;
}
a { color: #a855f7; text-decoration: none; }
a:hover { text-decoration: underline; }

/* 顶部导航 */
.topbar {
    background: #1a1d27;
    border-bottom: 1px solid #2a2e3d;
    padding: 0 24px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
}
.topbar .logo {
    font-size: 18px;
    font-weight: 700;
    background: linear-gradient(135deg, #a855f7, #ec4899);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.topbar .user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
}
.topbar .user-info .avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #a855f7, #ec4899);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
}
.topbar .btn-link {
    background: none;
    border: 1px solid #3a3f52;
    color: #c9cdd9;
    padding: 6px 14px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
}
.topbar .btn-link:hover { border-color: #a855f7; color: #a855f7; }

/* 主容器 */
.container { max-width: 1200px; margin: 0 auto; padding: 24px; }

/* 标签页导航 */
.tabs-nav {
    display: flex;
    gap: 4px;
    margin-bottom: 20px;
    border-bottom: 1px solid #2a2e3d;
}
.tabs-nav .tab-btn {
    background: none;
    border: none;
    color: #8b8fa3;
    padding: 12px 20px;
    cursor: pointer;
    font-size: 14px;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: all 0.2s;
}
.tabs-nav .tab-btn:hover { color: #c9cdd9; }
.tabs-nav .tab-btn.active {
    color: #a855f7;
    border-bottom-color: #a855f7;
    font-weight: 600;
}

/* 面板 */
.panel {
    background: #1a1d27;
    border: 1px solid #2a2e3d;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
}
.panel-title {
    font-size: 14px;
    font-weight: 600;
    color: #c9cdd9;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.panel-title::before {
    content: '';
    width: 3px;
    height: 14px;
    background: #a855f7;
    border-radius: 2px;
}

/* 表单 */
.grid { display: grid; gap: 12px; }
.grid-2 { grid-template-columns: 1fr 1fr; }
.grid-3 { grid-template-columns: 1fr 1fr 1fr; }
label { display: block; font-size: 12px; color: #8b8fa3; margin-bottom: 5px; }
input, select, textarea {
    width: 100%;
    background: #12141c;
    border: 1px solid #2a2e3d;
    border-radius: 8px;
    padding: 9px 12px;
    color: #e4e6eb;
    font-size: 13px;
    outline: none;
    transition: border-color 0.2s;
}
input:focus, select:focus, textarea:focus { border-color: #a855f7; }
textarea { resize: vertical; font-family: "SF Mono", "Consolas", "Microsoft YaHei", monospace; line-height: 1.6; }

/* 按钮 */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-primary {
    background: linear-gradient(135deg, #a855f7, #ec4899);
    color: white;
}
.btn-primary:hover { opacity: 0.9; transform: translateY(-1px); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn-secondary { background: #2a2e3d; color: #c9cdd9; }
.btn-secondary:hover { background: #353a4d; }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-danger { background: #5f1e1e; color: #ff7a7a; }
.btn-danger:hover { background: #7a2828; }
.btn-row { display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; }

/* 状态提示 */
.status {
    font-size: 12px;
    padding: 10px 14px;
    border-radius: 8px;
    margin-top: 12px;
    display: none;
}
.status.show { display: block; }
.status.info { background: #1e3a5f; color: #7ab8ff; }
.status.error { background: #5f1e1e; color: #ff7a7a; }
.status.success { background: #1e5f3a; color: #7affb8; }

/* 输出区域 */
.output-area {
    background: #12141c;
    border: 1px solid #2a2e3d;
    border-radius: 8px;
    padding: 16px;
    font-family: "SF Mono", "Consolas", "Microsoft YaHei", monospace;
    font-size: 12.5px;
    line-height: 1.7;
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 500px;
    overflow-y: auto;
    color: #d4d7e0;
}
.output-area:empty::before { content: '优化结果将显示在这里...'; color: #55596e; }

/* 媒体资产网格 */
.media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
    margin-top: 12px;
}
.media-card {
    background: #12141c;
    border: 2px solid #2a2e3d;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}
.media-card:hover { border-color: #a855f7; transform: translateY(-2px); }
.media-card.selected { border-color: #a855f7; box-shadow: 0 0 0 2px rgba(168,85,247,0.3); }
.media-card .thumb {
    width: 100%;
    height: 100px;
    object-fit: cover;
    background: #1a1d27;
}
.media-card .name {
    padding: 6px 8px;
    font-size: 11px;
    color: #8b8fa3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.media-card .delete-btn {
    position: absolute;
    top: 4px;
    right: 4px;
    background: rgba(95,30,30,0.9);
    color: #ff7a7a;
    border: none;
    width: 22px;
    height: 22px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    display: none;
    align-items: center;
    justify-content: center;
}
.media-card:hover .delete-btn { display: flex; }
.media-card .selected-badge {
    position: absolute;
    top: 4px;
    left: 4px;
    background: #a855f7;
    color: white;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    font-size: 12px;
    display: none;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}
.media-card.selected .selected-badge { display: flex; }

/* 上传区域 */
.upload-zone {
    border: 2px dashed #3a3f52;
    border-radius: 10px;
    padding: 30px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 12px;
}
.upload-zone:hover, .upload-zone.dragover {
    border-color: #a855f7;
    background: rgba(168,85,247,0.05);
}
.upload-zone .icon { font-size: 32px; margin-bottom: 8px; }
.upload-zone .text { font-size: 13px; color: #8b8fa3; }
.upload-zone .hint { font-size: 11px; color: #55596e; margin-top: 4px; }

/* 历史记录 */
.history-list { display: flex; flex-direction: column; gap: 12px; }
.history-item {
    background: #12141c;
    border: 1px solid #2a2e3d;
    border-radius: 10px;
    padding: 14px;
    display: flex;
    gap: 14px;
    cursor: pointer;
    transition: all 0.2s;
}
.history-item:hover { border-color: #a855f7; }
.history-item .thumb {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    object-fit: cover;
    background: #1a1d27;
    flex-shrink: 0;
}
.history-item .no-thumb {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    background: #1a1d27;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
}
.history-item .content { flex: 1; min-width: 0; }
.history-item .raw {
    font-size: 13px;
    color: #c9cdd9;
    margin-bottom: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.history-item .meta {
    font-size: 11px;
    color: #55596e;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}
.history-item .actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex-shrink: 0;
}

/* 复选框行 */
.checkbox-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
}
.checkbox-row input[type="checkbox"] { width: auto; accent-color: #a855f7; }
.checkbox-row label { margin-bottom: 0; cursor: pointer; font-size: 12px; }

/* 加载动画 */
.spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Toast */
.toast {
    position: fixed;
    top: 70px;
    right: 20px;
    background: #1e5f3a;
    color: #7affb8;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 13px;
    opacity: 0;
    transition: opacity 0.3s;
    z-index: 1000;
    pointer-events: none;
}
.toast.show { opacity: 1; }
.toast.error { background: #5f1e1e; color: #ff7a7a; }

/* 分页 */
.pagination {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 20px;
}
.pagination button {
    background: #2a2e3d;
    border: none;
    color: #c9cdd9;
    padding: 8px 14px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
}
.pagination button:hover { background: #353a4d; }
.pagination button.active { background: #a855f7; color: white; }
.pagination button:disabled { opacity: 0.4; cursor: not-allowed; }

/* 登录页 */
.login-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.login-box {
    background: #1a1d27;
    border: 1px solid #2a2e3d;
    border-radius: 16px;
    padding: 36px;
    width: 100%;
    max-width: 400px;
}
.login-box h1 {
    text-align: center;
    font-size: 22px;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #a855f7, #ec4899);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.login-box .subtitle { text-align: center; color: #8b8fa3; font-size: 13px; margin-bottom: 24px; }
.login-box .form-group { margin-bottom: 16px; }
.login-box .btn { width: 100%; margin-top: 8px; }
.login-box .switch { text-align: center; margin-top: 16px; font-size: 13px; color: #8b8fa3; }
.login-box .switch a { cursor: pointer; }

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #55596e;
}
.empty-state .icon { font-size: 48px; margin-bottom: 12px; }
.empty-state .text { font-size: 14px; }
