/* All in One - 功能页面样式修复 */

/* ========== 模块容器基础样式 ========== */
#module-container {
    width: 100%;
    max-width: 100%;
    min-height: 500px;
    margin: 0 auto;
}

/* 移动端优化 */
@media (max-width: 640px) {
    #module-container {
        padding: 0;
    }
}

/* 模块视图居中布局 */
#module-view {
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

/* ========== 欢迎视图（主页） ========== */
#welcome-view {
    display: block;
    animation: fadeIn 0.3s ease-out;
}

#welcome-view.hidden {
    display: none !important;
}

/* ========== 模块视图（功能页面） ========== */
#module-view {
    display: none;
    position: relative;
    min-height: 400px;
    animation: slideIn 0.3s ease-out;
}

#module-view.active,
#module-view:not(.hidden) {
    display: block !important;
}

/* ========== 视图切换动画 ========== */
@keyframes fadeIn {
    from { 
        opacity: 0; 
    }
    to { 
        opacity: 1; 
    }
}

@keyframes slideIn {
    from { 
        opacity: 0; 
        transform: translateY(10px); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0); 
    }
}

/* ========== 功能模块容器通用样式 (现代化居中布局) ========== */
#timestamp-module,
#debugging-tools-module,
#pdf-tools-module,
#open-platform-module {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    background: #ffffff;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px 0 rgba(15, 23, 42, 0.06);
}

/* 强制模块内容居中 */
#timestamp-module > *,
#debugging-tools-module > *,
#pdf-tools-module > *,
#open-platform-module > * {
    margin-left: auto;
    margin-right: auto;
}

/* 排除头部容器，让它自然布局 */
#timestamp-module > .relative,
#debugging-tools-module > .relative,
#pdf-tools-module > .relative,
#open-platform-module > .relative {
    margin-left: 0;
    margin-right: 0;
}

/* 确保返回按钮绝对定位 */
.relative #backBtn {
    position: absolute !important;
    right: 0 !important;
    margin: 0 !important;
}

/* 移动端优化：全宽显示 */
@media (max-width: 640px) {
    #timestamp-module,
    #debugging-tools-module,
    #pdf-tools-module,
    #open-platform-module {
        max-width: 100%;
        border-radius: 6px;
    }
}

/* ========== 标签页导航样式（现代化SaaS风格） ========== */
.tab-link {
    padding: 0.5rem 1rem;
    margin-right: 0.25rem;
    border-bottom: 2px solid transparent;
    color: #64748b;
    font-weight: 500;
    font-size: 0.875rem;
    transition: all 0.15s ease;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    background: transparent;
    white-space: nowrap;
    position: relative;
}

.tab-link:hover {
    color: #0f172a;
    border-bottom-color: #cbd5e1;
    background-color: transparent;
}

.tab-link.active {
    color: #2563eb !important;
    border-bottom-color: #2563eb !important;
    font-weight: 600;
}

/* Tab 图标动画 */
.tab-link i {
    transition: transform 0.2s ease;
}

.tab-link:hover i {
    transform: scale(1.1);
}
/* ========== Tab 内容面板 ========== */
.tab-panel {
    min-height: 200px;
    padding-bottom: 2rem;
    position: relative;
    z-index: 1;
    clear: both;
}

.tab-panel.hidden {
    display: none !important;
}

.tab-panel.animate-fade-in {
    animation: fadeIn 0.3s ease-out;
}

/* ========== 动态生成的下载按钮与布局修复 ========== */
a.download-btn,
button.download-btn,
.output-box button,
.output-box a.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    background-color: #3b82f6;
    color: #ffffff !important;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    margin-top: 0.75rem;
    margin-right: 0.5rem;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

a.download-btn:hover,
button.download-btn:hover,
.output-box button:hover,
.output-box a.btn:hover {
    background-color: #2563eb;
    transform: translateY(-1px);
}

/* 输出框 z-index 层级 */
.output-box {
    position: relative;
    z-index: 2;
}

/* 操作按钮组居中 */
.flex.justify-start,
.mt-8.flex.justify-start {
    justify-content: center !important;
}

/* ========== 输出框样式 ========== */
.output-box {
    background-color: #0f172a;
    color: #f1f5f9;
    border: 1px solid #1e293b;
    padding: 0.875rem 1rem;
    border-radius: 6px;
    margin-top: 0.5rem;
    white-space: pre-wrap;
    word-break: break-all;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    max-height: 450px;
    overflow-y: auto;
    font-size: 0.8125rem;
    line-height: 1.6;
    position: relative;
    z-index: 2;
    scrollbar-width: thin;
    scrollbar-color: #334155 #0f172a;
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
}

.output-box::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.output-box::-webkit-scrollbar-track {
    background: #0f172a;
    border-radius: 3px;
}

.output-box::-webkit-scrollbar-thumb {
    background: #334155;
    border-radius: 3px;
    transition: background 0.15s ease;
}

.output-box::-webkit-scrollbar-thumb:hover {
    background: #475569;
}

.output-box.bg-white {
    background-color: #ffffff !important;
    color: #0f172a !important;
    border: 1px solid #e2e8f0 !important;
}

.output-box.bg-gray-50 {
    background-color: #f8fafc !important;
    color: #0f172a !important;
    border: 1px solid #e2e8f0 !important;
}

/* ========== 操作按钮样式（现代化技术服务规范） ========== */
.action-button,
.btn-primary,
.btn-success,
.btn-purple {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    padding: 0.5rem 1.125rem;
    font-weight: 500;
    font-size: 0.875rem;
    border-radius: 6px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.15s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

/* 蓝色主按钮 */
.btn-primary {
    background-color: #2563eb;
    border-color: #1d4ed8;
    color: white;
}

.btn-primary:hover {
    background-color: #1d4ed8;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.2);
}

/* 绿色成功按钮 */
.btn-success {
    background-color: #16a34a;
    border-color: #15803d;
    color: white;
}

.btn-success:hover {
    background-color: #15803d;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(22, 163, 74, 0.2);
}

/* 优雅深靛蓝按钮 (替换旧紫粉) */
.btn-purple {
    background-color: #4f46e5;
    border-color: #4338ca;
    color: white;
}

.btn-purple:hover {
    background-color: #4338ca;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(79, 70, 229, 0.2);
}

/* action-button 通用样式 */
.action-button {
    transition: all 0.15s ease-in-out;
}

/* 移动端按钮优化 */
@media (max-width: 639px) {
    .action-button,
    .btn-primary,
    .btn-success,
    .btn-purple {
        width: 100%;
        padding: 0.65rem 1.25rem;
    }
}

/* 按钮点击反馈 */
@media (hover: none) {
    .action-button:active,
    .btn-primary:active,
    .btn-success:active,
    .btn-purple:active {
        transform: scale(0.99);
    }
}

.action-button:disabled,
button:disabled {
    background-color: #94a3b8 !important;
    border-color: #94a3b8 !important;
    color: #f1f5f9 !important;
    cursor: not-allowed !important;
    transform: none !important;
    box-shadow: none !important;
}

/* ========== 表单元素样式 ========== */
input[type="text"],
input[type="number"],
input[type="password"],
input[type="datetime-local"],
textarea,
select {
    display: block;
    width: 100%;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    line-height: 1.45;
    color: #0f172a;
    background-color: #fff;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.04);
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

input[type="text"]:focus,
input[type="number"]:focus,
input[type="password"]:focus,
input[type="datetime-local"]:focus,
textarea:focus,
select:focus {
    color: #0f172a;
    background-color: #fff;
    border-color: #2563eb;
    outline: 0;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

/* ========== 文件上传输入框 ========== */
input[type="file"] {
    display: block;
    width: 100%;
    padding: 0.35rem 0;
    font-size: 0.875rem;
    color: #64748b;
}

input[type="file"]::-webkit-file-upload-button {
    margin-right: 0.75rem;
    border: 1px solid #cbd5e1;
    padding: 0.4rem 0.875rem;
    font-weight: 500;
    font-size: 0.8125rem;
    border-radius: 6px;
    background-color: #ffffff;
    color: #0f172a;
    cursor: pointer;
    transition: all 0.15s ease;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.04);
}

input[type="file"]::-webkit-file-upload-button:hover {
    background-color: #f8fafc;
    border-color: #94a3b8;
}

/* 移动端文件上传优化 */
@media (max-width: 639px) {
    input[type="file"]::-webkit-file-upload-button {
        padding: 0.35rem 0.75rem;
        font-size: 0.8125rem;
    }
}

/* ========== 消息提示 ========== */
.error-message {
    color: #b91c1c !important;
    font-weight: 500;
    background-color: #fef2f2 !important;
    border: 1px solid #fecaca !important;
    padding: 0.75rem 1rem !important;
    border-radius: 6px;
    font-size: 0.875rem;
    line-height: 1.5;
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
}

.success-message {
    color: #15803d !important;
    font-weight: 500;
    background-color: #f0fdf4 !important;
    border: 1px solid #bbf7d0 !important;
    padding: 0.75rem 1rem !important;
    border-radius: 6px;
    font-size: 0.875rem;
    line-height: 1.5;
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
}

.info-message {
    color: #0369a1 !important;
    font-weight: 500;
    background-color: #f0f9ff !important;
    border: 1px solid #bae6fd !important;
    padding: 0.75rem 1rem !important;
    border-radius: 6px;
    font-size: 0.875rem;
    line-height: 1.5;
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
}

/* ========== 隐藏工具类 ========== */
.hidden {
    display: none !important;
}

/* ========== Tailwind CSS 工具类补充（完整修复） ========== */
/* 背景色 */
.bg-white { background-color: white !important; }
.bg-gray-50 { background-color: #f9fafb !important; }
.bg-gray-100 { background-color: #f3f4f6 !important; }
.bg-blue-500 { background-color: #3b82f6; }
.bg-blue-600 { background-color: #2563eb; }
.bg-green-500 { background-color: #10b981; }
.bg-green-600 { background-color: #059669; }
.bg-purple-500 { background-color: #8b5cf6; }
.bg-purple-600 { background-color: #7c3aed; }
.bg-red-50 { background-color: #fef2f2 !important; }
.bg-red-100 { background-color: #fee2e2 !important; }
.bg-gray-50 { background-color: #f9fafb !important; }

/* 边框 */
.border { border-width: 1px; }
.border-b { border-bottom-width: 1px; }
.border-2 { border-width: 2px; }
.border-gray-200 { border-color: #e5e7eb; }
.border-gray-300 { border-color: #d1d5db; }
.border-red-200 { border-color: #fecaca; }
.border-blue-500 { border-color: #3b82f6; }

/* 圆角 */
.rounded { border-radius: 0.25rem; }
.rounded-md { border-radius: 0.375rem; }
.rounded-lg { border-radius: 0.5rem; }
.rounded-full { border-radius: 9999px; }

/* 阴影 */
.shadow-sm { box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05); }
.shadow-md { box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1); }
.shadow-lg { box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1); }

/* 间距 - margin */
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mt-8 { margin-top: 2rem; }
.mt-10 { margin-top: 2.5rem; }
.mt-12 { margin-top: 3rem; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }
.mr-2 { margin-right: 0.5rem; }
.mr-4 { margin-right: 1rem; }
.ml-2 { margin-left: 0.5rem; }

/* 间距 - padding */
.p-2 { padding: 0.5rem; }
.p-3 { padding: 0.75rem; }
.p-4 { padding: 1rem; }
.p-6 { padding: 1.5rem; }
.p-8 { padding: 2rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-3 { padding-top: 0.75rem; padding-bottom: 0.75rem; }

/* Flexbox */
.space-y-3 > * + * { margin-top: 0.75rem; }
.space-y-4 > * + * { margin-top: 1rem; }
.space-x-4 > * + * { margin-left: 1rem; }

/* 文本 */
.text-sm { font-size: 0.875rem; }
.text-base { font-size: 1rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }
.text-2xl { font-size: 1.5rem; }
.text-3xl { font-size: 1.875rem; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.text-gray-500 { color: #6b7280; }
.text-gray-600 { color: #4b5563; }
.text-gray-700 { color: #374151; }
.text-gray-800 { color: #1f2937; }
.text-white { color: white; }

/* 定位 */
.relative { position: relative; }
.absolute { position: absolute; }
.fixed { position: fixed; }
.sticky { position: sticky; }
.z-10 { z-index: 10; }
.z-40 { z-index: 40; }
.top-0 { top: 0; }

/* 尺寸 */
.w-full { width: 100%; }
.h-full { height: 100%; }
.max-w-screen-2xl { max-width: 1536px; }
.max-h-96 { max-height: 24rem; }
.overflow-auto { overflow: auto; }
.overflow-y-auto { overflow-y: auto; }

/* 清除浮动 */
.clear-both { clear: both; }

/* 过渡动画 */
.transition-all { transition: all 0.2s ease; }
.duration-200 { transition-duration: 200ms; }
.outline-none { outline: none; }

.thumbnail-preview {
    display: grid;
    gap: 10px;
}

.thumbnail-preview img {
    max-width: 100%;
    max-height: 320px;
    object-fit: contain;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #f9fafb;
}

.timestamp-cert-card {
    display: grid;
    gap: 16px;
    padding: 20px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 1px 3px 0 rgba(15, 23, 42, 0.06);
}

.timestamp-cert-card__eyebrow {
    color: #1d4ed8;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0;
}

.timestamp-cert-card h3 {
    margin: 4px 0 6px;
    color: #0f172a;
    font-size: 1.3rem;
    line-height: 1.35;
}

.timestamp-cert-card p {
    margin: 0;
    color: #475569;
    line-height: 1.65;
}

.timestamp-cert-card__status {
    width: fit-content;
    min-width: 86px;
    padding: 7px 12px;
    border-radius: 999px;
    color: #0f172a;
    font-size: 0.82rem;
    font-weight: 700;
    text-align: center;
    background: #e2e8f0;
}

.timestamp-cert-card__status--success {
    color: #065f46;
    background: #d1fae5;
}

.timestamp-cert-card__status--warning,
.timestamp-cert-card__status--pending {
    color: #92400e;
    background: #fef3c7;
}

.timestamp-cert-card__status--error {
    color: #991b1b;
    background: #fee2e2;
}

.timestamp-cert-card__status--muted {
    color: #334155;
    background: #e2e8f0;
}

.timestamp-cert-card__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
}

.timestamp-cert-metric {
    min-width: 0;
    padding: 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.78);
}

.timestamp-cert-metric span {
    display: block;
    margin-bottom: 6px;
    color: #64748b;
    font-size: 0.78rem;
}

.timestamp-cert-metric strong {
    display: block;
    color: #0f172a;
    font-size: 0.92rem;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.file-drop-zone {
    border: 1px dashed #cbd5e1;
    border-radius: 8px;
    padding: 14px;
    background: #f8fafc;
    transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.file-drop-zone--active {
    border-color: #0f766e;
    background: #ecfdf5;
    box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.08);
}

.toolbar-actions {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-left: auto;
}

.field-grid--compact {
    gap: 12px;
}

.aigc-search-results {
    display: grid;
    gap: 10px;
}

.aigc-search-result {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #f8fafc;
}

.aigc-search-result strong,
.aigc-search-result span {
    display: block;
    overflow-wrap: anywhere;
}

.aigc-search-result strong {
    margin-bottom: 4px;
    color: #0f172a;
    font-size: 0.9rem;
}

.aigc-search-result span {
    color: #475569;
    font-size: 0.84rem;
}

.raw-detail-section {
    display: grid;
    gap: 8px;
    padding: 0 0 18px;
}

.raw-detail-section + .raw-detail-section {
    padding-top: 18px;
    border-top: 1px solid #e2e8f0;
}

.raw-detail-section h4 {
    margin: 0;
    color: #0f172a;
    font-size: 0.94rem;
}

.raw-detail-section pre {
    margin: 0;
    white-space: pre-wrap;
}

@media (max-width: 720px) {
    .aigc-search-result {
        align-items: stretch;
        flex-direction: column;
    }

    .toolbar-actions {
        margin-left: 0;
    }
}

/* ========== 站长工具 (Webmaster Tools) 进度与诊断样式 ========== */
.scan-progress {
    margin-top: 14px;
    padding: 12px 14px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-sm, 6px);
}

.scan-progress__bar {
    width: 100%;
    height: 6px;
    background: #e2e8f0;
    border-radius: 999px;
    overflow: hidden;
    position: relative;
}

.scan-progress__fill {
    width: 40%;
    height: 100%;
    background: linear-gradient(90deg, var(--primary, #2563eb), #60a5fa, var(--primary, #2563eb));
    border-radius: 999px;
    animation: scanIndeterminate 1.8s infinite ease-in-out;
}

@keyframes scanIndeterminate {
    0% {
        transform: translateX(-100%);
    }
    50% {
        transform: translateX(120%);
    }
    100% {
        transform: translateX(250%);
    }
}

.scan-progress__text {
    margin: 8px 0 0;
    font-size: 0.85rem;
    color: var(--ink-soft, #64748b);
    display: flex;
    align-items: center;
    gap: 6px;
}

.scan-cancel-btn {
    border-color: #ef4444 !important;
    color: #ef4444 !important;
}

.scan-cancel-btn:hover {
    background-color: #fef2f2 !important;
}

.score-card__value--good {
    color: var(--success, #16a34a) !important;
}

.score-card__value--fair {
    color: var(--warning, #eab308) !important;
}

.score-card__value--poor {
    color: var(--error, #ef4444) !important;
}

