/* =========================================================
   common.css - 工具站公用样式
   森绿暗夜系 · 配套8000版课程
   所有工具共享此样式
   ========================================================= */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

body {
    background-color: #0a0f1c;
    color: #e2e8f0;
    min-height: 100vh;
    position: relative;
}

/* ---------- 背景 ---------- */
.bg-grid {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(0, 255, 209, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 255, 209, 0.05) 1px, transparent 1px);
    background-size: 30px 30px;
}

.bg-glow {
    position: fixed;
    top: -20%; left: -10%;
    width: 60%; height: 60%;
    z-index: 0;
    pointer-events: none;
    background: radial-gradient(circle, rgba(0, 255, 209, 0.06) 0%, transparent 70%);
}

/* ---------- 容器 ---------- */
.container {
    max-width: 820px;
    margin: 0 auto;
    padding: 30px 20px 60px;
    position: relative;
    z-index: 1;
}

/* ---------- 头部 ---------- */
.tool-header {
    text-align: center;
    margin-bottom: 32px;
    animation: fadeIn 0.5s ease;
}

.tool-icon {
    font-size: 40px;
    display: block;
    margin-bottom: 8px;
}

.tool-title {
    font-size: 24px;
    font-weight: 700;
    background: linear-gradient(90deg, #00ffd1, #00c6ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 6px;
}

.tool-desc {
    color: #94a3b8;
    font-size: 14px;
}

/* ---------- 三步上手 ---------- */
.steps-bar {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 28px;
    animation: fadeIn 0.6s ease;
}

.step {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(0, 0, 0, 0.3);
    padding: 8px 16px;
    border-radius: 8px;
    border: 1px solid rgba(0, 255, 209, 0.08);
    font-size: 13px;
    color: #94a3b8;
}

.step-num {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: linear-gradient(135deg, #00ffd1, #00c6ff);
    color: #0a0f1c;
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.step.active .step-num {
    background: linear-gradient(135deg, #00ffd1, #00c6ff);
}

/* ---------- 卡片 ---------- */
.card {
    background: rgba(10, 14, 22, 0.88);
    border: 1px solid rgba(0, 255, 209, 0.15);
    border-radius: 14px;
    padding: 28px 24px;
    box-shadow: 0 0 30px rgba(0, 255, 209, 0.04), 0 8px 28px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(12px);
    margin-bottom: 20px;
    animation: fadeIn 0.5s ease;
}

/* ---------- 表单 ---------- */
.form-group {
    margin-bottom: 18px;
}

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #cbd5e1;
    margin-bottom: 6px;
}

.form-label .required {
    color: #ff6b6b;
    margin-left: 2px;
}

.form-input,
.form-textarea,
.form-select {
    width: 100%;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(0, 255, 209, 0.15);
    border-radius: 8px;
    padding: 10px 14px;
    color: #e2e8f0;
    font-size: 14px;
    transition: all 0.3s;
    outline: none;
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    border-color: rgba(0, 255, 209, 0.5);
    box-shadow: 0 0 0 3px rgba(0, 255, 209, 0.08);
}

.form-input::placeholder,
.form-textarea::placeholder {
    color: rgba(148, 163, 184, 0.4);
}

.form-textarea {
    resize: vertical;
    min-height: 80px;
}

.form-select {
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2300ffd1' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
}

.form-row {
    display: flex;
    gap: 14px;
}

.form-row .form-group {
    flex: 1;
}

.form-tip {
    font-size: 12px;
    color: rgba(148, 163, 184, 0.5);
    margin-top: 4px;
}

/* ---------- 按钮 ---------- */
.btn-primary {
    width: 100%;
    padding: 12px 20px;
    background: linear-gradient(135deg, #00ffd1, #00c6ff);
    color: #0a0f1c;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 6px;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(0, 255, 209, 0.25);
}

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

.btn-primary.loading {
    opacity: 0.7;
    pointer-events: none;
}

.btn-secondary {
    padding: 8px 18px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(0, 255, 209, 0.2);
    color: #94a3b8;
    border-radius: 8px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-secondary:hover {
    color: #e2e8f0;
    border-color: rgba(0, 255, 209, 0.35);
}

/* ---------- 结果区域 ---------- */
.result-area {
    display: none;
    animation: fadeIn 0.4s ease;
}

.result-area.show {
    display: block;
}

.result-box {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(0, 255, 209, 0.1);
    border-radius: 10px;
    padding: 20px;
    margin: 16px 0;
    white-space: pre-wrap;
    line-height: 1.8;
    font-size: 14px;
    color: #cbd5e1;
    max-height: 500px;
    overflow-y: auto;
}

.action-buttons {
    display: flex;
    gap: 10px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.btn-action {
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    border: none;
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-copy {
    background: rgba(0, 255, 209, 0.1);
    color: #00ffd1;
    border: 1px solid rgba(0, 255, 209, 0.2);
}

.btn-copy:hover {
    background: rgba(0, 255, 209, 0.2);
}

.btn-download {
    background: linear-gradient(135deg, #00c6ff, #00e5ff);
    color: #0a0f1c;
}

.btn-download:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 198, 255, 0.3);
}

.btn-word {
    background: rgba(0, 198, 255, 0.08);
    color: #00c6ff;
    border: 1px solid rgba(0, 198, 255, 0.2);
}

.btn-word:hover {
    background: rgba(0, 198, 255, 0.18);
}

.btn-pdf {
    background: rgba(255, 107, 107, 0.08);
    color: #ff6b6b;
    border: 1px solid rgba(255, 107, 107, 0.2);
}

.btn-pdf:hover {
    background: rgba(255, 107, 107, 0.18);
}

/* ---------- 下载exe ---------- */
.download-section {
    text-align: center;
    padding: 20px;
    margin-top: 16px;
}

.download-section .btn-download-exe {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 28px;
    background: linear-gradient(135deg, #00ffd1, #00c6ff);
    color: #0a0f1c;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
}

.download-section .btn-download-exe:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(0, 255, 209, 0.25);
}

.download-hint {
    font-size: 12px;
    color: rgba(148, 163, 184, 0.5);
    margin-top: 8px;
}

/* ---------- 底部课程关联 ---------- */
.course-link {
    text-align: center;
    margin-top: 24px;
    padding: 16px;
    border-top: 1px solid rgba(0, 255, 209, 0.08);
}

.course-link a {
    color: #00ffd1;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s;
}

.course-link a:hover {
    color: #00c6ff;
    text-shadow: 0 0 10px rgba(0, 255, 209, 0.2);
}

.course-link .back-link {
    color: #94a3b8;
    font-size: 13px;
    display: block;
    margin-bottom: 8px;
}

.course-link .back-link:hover {
    color: #e2e8f0;
}

/* ---------- Toast ---------- */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(80px);
    background: rgba(0, 255, 209, 0.92);
    color: #0a0f1c;
    padding: 10px 22px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    z-index: 999;
    opacity: 0;
    transition: all 0.4s ease;
    pointer-events: none;
    white-space: nowrap;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ---------- 标签/徽章 ---------- */
.tag {
    display: inline-block;
    padding: 4px 12px;
    background: rgba(0, 255, 209, 0.1);
    border: 1px solid rgba(0, 255, 209, 0.15);
    border-radius: 20px;
    font-size: 12px;
    color: #00ffd1;
}

/* ---------- 动画 ---------- */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ---------- 导出模板专用样式 ---------- */
/* 导出时，内容区域应用这些样式提升视觉效果 */
#result-card[data-export-title] .rr-table th {
    background: rgba(0, 255, 209, 0.08);
    color: #00ffd1;
}

#result-card[data-export-title] .rr-table td {
    color: #cbd5e1;
    border-bottom: 1px solid rgba(0, 255, 209, 0.06);
}

/* ---------- 响应式 ---------- */
@media (max-width: 640px) {
    .container { padding: 20px 12px 40px; }
    .card { padding: 20px 16px; }
    .form-row { flex-direction: column; gap: 0; }
    .steps-bar { flex-direction: column; align-items: stretch; }
    .tool-title { font-size: 20px; }
    .action-buttons { flex-direction: column; }
    .btn-action { width: 100%; justify-content: center; }
}

/* ---------- PM Platform 统一壳 ---------- */
.pm-continue-banner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 14px;
    margin-bottom: 16px;
    padding: 12px 16px;
    background: rgba(0, 255, 209, 0.06);
    border: 1px solid rgba(0, 255, 209, 0.12);
    border-radius: 10px;
    font-size: 13px;
    color: #94a3b8;
}
.pm-continue-banner strong { color: #00ffd1; }
.pm-tool-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 18px;
}
.pm-btn-sm { padding: 6px 14px !important; font-size: 12px !important; }
.pm-btn-link { text-decoration: none; display: inline-flex; align-items: center; }
.pm-export-bar { margin-top: 16px; }
.pm-btn-next {
    background: rgba(0, 198, 255, 0.12) !important;
    border-color: rgba(0, 198, 255, 0.35) !important;
    color: #00c6ff !important;
    text-decoration: none !important;
}
.pm-growth-hint {
    margin: 12px 0 0;
    padding: 10px 14px;
    background: rgba(0, 198, 255, 0.06);
    border-radius: 8px;
    font-size: 13px;
    color: #94a3b8;
}
.pm-growth-hint a { color: #00c6ff; }
.pm-growth-links {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 10px;
    width: 100%;
}
.pm-growth-links a { font-size: 13px; color: #00c6ff; }
.pm-week-streak {
    margin-top: 6px;
    font-size: 12px;
    color: #fbbf24;
}
