/* ============================================
   style-base.css - 基础样式和按钮
   ============================================ */

body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f5f5f5;
    color: #333;
}

/* header */
header {
    background-color: #fff;
    border-bottom: 1px solid #ddd;
    padding: 10px 20px;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.left {
    display: flex;
    align-items: center;
}

.logo {
    font-size: 18px;
    font-weight: bold;
    color: #666;
}

/* 工具栏 */
.tools {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-left: 20px;
}

/* 下拉菜单 */
.dropdown {
    position: relative;
}

.dropdown > button {
    display: flex;
    align-items: center;
    gap: 4px;
}

.dropdown > button span {
    font-size: 14px;
}

.dropdown > button .fa-chevron-down {
    font-size: 10px;
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    z-index: 100;
    min-width: 140px;
    margin-top: 2px;
}

.dropdown-menu.show {
    display: flex;
    flex-direction: column;
}

.dropdown-menu button {
    width: auto;
    min-width: 100%;
    text-align: left;
    border: none;
    padding: 8px 12px;
    background-color: #fff;
    color: #666;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.dropdown-menu button:hover {
    background-color: #f0f0f0;
}

.dropdown-menu button:first-child {
    border-radius: 3px 3px 0 0;
}

.dropdown-menu button:last-child {
    border-radius: 0 0 3px 3px;
}

.tools button {
    width: 34px;
    height: 34px;
    padding: 0;
    font-size: 14px;
}

.tools button i,
.tools button span {
    font-size: 14px;
}

.tools button span {
    display: inline-block;
    line-height: 1;
}

/* 标题下拉菜单图标样式 */
.heading-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 14px;
    font-size: 11px;
    font-weight: bold;
    font-family: Arial, sans-serif;
    color: #666;
}

/* 导出下拉菜单 */
.export-dropdown {
    position: relative;
}

.export-main {
    display: flex;
    align-items: center;
    gap: 6px;
}

.export-menu {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    z-index: 100;
    min-width: 120px;
    margin-top: 5px;
}

.export-menu.show {
    display: flex;
    flex-direction: column;
}

.export-menu button {
    width: 100%;
    text-align: left;
    border: none;
    padding: 8px 12px;
    background-color: #fff;
    color: #666;
    cursor: pointer;
    font-size: 14px;
}

.export-menu button:hover {
    background-color: #f0f0f0;
}

.export-menu button:first-child {
    border-radius: 3px 3px 0 0;
}

.export-menu button:last-child {
    border-radius: 0 0 3px 3px;
}

/* 通用按钮样式 */
.tools button,
.export-dropdown button,
.modal-content button,
.modal-buttons button {
    background-color: white;
    color: #666;
    border: 1px solid #ddd;
    padding: 6px 10px;
    cursor: pointer;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

button:hover {
    background-color: #f0f0f0;
}

/* 隐藏类 */
.hidden {
    flex: 0 !important;
    width: 0 !important;
    overflow: hidden !important;
    border-right: none !important;
}

/* 预览区 li 清理 */
.preview-container li {
    margin-left: 0;
}

/* 全局 tooltip */
.global-tooltip {
    position: fixed;
    background: #333;
    color: #fff;
    padding: 5px 8px;
    border-radius: 4px;
    white-space: nowrap;
    z-index: 1000;
    font-size: 12px;
    pointer-events: none;
    display: none;
}

/* ============================================
   加载动画样式
   ============================================ */

#loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.3s ease;
}

#loading-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #666;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-text {
    margin-top: 20px;
    color: #666;
    font-size: 16px;
}

/* ============================================
   FAQ 折叠面板
   ============================================ */
.faq-container {
    max-width: 800px;
    margin: 20px auto;
    padding: 0 20px;
}

.faq-item {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    margin-bottom: 10px;
    overflow: hidden;
}

.faq-question {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: #fafafa;
    cursor: pointer;
    font-weight: 500;
    user-select: none;
    transition: background 0.2s;
}

.faq-question:hover {
    background: #f0f0f0;
}

.faq-question i {
    transition: transform 0.3s;
    color: #666;
}

.faq-item.open .faq-question i {
    transform: rotate(180deg);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

.faq-item.open .faq-answer {
    max-height: 500px;
}

.faq-answer p {
    padding: 15px 20px;
    margin: 0;
    line-height: 1.8;
    color: #555;
}

.faq-answer p code {
    background: #f0f0f0;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: Consolas, monospace;
    font-size: 0.9em;
    color: #c7254e;
}

.faq-answer strong {
    color: #333;
}

/* 页脚 */
footer {
    text-align: center;
    padding: 20px;
    color: #888;
    font-size: 14px;
    margin-top: 20px;
}

footer a {
    color: #888;
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}
