/* /assets/styles.css — AX 下載中心 · 科技感控制台 */

:root {
    --ax-bg-deep: #020617;
    --ax-bg-mid: #0f172a;
    --ax-surface: rgba(15, 23, 42, 0.72);
    --ax-surface-hover: rgba(15, 23, 42, 0.88);
    --ax-border: rgba(148, 163, 184, 0.18);
    --ax-border-strong: rgba(56, 189, 248, 0.35);
    --ax-text: #e2e8f0;
    --ax-text-muted: #94a3b8;
    --ax-accent: #38bdf8;
    --ax-accent-deep: #0ea5e9;
    --ax-glow: rgba(56, 189, 248, 0.45);
    --ax-glow-soft: rgba(56, 189, 248, 0.12);
    --ax-purple-tint: rgba(139, 92, 246, 0.08);
    --ax-green: #10b981;
    --ax-green-glow: rgba(16, 185, 129, 0.35);
    --ax-yellow: #f59e0b;
    --ax-yellow-glow: rgba(245, 158, 11, 0.35);
    --ax-radius-sm: 10px;
    --ax-radius-md: 14px;
    --ax-radius-lg: 18px;
    --ax-font-title: clamp(1.2rem, 3.4vw, 1.5rem);
    --ax-font-label: 0.7rem;
    --ax-font-meta: 0.92rem;
    --ax-transition: 0.28s ease;
    --page-pad: clamp(12px, 4vw, 20px);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.page-fx {
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    overflow: hidden;
    background:
        radial-gradient(ellipse 90% 55% at 85% 8%, rgba(139, 92, 246, 0.08), transparent 52%),
        radial-gradient(ellipse 120% 80% at 50% -20%, rgba(56, 189, 248, 0.09), transparent 50%),
        linear-gradient(145deg, var(--ax-bg-deep) 0%, var(--ax-bg-mid) 55%, #0c1222 100%);
}

.page-fx::before {
    content: "";
    position: absolute;
    inset: 0;
    opacity: 0.42;
    background-image:
        linear-gradient(rgba(148, 163, 184, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(148, 163, 184, 0.04) 1px, transparent 1px);
    background-size: 44px 44px;
}

.page-fx::after {
    content: "";
    position: absolute;
    inset: 0;
    opacity: 0.12;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0, 0, 0, 0.14) 2px,
        rgba(0, 0, 0, 0.14) 3px
    );
    mix-blend-mode: multiply;
}

body.page {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, "Microsoft JhengHei", "微軟正黑體", sans-serif;
    color: var(--ax-text);
    min-height: 100vh;
    line-height: 1.6;
    padding:
        calc(12px + env(safe-area-inset-top, 0px))
        calc(var(--page-pad) + env(safe-area-inset-right, 0px))
        calc(16px + env(safe-area-inset-bottom, 0px))
        calc(var(--page-pad) + env(safe-area-inset-left, 0px));
    overflow-x: clip;
    -webkit-tap-highlight-color: rgba(56, 189, 248, 0.18);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--page-pad);
    width: 100%;
}

/* ===== Hero ===== */
.hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(260px, 340px);
    gap: clamp(20px, 3vw, 32px);
    align-items: start;
    margin-bottom: clamp(20px, 4vw, 36px);
    padding-top: 4px;
}

.hero-main {
    text-align: left;
    min-width: 0;
}

.hero-eyebrow {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--ax-accent);
    margin-bottom: 10px;
    opacity: 0.95;
}

.hero-actions {
    margin-top: 18px;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.agent-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: linear-gradient(135deg, var(--ax-accent) 0%, var(--ax-accent-deep) 100%);
    color: #ffffff;
    text-decoration: none;
    border-radius: var(--ax-radius-sm);
    font-weight: 600;
    font-size: 0.95rem;
    transition: box-shadow var(--ax-transition), transform var(--ax-transition);
    box-shadow: 0 4px 14px var(--ax-glow-soft);
    border: 1px solid rgba(56, 189, 248, 0.25);
}

.agent-btn:hover {
    box-shadow: 0 6px 22px var(--ax-glow);
    transform: translateY(-2px);
}

.agent-btn:focus-visible {
    outline: 2px solid var(--ax-accent);
    outline-offset: 3px;
}

.agent-icon {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    fill: none;
}

.hero h1 {
    font-size: clamp(1.45rem, 4.2vw, 2.35rem);
    font-weight: 700;
    color: #f1f5f9;
    text-shadow: 0 2px 24px rgba(0, 0, 0, 0.35);
    letter-spacing: 0.5px;
    margin-bottom: 12px;
    line-height: 1.25;
}

.header-description {
    color: var(--ax-text-muted);
    font-size: 0.9rem;
    line-height: 1.65;
    margin-bottom: 0;
    max-width: 42rem;
}

.header-description a {
    color: var(--ax-accent);
    text-decoration: none;
    transition: color 0.2s ease;
}

.header-description a:hover {
    color: #7dd3fc;
    text-decoration: underline;
}

.hero-side {
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-width: 0;
}

.hero-panel {
    padding: 16px 18px;
    background: var(--ax-surface);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: var(--ax-radius-md);
    border: 1px solid var(--ax-border);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.04),
        0 8px 28px rgba(0, 0, 0, 0.22);
}

.hero-panel-label {
    font-size: var(--ax-font-label);
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--ax-text-muted);
    margin-bottom: 12px;
}

.portal-signals {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.signal-chip {
    padding: 12px 12px;
    border-radius: var(--ax-radius-sm);
    background: rgba(2, 6, 23, 0.45);
    border: 1px solid rgba(148, 163, 184, 0.14);
    display: flex;
    flex-direction: column;
    gap: 2px;
    align-items: flex-start;
}

.signal-value {
    font-size: 1.05rem;
    font-weight: 750;
    color: #f8fafc;
    letter-spacing: 0.04em;
}

.signal-hint {
    font-size: 0.72rem;
    color: var(--ax-text-muted);
    letter-spacing: 0.06em;
}

/* ===== 狀態說明區塊 ===== */
.status-legend {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    align-items: center;
    gap: 12px 16px;
    margin-bottom: 0;
    padding: 0;
    background: transparent;
    border: none;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

.status-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #cbd5e1;
    font-size: 0.9rem;
}

.status-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    display: inline-block;
}

.status-green-icon {
    filter: drop-shadow(0 0 4px var(--ax-green-glow));
}

.status-yellow-icon {
    filter: drop-shadow(0 0 4px var(--ax-yellow-glow));
}

.status-note {
    width: 100%;
    text-align: left;
    color: var(--ax-text-muted);
    font-size: 0.82rem;
    margin-top: 4px;
    font-style: italic;
}

.hero-panel .status-note {
    text-align: left;
}

@media (max-width: 900px) {
    .hero {
        grid-template-columns: 1fr;
    }

    .hero-main {
        text-align: center;
    }

    .header-description {
        margin-left: auto;
        margin-right: auto;
    }

    .hero-actions {
        justify-content: center;
    }

    .hero-side {
        max-width: 520px;
        margin-left: auto;
        margin-right: auto;
        width: 100%;
    }
}

@media (max-width: 768px) {
    .agent-btn {
        padding: 12px 18px;
        font-size: 0.92rem;
        min-height: 44px;
    }

    .agent-icon {
        width: 20px;
        height: 20px;
    }

    .header-description {
        font-size: 0.86rem;
        padding: 0 2px;
    }

    .portal-signals {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* ===== 主內容區 ===== */
.main-area {
    min-width: 0;
}


/* ===== 頁尾資訊卡 ===== */
.site-footer {
    margin-top: clamp(28px, 5vw, 48px);
    padding-bottom: env(safe-area-inset-bottom, 0px);
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.footer-card {
    padding: 18px 18px;
    border-radius: var(--ax-radius-md);
    background: rgba(15, 23, 42, 0.55);
    border: 1px solid var(--ax-border);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.footer-card-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #f1f5f9;
    margin-bottom: 8px;
    letter-spacing: 0.02em;
}

.footer-card-text {
    font-size: 0.86rem;
    color: var(--ax-text-muted);
    line-height: 1.55;
}

@media (max-width: 900px) {
    .footer-grid {
        grid-template-columns: 1fr;
    }
}

/* ===== 軟體列表區塊（mobile-first）===== */
.app-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: clamp(14px, 3.5vw, 20px);
    margin-bottom: clamp(28px, 6vw, 40px);
    align-items: stretch;
    scroll-margin-top: 0;
}

@media (min-width: 769px) and (max-width: 1024px) {
    .app-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 20px;
    }
}

@media (min-width: 1025px) {
    .app-list {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 22px;
    }
}

/* ===== 軟體卡片 ===== */
.app-card {
    position: relative;
    overflow: hidden;
    background:
        linear-gradient(165deg, rgba(30, 41, 59, 0.58) 0%, rgba(15, 23, 42, 0.88) 100%),
        var(--ax-purple-tint);
    border: 1px solid var(--ax-border);
    border-radius: var(--ax-radius-lg);
    padding: clamp(15px, 3.8vw, 22px);
    display: flex;
    flex-direction: column;
    gap: clamp(12px, 2.8vw, 16px);
    box-shadow:
        0 4px 24px rgba(0, 0, 0, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    transition:
        transform var(--ax-transition),
        box-shadow var(--ax-transition),
        border-color var(--ax-transition);
    animation: cardEnter 0.55s ease both;
    -webkit-tap-highlight-color: transparent;
}

.app-card:nth-child(1) { animation-delay: 0.02s; }
.app-card:nth-child(2) { animation-delay: 0.06s; }
.app-card:nth-child(3) { animation-delay: 0.1s; }
.app-card:nth-child(4) { animation-delay: 0.14s; }
.app-card:nth-child(5) { animation-delay: 0.18s; }
.app-card:nth-child(6) { animation-delay: 0.22s; }
.app-card:nth-child(n+7) { animation-delay: 0.24s; }

@keyframes cardEnter {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (prefers-reduced-motion: reduce) {
    .app-card {
        animation: none;
    }
}

.app-card-glow {
    position: absolute;
    inset: -32%;
    background: radial-gradient(circle at 30% 20%, var(--ax-glow-soft), transparent 45%);
    pointer-events: none;
    opacity: 0.55;
    transition: opacity var(--ax-transition);
}

@media (min-width: 768px) {
    .app-card-glow {
        inset: -40%;
        opacity: 0.9;
    }
}

@media (hover: hover) and (pointer: fine) {
    .app-card:hover {
        transform: translateY(-3px);
        border-color: rgba(56, 189, 248, 0.28);
        box-shadow:
            0 12px 40px rgba(0, 0, 0, 0.45),
            0 0 0 1px rgba(56, 189, 248, 0.12),
            0 0 32px -12px var(--ax-glow);
    }

    .app-card:hover .app-card-glow {
        opacity: 1.12;
    }

    .app-card:hover .app-icon-wrap {
        transform: translateY(-2px);
        box-shadow: 0 8px 22px rgba(0, 0, 0, 0.4), 0 0 20px -6px var(--ax-glow-soft);
    }
}

.app-card--status-green .app-card-glow {
    background: radial-gradient(circle at 25% 15%, rgba(16, 185, 129, 0.12), transparent 50%);
}

.app-card--status-yellow .app-card-glow {
    background: radial-gradient(circle at 25% 15%, rgba(245, 158, 11, 0.12), transparent 50%);
}

.app-card-top {
    position: relative;
    z-index: 1;
    display: flex;
    gap: clamp(12px, 3vw, 16px);
    align-items: center;
    margin-bottom: 0;
}

.app-icon-wrap {
    flex-shrink: 0;
    width: 60px;
    height: 60px;
    border-radius: var(--ax-radius-sm);
    padding: 2px;
    background: linear-gradient(145deg, rgba(56, 189, 248, 0.25), rgba(139, 92, 246, 0.15));
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
    transition: transform var(--ax-transition), box-shadow var(--ax-transition);
}

@media (min-width: 768px) {
    .app-icon-wrap {
        width: 80px;
        height: 80px;
    }
}

.app-icon {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: calc(var(--ax-radius-sm) - 2px);
    object-fit: cover;
    background: rgba(15, 23, 42, 0.6);
}

.app-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.app-title-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px 10px;
    align-items: center;
}

.app-title-row .app-name {
    margin: 0;
    min-width: 0;
}

.app-title-row .app-status-badge {
    justify-self: end;
    max-width: 100%;
}

.app-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 11px 5px 8px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    border: 1px solid transparent;
}

@media (min-width: 768px) {
    .app-status-badge {
        font-size: 0.75rem;
        padding: 4px 12px 4px 8px;
    }
}

.app-status-badge .badge-status-icon {
    flex-shrink: 0;
}

.app-status-badge--green {
    color: #a7f3d0;
    background: rgba(16, 185, 129, 0.12);
    border-color: rgba(16, 185, 129, 0.35);
    box-shadow: 0 0 16px -4px var(--ax-green-glow);
}

.app-status-badge--yellow {
    color: #fde68a;
    background: rgba(245, 158, 11, 0.12);
    border-color: rgba(245, 158, 11, 0.35);
    box-shadow: 0 0 16px -4px var(--ax-yellow-glow);
}

.app-name {
    font-size: var(--ax-font-title);
    font-weight: 700;
    color: #f8fafc;
    line-height: 1.3;
    text-align: left;
    word-break: break-word;
    overflow-wrap: anywhere;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

@media (min-width: 768px) {
    .app-name {
        -webkit-line-clamp: 3;
    }
}

.app-meta-grid {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    margin-bottom: 0;
}

@media (min-width: 480px) {
    .app-meta-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }
}

.app-meta-desc {
    padding: 10px 12px;
    border-radius: var(--ax-radius-sm);
    background: rgba(2, 6, 23, 0.42);
    border: 1px solid rgba(148, 163, 184, 0.1);
    color: var(--ax-text-muted);
    font-size: clamp(0.86rem, 2.5vw, 0.92rem);
    line-height: 1.55;
    min-width: 0;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.app-meta-desc--empty {
    display: none;
}

.meta-block {
    padding: 10px 12px;
    border-radius: var(--ax-radius-sm);
    background: rgba(2, 6, 23, 0.5);
    border: 1px solid rgba(148, 163, 184, 0.12);
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 0;
}

.meta-label {
    font-size: max(11px, var(--ax-font-label));
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--ax-text-muted);
}

.meta-value {
    font-size: var(--ax-font-meta);
    font-weight: 600;
    color: #e2e8f0;
    word-break: break-word;
    line-height: 1.35;
}

.app-card-actions {
    position: relative;
    z-index: 1;
    margin-top: 0;
    padding-top: 2px;
}

.download-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    text-align: center;
    padding: 15px 20px;
    min-height: 50px;
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.95) 0%, rgba(14, 165, 233, 0.98) 55%, rgba(59, 130, 246, 0.95) 100%);
    color: #f0f9ff;
    text-decoration: none;
    border-radius: var(--ax-radius-md);
    font-weight: 650;
    font-size: clamp(0.95rem, 2.6vw, 1rem);
    transition:
        box-shadow var(--ax-transition),
        transform var(--ax-transition),
        filter var(--ax-transition);
    border: 1px solid rgba(125, 211, 252, 0.35);
    box-shadow:
        0 4px 18px rgba(14, 165, 233, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
    touch-action: manipulation;
    -webkit-tap-highlight-color: rgba(56, 189, 248, 0.2);
}

.download-btn-icon {
    flex-shrink: 0;
    opacity: 0.95;
}

@media (hover: hover) and (pointer: fine) {
    .download-btn:hover {
        box-shadow:
            0 8px 28px rgba(14, 165, 233, 0.5),
            0 0 24px -4px var(--ax-glow);
        transform: translateY(-2px);
        filter: brightness(1.03);
    }
}

.download-btn:active {
    transform: translateY(1px);
    box-shadow: 0 2px 10px rgba(14, 165, 233, 0.35);
    filter: brightness(0.98);
}

/* ===== State panels（empty / error）===== */
.state-panel {
    grid-column: 1 / -1;
    max-width: 480px;
    margin: clamp(16px, 4vw, 24px) auto;
    padding: clamp(22px, 5vw, 36px) clamp(18px, 4vw, 32px);
    text-align: center;
    background: var(--ax-surface);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-radius: var(--ax-radius-lg);
    border: 1px solid var(--ax-border);
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.state-panel-icon {
    margin-bottom: 16px;
    color: var(--ax-accent);
    display: flex;
    justify-content: center;
    opacity: 0.85;
}

.state-panel--error .state-panel-icon {
    color: #f87171;
}

.state-panel-title {
    font-size: clamp(1.05rem, 3vw, 1.25rem);
    font-weight: 700;
    color: #f1f5f9;
    margin-bottom: 10px;
    letter-spacing: 0.02em;
}

.state-panel-desc {
    font-size: 0.95rem;
    color: var(--ax-text-muted);
    line-height: 1.65;
    white-space: pre-line;
}

.state-panel--empty .state-panel-title {
    color: #e2e8f0;
}

.state-panel--error .state-panel-title {
    color: #fecaca;
}

/* ===== Skeleton loading ===== */
.skeleton-card {
    position: relative;
    overflow: hidden;
    border-radius: var(--ax-radius-lg);
    border: 1px solid var(--ax-border);
    background: linear-gradient(165deg, rgba(30, 41, 59, 0.4) 0%, rgba(15, 23, 42, 0.75) 100%);
    padding: clamp(15px, 3.8vw, 22px);
    min-height: 260px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.skeleton-card-inner {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.skeleton-top {
    display: flex;
    gap: clamp(12px, 3vw, 16px);
}

.skeleton-icon {
    width: 60px;
    height: 60px;
    border-radius: var(--ax-radius-sm);
    flex-shrink: 0;
    background: linear-gradient(90deg, rgba(51, 65, 85, 0.5) 25%, rgba(71, 85, 105, 0.55) 50%, rgba(51, 65, 85, 0.5) 75%);
    background-size: 200% 100%;
    animation: skeletonShimmer 1.35s ease-in-out infinite;
}

@media (min-width: 768px) {
    .skeleton-icon {
        width: 80px;
        height: 80px;
    }
}

.skeleton-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
}

.skeleton-line {
    height: 12px;
    border-radius: 6px;
    background: linear-gradient(90deg, rgba(51, 65, 85, 0.45) 25%, rgba(71, 85, 105, 0.5) 50%, rgba(51, 65, 85, 0.45) 75%);
    background-size: 200% 100%;
    animation: skeletonShimmer 1.35s ease-in-out infinite;
}

.skeleton-line--short {
    width: 40%;
    height: 10px;
}

.skeleton-line--title {
    width: 75%;
    height: 18px;
}

.skeleton-line--long {
    width: 100%;
    height: 10px;
}

.skeleton-meta {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}

@media (min-width: 480px) {
    .skeleton-meta {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }
}

.skeleton-line--block {
    height: 48px;
    width: 100%;
}

.skeleton-line--btn {
    height: 50px;
    width: 100%;
    margin-top: 2px;
}

@keyframes skeletonShimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

@media (prefers-reduced-motion: reduce) {
    .skeleton-icon,
    .skeleton-line {
        animation: none;
        background: rgba(51, 65, 85, 0.4);
    }
}
