/**
 * 百宝箱 App 样式
 */

.treasure-content {
    flex: 1;
    overflow-y: auto;
    padding: 16px 16px 30px;
    box-sizing: border-box;
    -webkit-overflow-scrolling: touch;
}

/* 空状态 */
.treasure-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 70px 20px;
    color: #000;
}

.treasure-empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.treasure-empty-text {
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 10px;
}

.treasure-empty-tip {
    font-size: 12px;
    color: #666;
    line-height: 1.7;
}

/* 文件卡片 */
.treasure-file-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    margin-bottom: 12px;
    background: #fff;
    border: 2px solid #000;
    border-radius: 12px;
    box-shadow: 3px 3px 0 #000;
    cursor: pointer;
}

.treasure-file-item:active {
    transform: translate(2px, 2px);
    box-shadow: 1px 1px 0 #000;
}

.treasure-file-icon {
    flex-shrink: 0;
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: bold;
    border: 2px solid #000;
    border-radius: 10px;
    background: #f3f3f3;
}

.treasure-file-info {
    flex: 1;
    min-width: 0;
}

.treasure-file-name {
    font-size: 14px;
    font-weight: bold;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.treasure-file-meta {
    font-size: 11px;
    color: #888;
    margin-top: 4px;
}

.treasure-file-actions {
    flex-shrink: 0;
    display: flex;
    gap: 6px;
}

.treasure-action-btn {
    padding: 6px 8px;
    font-size: 12px;
    font-weight: bold;
    color: #000;
    background: #fff;
    border: 2px solid #000;
    border-radius: 8px;
    cursor: pointer;
    white-space: nowrap;
}

.treasure-action-btn.run {
    background: #000;
    color: #fff;
}

.treasure-action-btn:active {
    transform: translate(1px, 1px);
}

/* 查看/运行视图 */
.treasure-viewer-body {
    flex: 1;
    min-height: 0;
    overflow: hidden;
    background: #fff;
    display: flex;
    flex-direction: column;
}

.treasure-run-frame {
    flex: 1;
    width: 100%;
    height: 100%;
    border: none;
    background: #fff;
}

.treasure-text-view {
    flex: 1;
    margin: 0;
    padding: 16px;
    overflow: auto;
    font-size: 12px;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-word;
    font-family: ui-monospace, Menlo, Consolas, monospace;
    color: #000;
    -webkit-overflow-scrolling: touch;
}

/* 深色模式 */
.dark .treasure-file-item {
    background: #1e1e1e;
    border-color: #fff;
    box-shadow: 3px 3px 0 #fff;
}

.dark .treasure-file-icon {
    border-color: #fff;
    background: #2a2a2a;
    color: #fff;
}

.dark .treasure-file-name,
.dark .treasure-empty,
.dark .treasure-text-view {
    color: #fff;
}

.dark .treasure-action-btn {
    background: #fff;
    color: #000;
    border-color: #fff;
}

.dark .treasure-action-btn.run {
    background: #1e1e1e;
    color: #fff;
    border-color: #fff;
}

.dark .treasure-viewer-body,
.dark .treasure-run-frame {
    background: #1e1e1e;
}
