/* ===== 小红书爆文改写工具 - 自定义样式 ===== */

/* ---------- CSS 变量 ---------- */
:root {
    --xhs-red: #FF2442;
    --xhs-red-dark: #E01F3D;
    --xhs-pink: #FF6B81;
    --xhs-gradient: linear-gradient(135deg, #FF2442, #FF6B81);
    --xhs-gradient-hover: linear-gradient(135deg, #E01F3D, #FF5A70);
    --bg-light: #F5F7FA;
    --bg-white: #FFFFFF;
    --text-primary: #333333;
    --text-secondary: #666666;
    --text-muted: #999999;
    --border-light: rgba(0, 0, 0, 0.06);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.12);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.18);
    --shadow-hover: 0 12px 40px rgba(0, 0, 0, 0.22);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --success-green: #52C41A;
}

/* ---------- 全局样式 ---------- */
* {
*     margin: 0;
*         padding: 0;
*             box-sizing: border-box;
*             }
*
*             body {
*                 font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC',
*                         'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
*                             background-color: var(--bg-light);
*                                 color: var(--text-primary);
*                                     min-height: 100vh;
*                                         display: flex;
*                                             flex-direction: column;
*                                             }
*
*                                             main {
*                                                 flex: 1;
*                                                 }
*
*/* ---------- 导航栏 ---------- */
.navbar-custom {
    background: var(--bg-white);
    box-shadow: var(--shadow-sm);
    padding: 12px 0;
    border-bottom: 1px solid var(--border-light);
}

.navbar-custom .navbar-brand {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--xhs-red);
    transition: all 0.3s ease;
}

.navbar-custom .navbar-brand:hover {
    color: var(--xhs-red-dark);
    transform: scale(1.02);
}

.navbar-custom .navbar-brand i {
    font-size: 1.6rem;
}

.navbar-custom .nav-link {
    color: var(--text-secondary);
    font-weight: 500;
    padding: 8px 16px;
    border-radius: var(--radius-md);
    transition: all 0.3s ease;
}

.navbar-custom .nav-link:hover,
.navbar-custom .nav-link.active {
    color: var(--xhs-red);
    background: rgba(255, 36, 66, 0.08);
}

/* ---------- 页脚 ---------- */
.footer-custom {
    background: var(--bg-white);
    padding: 20px 0;
    border-top: 1px solid var(--border-light);
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: 60px;
}

/* ---------- Hero 区域 ---------- */
.hero-section {
    padding: 60px 0 40px;
    background: linear-gradient(180deg, rgba(255, 36, 66, 0.03), transparent);
}

.hero-title {
    font-size: 2.5rem;
    font-weight: 800;
    background: var(--xhs-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 12px;
    animation: fadeInUp 0.6s ease;
}

.hero-subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 32px;
    animation: fadeInUp 0.6s ease 0.1s both;
}

/* ---------- 解析卡片 ---------- */
.parse-card {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: 32px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-light);
    animation: fadeInUp 0.6s ease 0.2s both;
}

.parse-card .input-group {
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.parse-card .input-group-text {
    background: var(--bg-white);
    border: 2px solid #e0e0e0;
    border-right: none;
    color: var(--xhs-red);
    font-size: 1.2rem;
    padding: 12px 16px;
}

.parse-card .form-control {
    border: 2px solid #e0e0e0;
    border-left: none;
    border-right: none;
    padding: 12px 16px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.parse-card .form-control:focus {
    box-shadow: none;
    border-color: var(--xhs-red);
}

.parse-card .input-group-text,
.parse-card .form-control {
    border-top: 2px solid #e0e0e0;
    border-bottom: 2px solid #e0e0e0;
}

.parse-card .form-control:focus,
.parse-card .form-control:focus+.btn-parse,
.parse-card .input-group:focus-within .input-group-text,
.parse-card .input-group:focus-within .form-control {
    border-color: var(--xhs-red);
}

/* ---------- 按钮样式 ---------- */
.btn-primary-custom {
    background: var(--xhs-gradient);
    border: none;
    color: white;
    font-weight: 600;
    padding: 12px 28px;
    border-radius: var(--radius-md);
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(255, 36, 66, 0.3);
}

.btn-primary-custom:hover {
    background: var(--xhs-gradient-hover);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 36, 66, 0.4);
}

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

.btn-primary-custom:disabled {
    opacity: 0.6;
    transform: none;
    box-shadow: none;
}

.btn-parse {
    border-radius: 0 var(--radius-md) var(--radius-md) 0 !important;
    padding: 12px 24px;
    white-space: nowrap;
}

.btn-success-custom {
    background: linear-gradient(135deg, #52C41A, #73D13D);
    border: none;
    color: white;
    font-weight: 600;
    padding: 12px 28px;
    border-radius: var(--radius-md);
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(82, 196, 26, 0.3);
}

.btn-success-custom:hover {
    background: linear-gradient(135deg, #49B10F, #65C42E);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(82, 196, 26, 0.4);
}

/* ---------- 加载动画 ---------- */
.loading-container {
    text-align: center;
    padding: 20px 0;
}

.loading-text {
    color: var(--text-secondary);
    margin-top: 12px;
    animation: pulse 1.5s ease-in-out infinite;
}

/* ---------- 功能特点卡片 ---------- */
.features-section {
    padding: 40px 0;
}

.feature-card {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: 32px 24px;
    text-align: center;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-light);
    transition: all 0.3s ease;
    height: 100%;
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}

.feature-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(255, 36, 66, 0.1), rgba(255, 107, 129, 0.1));
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    font-size: 1.8rem;
    color: var(--xhs-red);
}

.feature-card h3 {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.feature-card p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 0;
    line-height: 1.6;
}

/* ---------- 历史记录 ---------- */
.history-section {
    padding: 20px 0 40px;
}

.section-title {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--text-primary);
}

.section-title i {
    color: var(--xhs-red);
}

.history-card-link {
    text-decoration: none;
    color: inherit;
}

.history-card {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-light);
    transition: all 0.3s ease;
}

.history-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}

.history-cover {
    height: 160px;
    overflow: hidden;
}

.history-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.history-card:hover .history-cover img {
    transform: scale(1.05);
}

.history-info {
    padding: 16px;
}

.history-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
    line-height: 1.4;
}

.history-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.85rem;
}

.badge-type {
    background: linear-gradient(135deg, rgba(255, 36, 66, 0.1), rgba(255, 107, 129, 0.1));
    color: var(--xhs-red);
    font-weight: 500;
    padding: 4px 10px;
    border-radius: var(--radius-xl);
}

/* ---------- 详情页 ---------- */
.detail-section {
    padding: 30px 0 80px;
}

.detail-header {
    margin-bottom: 20px;
}

.note-meta {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* ---------- 操作栏 ---------- */
.action-bar {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: 20px 24px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-light);
    margin-bottom: 20px;
}

.action-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin: 0;
}

.btn-rewrite {
    font-size: 1rem;
}

.progress-container .progress {
    height: 8px;
    border-radius: var(--radius-sm);
    overflow: hidden;
}

/* ---------- Tab 样式 ---------- */
.tab-custom {
    border: none;
    background: var(--bg-white);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.tab-custom .nav-link {
    border: none;
    color: var(--text-secondary);
    padding: 14px 24px;
    font-weight: 600;
    transition: all 0.3s ease;
    border-radius: 0;
}

.tab-custom .nav-link.active {
    color: var(--xhs-red);
    background: rgba(255, 36, 66, 0.06);
    border-bottom: 3px solid var(--xhs-red);
}

.tab-custom .nav-item {
    flex: 1;
    text-align: center;
}

/* ---------- 内容卡片 ---------- */
.content-card {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-light);
    overflow: hidden;
    animation: fadeInUp 0.5s ease;
}

.content-card-header {
    padding: 16px 20px;
    background: linear-gradient(135deg, #f8f9fa, #fff);
    border-bottom: 1px solid var(--border-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.content-card-header h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0;
    color: var(--text-primary);
}

.content-card-header h3 i {
    color: var(--xhs-red);
}

.rewritten-header {
    background: var(--xhs-gradient);
}

.rewritten-header h3 {
    color: white;
}

.rewritten-header h3 i {
    color: white;
}

.content-card-body {
    padding: 20px;
}

/* ---------- 内容区块 ---------- */
.content-section {
    margin-bottom: 24px;
}

.content-section:last-child {
    margin-bottom: 0;
}

.content-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.content-text {
    background: #f8f9fa;
    border-radius: var(--radius-md);
    padding: 16px;
    line-height: 1.8;
    color: var(--text-primary);
    border: 1px solid var(--border-light);
}

.title-text {
    font-size: 1.15rem;
    font-weight: 600;
}

.rewritten-text {
    background: linear-gradient(135deg, rgba(255, 36, 66, 0.03), rgba(255, 107, 129, 0.03));
    border-color: rgba(255, 36, 66, 0.1);
}

/* ---------- 图片展示 ---------- */
.image-container {
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.content-image {
    width: 100%;
    height: auto;
    display: block;
    border-radius: var(--radius-md);
    transition: transform 0.3s ease;
}

.content-image:hover {
    transform: scale(1.02);
}

.image-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
}

.gallery-item {
    position: relative;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    aspect-ratio: 1;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.gallery-item:hover img {
    transform: scale(1.08);
}

.gallery-index {
    position: absolute;
    top: 8px;
    left: 8px;
    width: 24px;
    height: 24px;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
}

/* ---------- 空状态 ---------- */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 3rem;
    display: block;
    margin-bottom: 12px;
}

.empty-state p {
    font-size: 1rem;
}

/* ---------- 复制按钮 ---------- */
.copy-btn {
    font-size: 0.85rem;
    padding: 6px 14px;
    border-radius: var(--radius-md);
}

/* ---------- Mobile 底部操作栏 ---------- */
.mobile-action-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-white);
    padding: 12px 16px;
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.1);
    display: flex;
    z-index: 1000;
    border-top: 1px solid var(--border-light);
}

.mobile-action-bar .btn {
    min-height: 48px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: var(--radius-md);
}

/* ---------- 动画 ---------- */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ---------- 响应式 ---------- */

/* 平板 */
@media (max-width: 991px) {
    .hero-title {
        font-size: 2rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .parse-card {
        padding: 24px;
    }
}

/* 手机 */
@media (max-width: 767px) {
    .hero-section {
        padding: 30px 0 20px;
    }

    .hero-title {
        font-size: 1.6rem;
    }

    .hero-subtitle {
        font-size: 0.9rem;
        margin-bottom: 20px;
    }

    .parse-card {
        padding: 16px;
    }

    .parse-card .input-group {
        flex-direction: column !important;
        flex-wrap: wrap !important;
    }

    .parse-card .input-group-text {
        display: none !important;
    }

    .parse-card .input-group .form-control {
        border: 2px solid #e0e0e0 !important;
        border-radius: var(--radius-md) !important;
        margin-bottom: 12px;
        padding: 16px 16px !important;
        font-size: 1rem !important;
        min-height: 54px !important;
        height: auto !important;
        width: 100% !important;
        flex: none !important;
    }

    .parse-card .form-control::placeholder {
        font-size: 0.85rem;
    }

    .parse-card .btn-parse,
    .parse-card .input-group .btn {
        border-radius: var(--radius-md) !important;
        width: 100% !important;
        flex: none !important;
        padding: 14px !important;
        font-size: 1.05rem;
        min-height: 50px;
    }

    .feature-card {
        padding: 24px 20px;
    }

    .image-gallery {
        grid-template-columns: repeat(2, 1fr);
    }

    .detail-section {
        padding: 20px 0 100px;
    }

    .action-bar {
        padding: 16px;
    }

    .action-bar .btn {
        width: 100%;
        margin-top: 8px;
    }

    /* 图片处理模式 - 手机端竖排 */
    .action-bar .d-flex.align-items-center.flex-wrap {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 8px !important;
    }

    .action-bar .form-check-inline {
        margin-right: 0 !important;
        margin-left: 0 !important;
        padding: 6px 0;
        width: 100%;
    }

    .action-bar .form-check-label {
        font-size: 0.95rem;
    }

    .content-card-body {
        padding: 16px;
    }

    /* Mobile 下 tab 内容显示为正常流 */
    #originalContent,
    #rewrittenContent {
        opacity: 1 !important;
    }

    .content-text {
        padding: 12px;
        font-size: 0.95rem;
    }

    .title-text {
        font-size: 1.05rem;
    }
}

/* 超小屏 */
@media (max-width: 400px) {
    .hero-title {
        font-size: 1.3rem;
    }

    .image-gallery {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
}
