/* TurnItMan 页面样式 - EasyEssay 复刻版 (Optimized) */
:root {
    --primary-blue: #135BFF;
    --primary-blue-hover: #0A4ECC;
    --primary-red: #FF5E5E;
    --bg-color: #F7F9FC;
    --card-bg: #FFFFFF;
    --text-primary: #333333;
    --text-secondary: #888888;
    --border-radius: 20px;
    --card-shadow: 0 8px 24px rgba(0,0,0,0.04);
    --hover-scale: 1.05;
}

body {
    background-color: var(--bg-color);
    margin: 0;
    font-family: "PingFang SC", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: var(--text-primary);
    overflow-x: hidden;
}

/* 容器 */
.turnitman-container {
    max-width: 1600px;
    margin: 10px auto 50px; /* 底部留 50px */
    padding: 20px 40px;
    display: flex;
    gap: 24px;
    /* 100vh - header(60) - top(10) - bottom(50) */
    height: calc(100vh - 120px);
    box-sizing: border-box;
}

/* 面板通用 */
.panel {
    flex: 1;
    background: var(--card-bg);
    border-radius: var(--border-radius);
    display: flex;
    flex-direction: column;
    padding: 30px;
    box-shadow: var(--card-shadow);
    position: relative;
    border: 1px solid rgba(0,0,0,0.02);
    transition: transform 0.3s ease;
}

.input-panel { background: var(--card-bg); }
.output-panel { background: #FFFBF8; }

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    height: 30px;
}

.panel-tag {
    background: #EAECEF;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 14px;
    color: #555;
    font-weight: 600;
}
.panel-tag.result-tag { background: #FFECD9; color: #FF7D00; }

/* 复制按钮 */
.btn-copy {
    background: transparent;
    border: 1px solid #E0E0E0;
    color: #666;
    border-radius: 15px;
    padding: 4px 12px;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
}
.btn-copy:hover {
    background: #F5F5F5;
    color: #333;
    border-color: #CCC;
}
.btn-copy svg { width: 14px; height: 14px; }

/* 文本区域与结果区域样式统一 */
textarea {
    width: 100%;
    height: 100%;
    border: none;
    resize: none;
    font-size: 16px;
    line-height: 1.8;
    font-family: inherit;
    color: #333;
    outline: none;
    background: transparent;
    padding: 10px 0;
    box-sizing: border-box;
}
textarea::placeholder { color: #C0C4CC; font-size: 24px; font-weight: 500; }

.textarea-wrapper {
    flex: 1;
    position: relative;
    display: flex;
    flex-direction: column;
}

.empty-state-actions {
    position: absolute;
    top: 45%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    gap: 30px;
    z-index: 10;
}
.textarea-wrapper.has-content .empty-state-actions { display: none; }

.action-card {
    width: 180px;
    height: 120px;
    background: white;
    border: 1px solid #EBEBEB;
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 15px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: 0 4px 16px rgba(0,0,0,0.04);
}
.action-card:hover {
    transform: scale(1.05);
    border-color: var(--primary-red);
    box-shadow: 0 8px 24px rgba(255, 94, 94, 0.15);
}
.action-card-icon svg { width: 32px; height: 32px; color: var(--primary-red); }
.action-card span { font-size: 15px; color: #333; font-weight: 500; }

/* ======== 底部工具栏 ======== */
.bottom-toolbar {
    margin-top: auto;
    padding-top: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.btn-ai-check {
    background: var(--primary-blue);
    color: white;
    border: none;
    height: 48px;
    padding: 0 28px;
    border-radius: 24px;
    cursor: pointer;
    font-weight: 700;
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.2s;
    box-shadow: 0 4px 12px rgba(19, 91, 255, 0.2);
}
.btn-ai-check:hover {
    transform: scale(1.05);
    background: var(--primary-blue-hover);
}

.control-capsule {
    display: flex;
    align-items: center;
    background: white;
    border: 1px solid #EAEAEA;
    border-radius: 30px;
    padding: 4px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.02);
}

.model-selector-group {
    display: flex;
    align-items: center;
    padding-left: 6px;
    padding-right: 15px;
    gap: 12px;
    position: relative;
    cursor: pointer;
}

.model-icon-gradient {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #FF3D8F, #FF9E4D);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 2px 6px rgba(255, 61, 143, 0.2);
}

.model-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.model-name-row {
    display: flex;
    align-items: center;
    gap: 6px;
}

.model-name { font-size: 15px; font-weight: 700; color: #333; }
.word-count { font-size: 12px; color: #999; margin-top: 2px; }

.overlay-select {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    opacity: 0;
    cursor: pointer;
}

.btn-humanize-capsule {
    background: linear-gradient(90deg, #FF6B6B 0%, #FF8E53 100%);
    color: white;
    border: none;
    height: 48px;
    padding: 0 24px;
    border-radius: 24px;
    font-weight: 700;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    transition: transform 0.2s;
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.3);
}
.btn-humanize-capsule:hover { transform: scale(1.05); }
.btn-humanize-capsule:active { transform: scale(0.98); }

/* ======== 结果区域 ======== */
.result-content {
    flex: 1;
    overflow-y: auto;
    font-size: 16px;
    line-height: 1.8;
    font-family: inherit;
    color: #333;
    padding: 10px 0;
    white-space: pre-wrap; /* 关键：保留换行和空格 */
    word-break: break-word;
    text-align: left; /* 明确左对齐 */
}

/* Marketing Banner */
.marketing-banner {
    background: #FFE9BB;
    border-radius: 20px;
    padding: 24px 30px;
    color: #59441B;
    display: flex;
    flex-direction: column;
    justify-content: center;
    margin-top: 30px;
    position: relative;
    overflow: hidden;
    min-height: 120px;
    box-shadow: none;
    transition: transform 0.2s;
}
.marketing-banner:hover { transform: scale(1.01); }

.banner-tag {
    display: inline-block;
    border: 1px solid rgba(89, 68, 27, 0.2);
    border-radius: 20px;
    padding: 4px 12px;
    font-size: 12px;
    margin-bottom: 12px;
    width: fit-content;
    font-weight: 600;
}

.banner-title {
    font-size: 24px;
    font-weight: 800;
    margin: 0 0 12px 0;
    line-height: 1.2;
    color: #3D2E11;
}

.banner-subtitle {
    font-size: 14px;
    opacity: 0.85;
    margin: 0 0 15px 0;
    font-weight: 500;
}

.trust-badges { display: flex; gap: 20px; }

.custom-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 700;
    color: #3D2E11;
}

.check-icon {
    width: 18px;
    height: 18px;
    background: #26C281;
    border-radius: 50%;
    position: relative;
    display: inline-block;
}
.check-icon::after {
    content: '';
    position: absolute;
    left: 6px; top: 3px; width: 4px; height: 8px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* Loading Spinner */
.loading-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(255,255,255,0.98);
    backdrop-filter: blur(8px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 100;
    border-radius: var(--border-radius);
    display: none;
}

.progress-container {
    width: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    transform: translateY(-15px); /* 上移 15px */
}

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--primary-red);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    display: block;
    margin-bottom: 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.progress-text {
    font-size: 16px;
    color: #444;
    text-align: center;
    font-weight: 600;
    height: 24px;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
}

/* Removed Progress Bar Styles */
.user-avatar { display: block !important; }

@media (max-width: 1200px) {
    .turnitman-container { padding: 20px; }
}
@media (max-width: 900px) {
    .turnitman-container { flex-direction: column; height: auto; }
    .panel { min-height: 500px; }
    .empty-state-actions { flex-direction: column; gap: 15px; }
}
