/* ========== 猜年龄 / Guess Age · Agify ========== */
.ag-hero {
    background: linear-gradient(160deg, #ffffff 0%, #eef2ff 55%, #e0e7ff 100%);
    border: 1px solid #e0e7ff;
    border-radius: 20px;
    padding: 36px 28px;
    margin-bottom: 28px;
    box-shadow: 0 10px 30px rgba(79, 70, 229, 0.08);
}

.ag-head {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 26px;
}

.ag-logo {
    font-size: 40px;
    line-height: 1;
    filter: drop-shadow(0 4px 10px rgba(99, 102, 241, 0.25));
}

.ag-title {
    font-size: 26px;
    font-weight: 700;
    color: #1e1b4b;
    letter-spacing: 0.5px;
}

.ag-sub {
    font-size: 14px;
    color: #6b7280;
    margin-top: 4px;
}

/* ------- 输入区 ------- */
.ag-input-wrap {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 18px 18px 14px;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.03);
}

.ag-label {
    display: block;
    font-size: 13px;
    color: #4b5563;
    margin-bottom: 10px;
    font-weight: 500;
}

.ag-input-row {
    display: flex;
    gap: 10px;
}

.ag-input {
    flex: 1;
    height: 46px;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    padding: 0 14px;
    font-size: 15px;
    color: #111827;
    background: #fafafa;
    transition: all 0.2s ease;
    outline: none;
}

.ag-input:focus {
    border-color: #6366f1;
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.12);
}

.ag-input::placeholder {
    color: #9ca3af;
}

.ag-btn-primary {
    height: 46px;
    padding: 0 22px;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    color: #ffffff;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.2s ease, opacity 0.2s ease;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
    white-space: nowrap;
}

.ag-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(79, 70, 229, 0.4);
}

.ag-btn-primary:active {
    transform: translateY(0);
}

.ag-btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.ag-input-tip {
    font-size: 12px;
    color: #9ca3af;
    margin-top: 10px;
}

/* ------- 状态提示 ------- */
.ag-status {
    min-height: 22px;
    margin-top: 14px;
    font-size: 13px;
    color: #6366f1;
    text-align: center;
    transition: color 0.2s ease;
}

.ag-status.is-error {
    color: #ef4444;
}

.ag-status.is-loading::after {
    content: '';
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(99, 102, 241, 0.25);
    border-top-color: #6366f1;
    border-radius: 50%;
    vertical-align: middle;
    margin-left: 8px;
    animation: agSpin 0.7s linear infinite;
}

@keyframes agSpin {
    to { transform: rotate(360deg); }
}

/* ------- 结果卡片 ------- */
.ag-result {
    margin-top: 22px;
    animation: agFadeIn 0.35s ease;
}

.ag-result-card {
    background: #ffffff;
    border-radius: 18px;
    padding: 32px 24px 26px;
    text-align: center;
    box-shadow: 0 12px 32px rgba(79, 70, 229, 0.12);
    border: 1px solid #e0e7ff;
    position: relative;
    overflow: hidden;
}

.ag-result-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 50% -40%, rgba(165, 180, 252, 0.25) 0%, transparent 60%);
    pointer-events: none;
}

.ag-emoji {
    font-size: 52px;
    line-height: 1;
    margin-bottom: 8px;
    animation: agPop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes agPop {
    0% { transform: scale(0.2); opacity: 0; }
    60% { transform: scale(1.15); opacity: 1; }
    100% { transform: scale(1); opacity: 1; }
}

.ag-res-name {
    display: inline-flex;
    align-items: baseline;
    gap: 6px;
    margin-bottom: 14px;
}

.ag-res-name-label {
    font-size: 12px;
    color: #9ca3af;
}

.ag-res-name-val {
    font-size: 18px;
    font-weight: 600;
    color: #1e1b4b;
}

.ag-res-age-row {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 6px;
    margin-bottom: 14px;
}

.ag-age-num {
    font-size: 88px;
    font-weight: 800;
    line-height: 1;
    background: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-family: 'Inter', 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', sans-serif;
    font-variant-numeric: tabular-nums;
    letter-spacing: -3px;
    transition: color 0.2s;
}

.ag-age-unit {
    font-size: 22px;
    font-weight: 600;
    color: #6b7280;
    margin-bottom: 12px;
}

/* 年龄数字动画：滚动时短暂放大并变色 */
.ag-age-num.animating {
    animation: agNumberPulse 0.45s ease;
}

@keyframes agNumberPulse {
    0% { transform: translateY(12px) scale(0.8); opacity: 0; }
    50% { transform: translateY(-4px) scale(1.12); opacity: 1; }
    100% { transform: translateY(0) scale(1); opacity: 1; }
}

.ag-res-conf {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #eef2ff;
    color: #4338ca;
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 500;
}

.ag-conf-label {
    color: #6366f1;
    font-size: 12px;
}

.ag-conf-val {
    font-size: 16px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.ag-conf-tip {
    color: #818cf8;
    font-size: 11px;
    margin-left: 2px;
}

.ag-res-comment {
    margin-top: 16px;
    font-size: 14px;
    color: #4b5563;
    line-height: 1.6;
    min-height: 22px;
    padding: 0 10px;
}

/* ------- 历史记录 ------- */
.ag-history-wrap {
    margin-top: 22px;
    background: #ffffff;
    border: 1px dashed #c7d2fe;
    border-radius: 14px;
    padding: 14px 18px 16px;
}

.ag-history-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.ag-history-title {
    font-size: 13px;
    font-weight: 600;
    color: #4b5563;
}

.ag-clear-btn {
    font-size: 12px;
    color: #ef4444;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: background 0.2s;
}

.ag-clear-btn:hover {
    background: #fef2f2;
}

.ag-history-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.ag-history-list li {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #f5f3ff;
    color: #3730a3;
    border: 1px solid #e0e7ff;
    padding: 5px 12px;
    border-radius: 999px;
    font-size: 13px;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s, background 0.2s;
    user-select: none;
}

.ag-history-list li:hover {
    background: #ede9fe;
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(99, 102, 241, 0.15);
}

.ag-history-list li .h-name {
    font-weight: 600;
}

.ag-history-list li .h-age {
    color: #6366f1;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.ag-history-list li .h-count {
    color: #a5b4fc;
    font-size: 11px;
}

/* ------- Info 区的 tab 内容 ------- */
.ag-info .faq-list {
    margin: 0;
    padding: 0;
}

.ag-info .faq-list dt {
    font-weight: 600;
    color: #1e1b4b;
    margin-top: 16px;
    font-size: 15px;
}

.ag-info .faq-list dd {
    margin: 6px 0 0;
    padding-left: 14px;
    border-left: 3px solid #a5b4fc;
    color: #4b5563;
    line-height: 1.7;
    font-size: 14px;
}

@keyframes agFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ------- 响应式 ------- */
@media (max-width: 560px) {
    .ag-hero {
        padding: 24px 16px;
    }
    .ag-title {
        font-size: 22px;
    }
    .ag-input-row {
        flex-direction: column;
    }
    .ag-btn-primary {
        width: 100%;
    }
    .ag-age-num {
        font-size: 64px;
        letter-spacing: -2px;
    }
    .ag-result-card {
        padding: 24px 16px 20px;
    }
}
