/* css/style.css - DreamDecoder Theme (Final Version) */

:root {
    --bg-dark: #0f0c29;
    --bg-gradient: linear-gradient(135deg, #0f0c29, #302b63, #24243e);
    --card-bg: rgba(255, 255, 255, 0.05);
    /* 半透明玻璃 */
    --card-border: rgba(255, 255, 255, 0.1);
    --text-main: #e2e8f0;
    --text-muted: #94a3b8;
    --accent: #a855f7;
    /* 神秘紫 */
    --accent-glow: #d8b4fe;
    --font-serif: 'Playfair Display', serif;
    --font-sans: 'Inter', sans-serif;
}

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

body {
    background: var(--bg-gradient);
    color: var(--text-main);
    font-family: var(--font-sans);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

/* 头部 */
header {
    border-bottom: 1px solid var(--card-border);
    background: rgba(15, 12, 41, 0.8);
    backdrop-filter: blur(10px);
}

.brand-title {
    font-family: var(--font-serif);
    font-size: 1.8rem;
    color: white;
    text-decoration: none;
    font-weight: 700;
    letter-spacing: 0.05em;
}

.brand-accent {
    color: var(--accent);
    text-shadow: 0 0 10px rgba(168, 85, 247, 0.5);
}

.nav-link {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.3s;
}

.nav-link:hover {
    color: var(--accent-glow);
}

.nav-link.active {
    color: var(--accent);
    border-bottom: 1px solid var(--accent);
}

/* 主标题区 */
.hero-title {
    font-family: var(--font-serif);
    font-size: 2.5rem;
    background: linear-gradient(to right, #fff, #a855f7);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 1rem;
}

/* 玻璃拟态卡片 */
.glass-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

/* 【新增】结果区域的神秘边框特效 */
.mystic-border {
    border: 1px solid rgba(168, 85, 247, 0.3);
    box-shadow: 0 0 30px rgba(168, 85, 247, 0.1) inset;
    /* 内发光 */
    position: relative;
}

/* 四个角的装饰星号 */
.mystic-border::before {
    content: "✦";
    position: absolute;
    top: 10px;
    left: 10px;
    color: var(--accent);
    opacity: 0.6;
    font-size: 1.2rem;
}

.mystic-border::after {
    content: "✦";
    position: absolute;
    bottom: 10px;
    right: 10px;
    color: var(--accent);
    opacity: 0.6;
    font-size: 1.2rem;
}

/* 输入框 */
textarea {
    width: 100%;
    height: 12rem;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--card-border);
    color: white;
    border-radius: 0.5rem;
    padding: 1rem;
    font-family: var(--font-sans);
    font-size: 1rem;
    outline: none;
    resize: none;
    transition: all 0.3s;
}

textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 15px rgba(168, 85, 247, 0.2);
}

/* 按钮 - 星空按钮 */
.btn-mystic {
    width: 100%;
    padding: 1rem;
    margin-top: 1rem;
    border-radius: 0.5rem;
    border: none;
    background: linear-gradient(45deg, #6b21a8, #a855f7);
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 0 20px rgba(168, 85, 247, 0.4);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1rem;
}

.btn-mystic:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 30px rgba(168, 85, 247, 0.6);
}

.btn-mystic:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* 结果文字 */
.output-area {
    font-family: var(--font-serif);
    line-height: 1.8;
    font-size: 1.1rem;
    color: #e2e8f0;
    white-space: pre-wrap;
    min-height: 100%;
}

/* 装饰性光晕 */
.glow-orb {
    position: absolute;
    width: 300px;
    height: 300px;
    background: var(--accent);
    filter: blur(150px);
    opacity: 0.2;
    z-index: -1;
    border-radius: 50%;
}

/* 布局工具 */
.max-w-5xl {
    max-width: 64rem;
    margin: 0 auto;
}

.px-6 {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
}

.py-8 {
    padding-top: 2rem;
    padding-bottom: 2rem;
}

.py-12 {
    padding-top: 3rem;
    padding-bottom: 3rem;
}

.text-center {
    text-align: center;
}

.mb-12 {
    margin-bottom: 3rem;
}

.flex {
    display: flex;
}

.justify-between {
    justify-content: space-between;
}

.items-center {
    align-items: center;
}

.gap-6 {
    gap: 1.5rem;
}

.w-full {
    width: 100%;
}

.grid {
    display: grid;
}

.hidden {
    display: none;
}

.animate-spin {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

@media (min-width: 768px) {
    .md\:grid-cols-2 {
        grid-template-columns: 1fr 1fr;
    }

    .md\:gap-12 {
        gap: 3rem;
    }

    .md\:block {
        display: block;
    }
}


/* ================= 电脑端布局优化 ================= */

@media (min-width: 768px) {

    /* 让 Grid 顶部对齐，而不是默认的拉伸对齐 */
    .grid {
        align-items: start;
    }

    /* 左侧输入框：变成“粘性”，屏幕滚动时它不动 */
    .glass-card:first-child {
        position: sticky;
        top: 2rem;
        /* 距离顶部 2rem 处吸附 */
    }

    /* 右侧结果框：给个最小高度，防止没内容时太扁 */
    .output-area {
        min-height: 400px;
    }
}

/* 优化列表显示 */
.output-area strong {
    font-weight: 700;
    font-size: 1.1em;
}

/* ================= 按钮加载图标修复 ================= */

/* 给加载图标增加左边距，不再紧贴文字 */
#loader {
    margin-left: 12px;
    /* 增加间距 */
    width: 1.2rem;
    height: 1.2rem;
    min-width: 1.2rem;
    /* 防止被挤压 */
}

/* 确保按钮内容居中 */
.btn-mystic {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0px;
    /* 我们用 margin 控制间距，这里设为0防止冲突 */
}