/* 用户下拉菜单 */
.user-dropdown-wrap {
    position: relative;
}

.user-dropdown-trigger {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 8px;
    transition: background 0.2s;
    border: none;
    background: transparent;
    font: inherit;
}

.user-dropdown-trigger:hover {
    background: #f7fafc;
}

.user-dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 180px;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    padding: 6px;
    display: none;
    z-index: 200;
}

.user-dropdown-menu.is-open {
    display: block;
}

/* 通用菜单项：左图标 + 右文字 */
.ui-menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 10px 12px;
    border: none;
    background: transparent;
    border-radius: 8px;
    cursor: pointer;
    text-decoration: none;
    color: #2d3748;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.15s;
    text-align: left;
}

.ui-menu-item:hover {
    background: #f7fafc;
    color: #667eea;
}

.ui-menu-item__icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ui-menu-item__icon img {
    width: 18px;
    height: 18px;
    object-fit: contain;
    opacity: 0.75;
}

.ui-menu-item__label {
    flex: 1;
}

/* 设置页分块布局 */
.settings-layout {
    display: flex;
    height: calc(100vh - 70px);
    background: #1e1e1e;
}

.settings-sidebar {
    width: 48px;
    background: #333333;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 0;
    gap: 4px;
    flex-shrink: 0;
}

.settings-sidebar-item {
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
    padding: 0;
}

.settings-sidebar-item img {
    width: 22px;
    height: 22px;
    opacity: 0.7;
    filter: brightness(0) invert(0.85);
}

.settings-sidebar-item:hover {
    background: rgba(255, 255, 255, 0.08);
}

.settings-sidebar-item.is-active {
    background: rgba(255, 255, 255, 0.12);
}

.settings-sidebar-item.is-active img {
    opacity: 1;
}

.settings-main {
    flex: 1;
    background: #f7fafc;
    overflow: auto;
    display: flex;
    justify-content: center;
}

.settings-panel-host {
    width: 100%;
    max-width: 960px;
    padding: 32px 40px;
}

.settings-panel {
    width: 100%;
}

.settings-panel h2 {
    font-size: 22px;
    color: #2d3748;
    margin-bottom: 8px;
}

.settings-panel .panel-desc {
    color: #718096;
    font-size: 14px;
    margin-bottom: 24px;
}

/* 诗词卡片编辑 */
.poetry-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.poetry-cards {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.poetry-card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    border: 1px solid #e2e8f0;
}

.poetry-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.poetry-card-header h3 {
    font-size: 16px;
    color: #4a5568;
}

.poetry-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.poetry-form-grid .full-width {
    grid-column: 1 / -1;
}

.form-group label {
    display: block;
    font-size: 13px;
    color: #4a5568;
    margin-bottom: 6px;
    font-weight: 500;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
}

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

.poetry-card-actions {
    display: flex;
    gap: 10px;
    margin-top: 16px;
    justify-content: flex-end;
}

.btn {
    padding: 8px 18px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    opacity: 0.9;
}

.btn-secondary {
    background: #f7fafc;
    border: 1px solid #e2e8f0;
    color: #4a5568;
}

.btn-secondary:hover {
    background: #edf2f7;
}

.btn-danger {
    background: #fff5f5;
    border: 1px solid #feb2b2;
    color: #c53030;
}

.btn-danger:hover {
    background: #fed7d7;
}

.image-preview {
    margin-top: 8px;
    max-width: 200px;
    max-height: 120px;
    border-radius: 8px;
    object-fit: cover;
    display: none;
}

.image-preview.is-visible {
    display: block;
}

.empty-hint {
    text-align: center;
    color: #a0aec0;
    padding: 40px;
    font-size: 14px;
}

@media (max-width: 768px) {
    .poetry-form-grid {
        grid-template-columns: 1fr;
    }

    .settings-panel-host {
        padding: 20px;
    }
}
