/* ===== 全局样式 ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --pink-100: hsl(340, 100%, 95%);
    --pink-200: hsl(340, 90%, 88%);
    --pink-300: hsl(340, 80%, 75%);
    --pink-400: hsl(340, 70%, 65%);
    --pink-500: hsl(340, 65%, 55%);
    
    --yellow-100: hsl(45, 100%, 96%);
    --yellow-200: hsl(45, 90%, 85%);
    --yellow-300: hsl(45, 80%, 70%);
    
    --sky-100: hsl(200, 80%, 95%);
    --sky-200: hsl(200, 70%, 85%);
    --sky-300: hsl(200, 60%, 70%);
    
    --purple-100: hsl(270, 80%, 95%);
    --purple-200: hsl(270, 70%, 85%);
    
    --green-100: hsl(140, 70%, 95%);
    --green-200: hsl(140, 60%, 85%);
    
    --text-primary: #1f2937;
    --text-secondary: #4b5563;
    --text-muted: #9ca3af;
    
    --bg-white: rgba(255, 255, 255, 0.8);
    --bg-white-solid: #ffffff;
    --border-color: rgba(255, 182, 193, 0.5);
    
    --shadow-pink: 0 8px 32px rgba(255, 105, 180, 0.15);
    --shadow-yellow: 0 8px 32px rgba(255, 215, 0, 0.15);
    --shadow-sky: 0 8px 32px rgba(100, 180, 255, 0.15);
    --shadow-purple: 0 8px 32px rgba(180, 130, 255, 0.15);
    
    --radius-lg: 24px;
    --radius-md: 16px;
    --radius-sm: 10px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    background: linear-gradient(135deg, var(--pink-100) 0%, var(--yellow-100) 50%, var(--sky-100) 100%);
    min-height: 100vh;
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

/* ===== 背景装饰 ===== */
.bg-decoration {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.6;
}

.blob-pink {
    width: 400px;
    height: 400px;
    background: var(--pink-200);
    top: -100px;
    left: -100px;
}

.blob-yellow {
    width: 350px;
    height: 350px;
    background: var(--yellow-200);
    top: 20%;
    right: -80px;
}

.blob-sky {
    width: 380px;
    height: 380px;
    background: var(--sky-200);
    bottom: 10%;
    left: 10%;
}

.blob-purple {
    width: 300px;
    height: 300px;
    background: var(--purple-200);
    bottom: -80px;
    right: 20%;
}

.blob-green {
    width: 250px;
    height: 250px;
    background: var(--green-200);
    top: 50%;
    left: 40%;
}

/* ===== 主容器 ===== */
.app {
    position: relative;
    z-index: 1;
    max-width: 900px;
    margin: 0 auto;
    padding: 0 20px 40px;
}

/* ===== 顶部标题栏 ===== */
.header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    margin: 0 -20px;
    padding: 0 20px;
}

.header-content {
    max-width: 900px;
    margin: 0 auto;
    padding: 16px 0;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, var(--pink-400), var(--yellow-300));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    box-shadow: 0 4px 12px rgba(255, 105, 180, 0.3);
}

.logo-text h1 {
    font-size: 20px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--pink-500), var(--yellow-300));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.logo-text p {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* ===== 主内容区 ===== */
.main-content {
    padding-top: 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* ===== 周期切换 ===== */
.period-tabs {
    display: flex;
    justify-content: center;
}

.tabs-wrapper {
    display: inline-flex;
    background: var(--bg-white);
    backdrop-filter: blur(8px);
    border-radius: 999px;
    padding: 4px;
    box-shadow: var(--shadow-pink);
    border: 1px solid var(--border-color);
}

.tab-btn {
    padding: 10px 28px;
    border: none;
    background: transparent;
    border-radius: 999px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all 0.3s ease;
}

.tab-btn.active {
    background: linear-gradient(135deg, var(--pink-400), var(--pink-300));
    color: white;
    box-shadow: 0 2px 8px rgba(255, 105, 180, 0.4);
}

/* ===== 卡片通用样式 ===== */
.card {
    background: var(--bg-white);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: var(--radius-lg);
    padding: 24px;
    border: 1px solid rgba(255, 255, 255, 0.8);
}

.card-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.card-platform {
    box-shadow: var(--shadow-pink);
}

.card-input {
    box-shadow: var(--shadow-yellow);
}

.card-editor {
    box-shadow: var(--shadow-sky);
}

.card-result {
    box-shadow: var(--shadow-purple);
}

/* ===== 平台选择 ===== */
.platform-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 12px;
}

.platform-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 16px 8px;
    border: 2px solid transparent;
    background: var(--bg-white-solid);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 13px;
    color: var(--text-secondary);
}

.platform-btn:hover {
    transform: translateY(-2px);
    border-color: var(--pink-200);
}

.platform-btn.active {
    border-color: var(--pink-400);
    background: linear-gradient(135deg, var(--pink-100), var(--yellow-100));
    color: var(--pink-500);
    font-weight: 600;
}

.platform-icon {
    font-size: 24px;
}

.platform-tip {
    font-size: 12px;
    color: var(--text-muted);
    text-align: center;
}

/* ===== 输入Tab ===== */
.input-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 20px;
    background: rgba(255, 255, 255, 0.5);
    padding: 4px;
    border-radius: var(--radius-md);
}

.input-tab {
    flex: 1;
    padding: 10px 16px;
    border: none;
    background: transparent;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 14px;
    color: var(--text-secondary);
    transition: all 0.3s ease;
}

.input-tab.active {
    background: var(--bg-white-solid);
    color: var(--text-primary);
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

/* ===== 上传区域 ===== */
.upload-area {
    border: 2px dashed var(--pink-200);
    border-radius: var(--radius-md);
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.3);
    margin-bottom: 16px;
}

.upload-area:hover {
    border-color: var(--pink-400);
    background: rgba(255, 192, 203, 0.1);
}

.upload-area.dragover {
    border-color: var(--pink-500);
    background: rgba(255, 192, 203, 0.2);
    transform: scale(1.01);
}

.upload-icon {
    font-size: 40px;
    margin-bottom: 12px;
}

.upload-text strong {
    display: block;
    font-size: 15px;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.upload-text span {
    font-size: 13px;
    color: var(--text-muted);
}

/* ===== 预览列表 ===== */
.preview-list {
    margin-bottom: 16px;
}

.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    font-size: 13px;
    color: var(--text-secondary);
}

.preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 10px;
}

.preview-item {
    position: relative;
    aspect-ratio: 3/4;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 2px solid var(--pink-200);
}

.preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.preview-remove {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 22px;
    height: 22px;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

.preview-status {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 4px;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.6));
    color: white;
    font-size: 10px;
    text-align: center;
}

/* ===== 设置行 ===== */
.settings-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: var(--radius-sm);
}

.setting-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
}

.setting-item.small {
    font-size: 12px;
}

.setting-item input[type="checkbox"] {
    accent-color: var(--pink-400);
    width: 16px;
    height: 16px;
}

.select-small {
    padding: 6px 10px;
    border: 1px solid var(--pink-200);
    border-radius: 8px;
    font-size: 12px;
    background: white;
    color: var(--text-secondary);
    cursor: pointer;
}

/* ===== 按钮样式 ===== */
.primary-btn {
    width: 100%;
    padding: 14px 24px;
    border: none;
    background: linear-gradient(135deg, var(--pink-400), var(--pink-300));
    color: white;
    font-size: 15px;
    font-weight: 600;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(255, 105, 180, 0.3);
}

.primary-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(255, 105, 180, 0.4);
}

.primary-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.secondary-btn {
    width: 100%;
    padding: 12px 24px;
    border: 2px solid var(--pink-300);
    background: transparent;
    color: var(--pink-500);
    font-size: 14px;
    font-weight: 500;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 16px;
}

.secondary-btn:hover {
    background: var(--pink-100);
}

.text-btn {
    border: none;
    background: transparent;
    color: var(--pink-500);
    font-size: 13px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: background 0.2s;
}

.text-btn:hover {
    background: var(--pink-100);
}

.text-btn.danger {
    color: #ef4444;
}

.text-btn.danger:hover {
    background: #fee2e2;
}

/* ===== 手动输入 ===== */
.manual-tip {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.manual-tip.small {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 12px;
}

#manualInput {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--pink-200);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    margin-bottom: 16px;
    background: white;
}

#manualInput:focus {
    outline: none;
    border-color: var(--pink-400);
    box-shadow: 0 0 0 3px rgba(255, 192, 203, 0.3);
}

/* ===== 数据编辑 ===== */
.editor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.editor-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.table-container {
    overflow-x: auto;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.data-table th {
    background: var(--pink-100);
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 13px;
}

.data-table td {
    padding: 10px 16px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.data-table input {
    width: 100%;
    padding: 6px 10px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
}

.data-table input:focus {
    outline: none;
    border-color: var(--pink-400);
}

.data-table tr.duplicate {
    background: rgba(255, 192, 203, 0.1);
    opacity: 0.6;
}

/* 新增行渐入动画 */
.data-table tr.row-new {
    animation: rowFadeIn 0.5s ease-out forwards;
    opacity: 0;
    transform: translateY(10px);
}

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

.empty-cell {
    text-align: center;
    color: var(--text-muted);
    padding: 40px !important;
    font-size: 13px;
}

.delete-row-btn {
    border: none;
    background: transparent;
    color: #ef4444;
    cursor: pointer;
    font-size: 16px;
    padding: 4px;
    border-radius: 4px;
    opacity: 0.6;
}

.delete-row-btn:hover {
    opacity: 1;
    background: #fee2e2;
}

/* ===== 结果展示 ===== */
.result-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.result-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.7));
    border-radius: var(--radius-md);
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.8);
}

.result-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.result-icon {
    font-size: 16px;
}

.result-value {
    font-size: 28px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--pink-500), var(--yellow-300));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 12px;
}

.result-detail {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
}

.detail-label {
    color: var(--text-muted);
}

.detail-value {
    color: var(--text-secondary);
    font-weight: 500;
}

/* ===== 帮助说明 ===== */
.help-section {
    margin-top: 8px;
}

.help-details {
    background: rgba(255, 255, 255, 0.6);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    cursor: pointer;
}

.help-details summary {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 500;
    list-style: none;
}

.help-details summary::-webkit-details-marker {
    display: none;
}

.help-content {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.help-content h4 {
    font-size: 13px;
    color: var(--text-primary);
    margin-bottom: 8px;
    margin-top: 12px;
}

.help-content h4:first-child {
    margin-top: 0;
}

.help-content ul {
    padding-left: 20px;
    margin-bottom: 8px;
}

.help-content li {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.help-content p {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.7;
}

/* ===== 页脚 ===== */
.footer {
    text-align: center;
    padding: 24px 0;
    font-size: 12px;
    color: var(--text-muted);
}

/* ===== 加载遮罩 ===== */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

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

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--pink-200);
    border-top-color: var(--pink-400);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 16px;
}

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

.loading-content p {
    color: var(--text-secondary);
    font-size: 14px;
}

.progress-detail {
    margin-top: 16px;
    padding: 12px 20px;
    background: linear-gradient(135deg, rgba(255, 182, 193, 0.2), rgba(255, 236, 179, 0.2));
    border-radius: 12px;
    border: 1px solid rgba(255, 182, 193, 0.3);
    min-width: 240px;
    text-align: center;
}

.progress-step {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.progress-count {
    font-size: 13px;
    color: var(--text-secondary);
}

/* ===== Toast 提示 ===== */
.toast-container {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    padding: 12px 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    font-size: 14px;
    animation: slideDown 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.toast.success {
    border-left: 4px solid #10b981;
}

.toast.error {
    border-left: 4px solid #ef4444;
}

.toast.warning {
    border-left: 4px solid #f59e0b;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== 日志面板 ===== */
.log-panel {
    position: fixed;
    right: 24px;
    bottom: 60px;
    width: 300px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
    overflow: hidden;
    z-index: 99999999;
    font-size: 12px;
}
.log-header {
    padding: 10px 14px;
    background: linear-gradient(135deg, #FFB6C1, #FFD700);
    color: white;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
}

.log-toggle {
    font-size: 10px;
    transition: transform 0.3s;
}

.log-panel.collapsed .log-toggle {
    transform: rotate(-90deg);
}

.log-panel.collapsed .log-content {
    display: none;
}

.log-content {
    max-height: 200px;
    overflow-y: auto;
    padding: 10px 12px;
    font-family: 'Courier New', monospace;
    font-size: 11px;
    line-height: 1.6;
    color: #555;
    background: #fafafa;
}

.log-content .log-line {
    margin-bottom: 2px;
    word-break: break-all;
}

.log-content .log-line.success {
    color: #10b981;
}

.log-content .log-line.error {
    color: #ef4444;
}

.log-content .log-line.warning {
    color: #f59e0b;
}

/* ===== 响应式 ===== */
@media (max-width: 640px) {
    .platform-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .result-grid {
        grid-template-columns: 1fr;
    }
    
    .logo-text h1 {
        font-size: 18px;
    }
    
    .card {
        padding: 18px;
    }
}
/* ===== 日志面板 ===== */
.log-panel {
    position: fixed;
    right: 20px;
    bottom: 20px;
    width: 320px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    z-index: 999;
    font-size: 12px;
}

.log-header {
    padding: 10px 14px;
    background: linear-gradient(135deg, #FFB6C1, #FFD700);
    color: white;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
}

.log-toggle {
    font-size: 10px;
    transition: transform 0.3s;
}

.log-panel.collapsed .log-toggle {
    transform: rotate(-90deg);
}

.log-panel.collapsed .log-content {
    display: none;
}

.log-content {
    max-height: 200px;
    overflow-y: auto;
    padding: 10px 12px;
    font-family: 'Courier New', monospace;
    font-size: 11px;
    line-height: 1.6;
    color: #555;
    background: #fafafa;
}

.log-content .log-line {
    margin-bottom: 2px;
    word-break: break-all;
}

.log-content .log-line.success {
    color: #10b981;
}

.log-content .log-line.error {
    color: #ef4444;
}

.log-content .log-line.warning {
    color: #f59e0b;
}
/* 链接文字逐字跳跃 */
.announcement-body a span {
    display: inline-block;
    animation: jumpWave 1.4s ease-in-out infinite;
}
.announcement-body a span:nth-child(1)  { animation-delay: 0s; }
.announcement-body a span:nth-child(2)  { animation-delay: 0.07s; }
.announcement-body a span:nth-child(3)  { animation-delay: 0.14s; }
.announcement-body a span:nth-child(4)  { animation-delay: 0.21s; }
.announcement-body a span:nth-child(5)  { animation-delay: 0.28s; }
.announcement-body a span:nth-child(6)  { animation-delay: 0.35s; }
.announcement-body a span:nth-child(7)  { animation-delay: 0.42s; }
.announcement-body a span:nth-child(8)  { animation-delay: 0.49s; }
.announcement-body a span:nth-child(9)  { animation-delay: 0.56s; }
.announcement-body a span:nth-child(10) { animation-delay: 0.63s; }
.announcement-body a span:nth-child(11) { animation-delay: 0.70s; }
.announcement-body a span:nth-child(12) { animation-delay: 0.77s; }
.announcement-body a span:nth-child(13) { animation-delay: 0.84s; }
.announcement-body a span:nth-child(14) { animation-delay: 0.91s; }
.announcement-body a span:nth-child(15) { animation-delay: 0.98s; }
.announcement-body a span:nth-child(16) { animation-delay: 1.05s; }
.announcement-body a span:nth-child(17) { animation-delay: 1.12s; }
.announcement-body a span:nth-child(18) { animation-delay: 1.19s; }
@keyframes jumpWave {
    0%, 70%, 100% { transform: translateY(0); }
    35% { transform: translateY(-7px); }
}