/* ===== AI Summary Pro - 前端样式 v1.2 ===== */

/* CSS 变量 */
:root {
    --asp-c: #6366f1;
    --asp-cd: #4f46e5;
    --asp-cl: #a5b4fc;
}

/* 卡片基础 */
.asp-card {
    margin: 0 0 28px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    position: relative;
    animation: asp-fade-in 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.asp-animated {
    animation: asp-slide-in 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes asp-fade-in {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: none; }
}

@keyframes asp-slide-in {
    from { opacity: 0; transform: translateY(-12px); }
    to { opacity: 1; transform: none; }
}

/* 头部 */
.asp-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    gap: 12px;
    flex-wrap: wrap;
}

.asp-header-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.asp-icon {
    font-size: 20px;
    line-height: 1;
}

.asp-title {
    font-size: 14px;
    font-weight: 800;
    color: var(--asp-c);
    letter-spacing: 0.3px;
}

.asp-header-right {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.asp-badge {
    font-size: 10.5px;
    background: rgba(99, 102, 241, 0.08);
    color: var(--asp-c);
    padding: 2px 10px;
    border-radius: 6px;
    font-weight: 700;
    white-space: nowrap;
}

/* 内容区 */
.asp-body {
    font-size: 14px;
    line-height: 1.8;
    color: #334155;
}

.asp-text {
    margin: 0;
    padding: 14px 18px;
    border-radius: 10px;
    min-height: 24px;
}

/* ===== 打字机效果 ===== */
.asp-typewriter-wrap {
    position: relative;
}

.asp-tw-content {
    /* 文字内容容器 */
}

.asp-cursor {
    display: inline-block;
    width: 2px;
    height: 1.1em;
    background: var(--asp-c);
    margin-left: 1px;
    vertical-align: text-bottom;
    animation: asp-cursor-blink 0.8s ease-in-out infinite;
}

.asp-card.asp-typing .asp-cursor {
    animation: none;
    opacity: 1;
}

@keyframes asp-cursor-blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* ===== 加载动画 ===== */
.asp-loading {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-right: 6px;
    vertical-align: middle;
}

.asp-loading-dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--asp-c);
    animation: asp-dot-pulse 1.4s ease-in-out infinite;
}

.asp-loading-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.asp-loading-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes asp-dot-pulse {
    0%, 80%, 100% {
        transform: scale(0.6);
        opacity: 0.4;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

.asp-loading-text {
    font-size: 13px;
    color: #94a3b8;
    font-style: italic;
}

/* ===== 主题：渐变 ===== */
.asp-theme-gradient .asp-text {
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.05), rgba(139, 92, 246, 0.05));
}

.asp-theme-gradient.asp-border-left .asp-text {
    border-left: 4px solid var(--asp-c);
    border-radius: 0 10px 10px 0;
}

.asp-theme-gradient.asp-border-top .asp-text {
    border-top: 4px solid var(--asp-c);
    border-radius: 0 0 10px 10px;
}

.asp-theme-gradient.asp-border-full .asp-text {
    border: 2px solid var(--asp-c);
    border-radius: 10px;
}

.asp-theme-gradient.asp-border-none .asp-text {
    border: none;
}

/* ===== 主题：毛玻璃 ===== */
.asp-theme-glass .asp-text {
    background: rgba(99, 102, 241, 0.04);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(99, 102, 241, 0.12);
    border-radius: 12px;
}

.asp-theme-glass.asp-border-left .asp-text {
    border-left: 4px solid var(--asp-c);
}

.asp-theme-glass.asp-border-top .asp-text {
    border-top: 4px solid var(--asp-c);
}

/* ===== 主题：极简 ===== */
.asp-theme-minimal .asp-text {
    background: #f8fafc;
    padding: 14px 0;
    border-radius: 0;
}

.asp-theme-minimal.asp-border-left .asp-text {
    border-left: 3px solid var(--asp-c);
    padding-left: 16px;
    border-radius: 0;
}

.asp-theme-minimal.asp-border-top .asp-text {
    border-top: 3px solid var(--asp-c);
    padding-top: 16px;
}

.asp-theme-minimal.asp-border-full .asp-text {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 14px 16px;
}

.asp-theme-minimal.asp-border-none .asp-text {
    border: none;
}

/* ===== 主题：卡片 ===== */
.asp-theme-card .asp-text {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
}

.asp-theme-card.asp-border-left .asp-text {
    border-left: 4px solid var(--asp-c);
}

.asp-theme-card.asp-border-top .asp-text {
    border-top: 4px solid var(--asp-c);
}

/* ===== 折叠按钮 ===== */
.asp-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 6px 0;
    background: none;
    border: none;
    cursor: pointer;
    color: #94a3b8;
    font-size: 12px;
    transition: all 0.2s;
    font-family: inherit;
}

.asp-toggle:hover {
    color: var(--asp-c);
}

.asp-toggle svg {
    transition: transform 0.3s;
}

.asp-card.asp-collapsed .asp-body {
    max-height: 0;
    overflow: hidden;
    margin: 0;
    padding: 0;
    transition: max-height 0.3s ease, margin 0.3s ease, padding 0.3s ease;
}

.asp-card.asp-collapsed .asp-toggle svg {
    transform: rotate(-90deg);
}

.asp-body {
    max-height: 500px;
    transition: max-height 0.4s ease;
}

/* ===== 响应式 ===== */
@media (max-width: 640px) {
    .asp-header {
        flex-direction: column;
        align-items: flex-start;
    }
    .asp-header-right {
        width: 100%;
    }
    .asp-text {
        padding: 12px 14px;
        font-size: 13.5px;
    }
}
