/* public/assets/css/social/ig-story-viewer.css */

/* 1. 基础盒模型修复 */
.tool-surface, .tool-surface * { box-sizing: border-box; }

/* 2. 宏观布局 (完美 flex-wrap) */
.igs-workspace {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    align-items: stretch;
    width: 100%;
}

.igs-control-panel {
    flex: 1 1 320px;
    min-width: 0;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.02);
    display: flex;
    flex-direction: column;
}

.igs-preview-panel {
    flex: 1 1 450px;
    min-width: 0;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.02);
    display: flex;
    flex-direction: column;
}

/* 3. 控制面板组件 */
.igs-input-group {
    margin-bottom: 20px;
}

.igs-input-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-muted);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.igs-ig-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
    background: var(--bg-body);
    border-radius: 12px;
    padding: 4px;
    /* 模拟 IG 渐变圈外观 */
    background-image: linear-gradient(var(--bg-body), var(--bg-body)), linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
    background-origin: border-box;
    background-clip: padding-box, border-box;
    border: 2px solid transparent;
    transition: 0.3s;
}

.igs-ig-input-wrap:focus-within {
    box-shadow: 0 0 0 4px rgba(220, 39, 67, 0.15);
}

.igs-at-symbol {
    font-size: 1.1rem;
    color: var(--text-muted);
    font-weight: bold;
    padding-left: 12px;
}

.igs-ig-input-wrap input {
    flex: 1;
    width: 100%;
    padding: 12px 10px;
    border: none;
    background: transparent;
    color: var(--text-main);
    font-size: 1.1rem;
    font-weight: 600;
    outline: none;
}

.igs-fetch-btn {
    width: 100%;
    padding: 16px;
    background: linear-gradient(45deg, #f09433, #dc2743, #bc1888);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: 0.2s;
    box-shadow: 0 4px 12px rgba(220, 39, 67, 0.3);
}
.igs-fetch-btn:hover { opacity: 0.9; transform: translateY(-2px); }
.igs-fetch-btn:active { transform: translateY(0); }
.igs-fetch-btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

/* 4. 预览面板组件 */
.igs-panel-title {
    font-size: 1.1rem;
    color: var(--text-main);
    font-weight: 700;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px dashed var(--border-color);
}

.igs-result-area {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.igs-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    color: var(--text-muted);
    opacity: 0.6;
    padding: 40px 0;
}
.igs-empty-state i { font-size: 3rem; margin-bottom: 16px; }

/* 网格布局展示快拍卡片 */
.igs-story-grid {
    display: grid;
    /* 核心响应式：自动填充列，最小140px，最大平分 */
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 16px;
}

/* 快拍 9:16 卡片 */
.igs-story-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.igs-thumb-wrap {
    width: 100%;
    aspect-ratio: 9 / 16;
    background: #cbd5e1;
    position: relative;
    overflow: hidden;
}

.igs-thumb-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.igs-type-icon {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(0,0,0,0.6);
    color: #fff;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
}

.igs-time-badge {
    position: absolute;
    bottom: 8px;
    left: 8px;
    background: rgba(0,0,0,0.6);
    color: #fff;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
}

.igs-dl-btn {
    width: 100%;
    padding: 12px 0;
    background: var(--primary-color);
    color: #fff;
    border: none;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}
.igs-dl-btn:hover { background: #0056b3; }

/* 5. 暗黑模式 */
[data-theme="dark"] .igs-ig-input-wrap { background: #0f172a; }
[data-theme="dark"] .igs-story-card { background: #0f172a; border-color: #334155; }
[data-theme="dark"] .igs-thumb-wrap { background: #1e293b; }

/* 6. 移动端优化 */
@media (max-width: 768px) {
    .igs-preview-panel { max-width: 100%; }
    .igs-story-grid {
        /* 在极小屏幕上稍微减小网格列宽，允许双排显示 */
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }
}