Files
note2any/styles.css
2025-10-21 21:47:02 +08:00

995 lines
20 KiB
CSS

/* styles.css — 全局样式表,用于渲染及导出样式。 */
/* =========================================================== */
/* 共享平台样式 (统一的 wechat & xhs 布局组件) */
/* =========================================================== */
/* 主容器 */
.note2any-platform-container {
display: flex;
flex-direction: column;
gap: 7px;
padding: 8px;
/*background: #c8caee;*/
width: 100%;
height: 100%;
box-sizing: border-box;
overflow: hidden;
}
/* 顶部平台选择器栏 */
.note2any-platform-header {
display: flex;
align-items: center;
gap: 8px;
padding: 5px 5px;
background: linear-gradient(to right, #fbc2eb, #a6c1ee);
border-radius: 8px;
min-height: 50px;
width: 100%;
box-sizing: border-box;
flex-wrap: wrap;
flex-shrink: 0;
}
/* 平台选择器区域 */
.note2any-platform-selector {
display: flex;
align-items: center;
gap: 8px;
flex: 1;
min-width: 0;
}
.note2any-platform-label {
font-family: 'Inter', 'Noto Sans SC', 'Noto Sans JP', sans-serif;
font-weight: 600;
font-size: 12px;
color: #1e1e1e;
line-height: 1.4;
white-space: nowrap;
}
/* 选择器通用样式 */
.note2any-select {
padding: 0 32px 0 12px;
background: #ffffff;
border: 1px solid #d9d9d9;
border-radius: 8px;
height: 30px;
line-height: 28px;
box-sizing: border-box;
cursor: pointer;
transition: border-color 0.2s;
flex: 1;
min-width: 0;
font-family: 'Inter', 'Noto Sans SC', 'Noto Sans JP', sans-serif;
font-weight: 300;
font-size: 12px;
color: #1e1e1e;
appearance: none;
-webkit-appearance: none;
-moz-appearance: none;
background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L6 6L11 1' stroke='%231e1e1e' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
background-repeat: no-repeat;
background-position: right 12px center;
}
.note2any-select:hover {
border-color: #4a68a7;
}
.note2any-select:focus {
outline: none;
border-color: #4a68a7;
}
/* 保留对嵌套在div中的select的支持 */
.note2any-select select {
border: none;
background: none;
outline: none;
flex: 1;
font-family: 'Inter', 'Noto Sans SC', 'Noto Sans JP', sans-serif;
font-weight: 300;
font-size: 12px;
color: #1e1e1e;
cursor: pointer;
width: 100%;
min-width: 0;
appearance: none;
-webkit-appearance: none;
-moz-appearance: none;
}
.note2any-select-value {
flex: 1;
font-family: 'Inter', 'Noto Sans SC', 'Noto Sans JP', sans-serif;
font-weight: 300;
font-size: 12px;
color: #1e1e1e;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.note2any-select-icon {
width: 16px;
height: 16px;
flex-shrink: 0;
}
/* 平台选择器特定样式 - 现在使用通用的 .note2any-select */
.note2any-platform-select {
flex: 1;
min-width: 0;
}
/* 按钮组 */
.note2any-button-group {
display: flex;
gap: 8px;
align-items: center;
}
/* 按钮通用样式 */
.note2any-button {
display: flex;
align-items: center;
justify-content: center;
gap: 8px;
padding: 12px;
background: #4a68a7;
border: 1px solid #2c2c2c;
border-radius: 8px;
color: #f5f5f5;
font-family: 'Inter', 'Noto Sans SC', 'Noto Sans JP', sans-serif;
font-weight: 300;
font-size: 12px;
cursor: pointer;
transition: background 0.2s;
white-space: nowrap;
}
.note2any-button:hover {
background: #3a5897;
}
.note2any-button:active {
background: #2a4887;
}
.note2any-button:disabled {
opacity: 0.5;
cursor: not-allowed;
}
/* 控制栏 (账号、主题等) */
.note2any-controls-row {
display: flex;
align-items: center;
gap: 7px;
flex-wrap: wrap;
width: 100%;
flex-shrink: 0;
}
/* 表单字段 */
.note2any-field {
display: flex;
align-items: center;
gap: 8px;
flex: 1;
min-width: 0;
}
.note2any-field-label {
font-family: 'Inter', 'Noto Sans SC', 'Noto Sans JP', sans-serif;
font-weight: 300;
font-size: 12px;
color: #1e1e1e;
line-height: 1.4;
white-space: nowrap;
flex-shrink: 0;
}
/* 账号字段 */
.note2any-field-account {
flex: 1;
min-width: 0;
}
.note2any-field-account select {
flex: 1;
min-width: 0;
padding: 0 12px 0 12px;
background: #ffffff;
border: 1px solid #d9d9d9;
border-radius: 8px;
height: 30px;
line-height: 28px;
box-sizing: border-box;
font-family: 'Inter', 'Noto Sans SC', 'Noto Sans JP', sans-serif;
font-weight: 300;
font-size: 12px;
color: #1e1e1e;
cursor: pointer;
transition: border-color 0.2s;
}
.note2any-field-account select:hover {
border-color: #4a68a7;
}
.note2any-field-account select:focus {
outline: none;
border-color: #4a68a7;
}
/* 主题字段 */
.note2any-field-theme {
flex: 1;
min-width: 0;
}
.note2any-field-theme select {
flex: 1;
min-width: 0;
padding: 0 12px 0 12px;
background: #ffffff;
border: 1px solid #d9d9d9;
border-radius: 8px;
height: 30px;
line-height: 28px;
box-sizing: border-box;
font-family: 'Inter', 'Noto Sans SC', 'Noto Sans JP', sans-serif;
font-weight: 300;
font-size: 12px;
color: #1e1e1e;
cursor: pointer;
transition: border-color 0.2s;
}
.note2any-field-theme select:hover {
border-color: #4a68a7;
}
.note2any-field-theme select:focus {
outline: none;
border-color: #4a68a7;
}
/* 宽度字段 (xhs) - 现在使用下拉框 */
.note2any-field-width {
flex: 1;
min-width: 0;
}
.note2any-field-width select {
flex: 1;
min-width: 0;
}
.note2any-input {
display: flex;
align-items: center;
padding: 12px 12px 12px 16px;
background: #ffffff;
border: 1px solid #d9d9d9;
border-radius: 8px;
height: 40px;
width: 80px;
box-sizing: border-box;
font-family: 'Inter', sans-serif;
font-weight: 200;
font-size: 12px;
color: #1e1e1e;
transition: border-color 0.2s;
}
.note2any-input:focus {
outline: none;
border-color: #4a68a7;
}
/* 内容区域 */
.note2any-content-area {
flex: 1;
width: 100%;
background: #f9f1f1;
border-radius: 16px;
overflow-y: auto;
overflow-x: hidden;
min-height: 0;
display: flex;
justify-content: center;
align-items: flex-start;
padding: 2px 2px 2px 2px;
box-sizing: border-box;
}
.note2any-content-wrapper {
width: 100%;
max-width: 100%;
display: flex;
justify-content: center;
box-sizing: border-box;
}
.note2any-content-inner {
width: auto;
background: white;
max-width: 100%;
box-sizing: border-box;
}
/* 底部工具栏 (xhs) */
.note2any-bottom-toolbar {
display: flex;
align-items: center;
justify-content: space-evenly;
padding: 0 16px;
height: 54px;
width: 100%;
box-sizing: border-box;
flex-shrink: 0;
gap: 8px;
}
/* 字体大小控制 */
.note2any-fontsize-control {
display: flex;
align-items: center;
gap: 0;
}
.note2any-fontsize-select-wrapper {
position: relative;
margin-right: 0;
}
.note2any-fontsize-select {
display: flex;
align-items: center;
justify-content: center;
width: 36px;
height: 32px;
background: #fffcfc;
border: 1px solid #cac4d0;
border-radius: 16px;
font-family: 'Roboto', sans-serif;
font-weight: 300;
font-size: 12px;
color: #49454f;
text-align: center;
cursor: pointer;
appearance: none;
-webkit-appearance: none;
-moz-appearance: none;
padding: 0 8px;
transition: border-color 0.2s;
}
.note2any-fontsize-select:hover {
border-color: #4a68a7;
}
.note2any-fontsize-select:focus {
outline: none;
border-color: #4a68a7;
}
.note2any-fontsize-display {
display: flex;
align-items: center;
justify-content: center;
width: 35px;
height: 32px;
background: #fffcfc;
border: 1px solid #cac4d0;
border-radius: 16px;
font-family: 'Roboto', sans-serif;
font-weight: 300;
font-size: 12px;
color: #49454f;
text-align: center;
}
.note2any-stepper {
display: flex;
height: 32px;
width: 70px;
position: relative;
background: rgba(116, 116, 128, 0.08);
border-radius: 50px;
}
.note2any-stepper-button {
flex: 1;
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
font-size: 14px;
color: #000000;
user-select: none;
transition: background 0.2s;
border: none;
background: transparent;
}
.note2any-stepper-button:hover {
background: rgba(116, 116, 128, 0.15);
}
.note2any-stepper-button:first-child {
border-radius: 50px 0 0 50px;
}
.note2any-stepper-button:last-child {
border-radius: 0 50px 50px 0;
}
.note2any-stepper-separator {
width: 1px;
height: 24px;
background: rgba(60, 60, 67, 0.3);
margin: 4px 0;
}
/* 分页控制 */
.note2any-pagination {
display: flex;
align-items: center;
gap: 2px;
min-width: 120px;
max-width: 260px;
}
.note2any-pagination-separator {
width: 1px;
height: 24px;
background: rgba(60, 60, 67, 0.3);
border-radius: 8px;
}
.note2any-pagination-button {
width: 20px;
height: 20px;
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
transition: opacity 0.2s;
border: none;
background: transparent;
padding: 0;
}
.note2any-pagination-button:hover {
opacity: 0.7;
}
.note2any-pagination-button:disabled {
opacity: 0.3;
cursor: not-allowed;
}
.note2any-pagination-button svg {
width: 32px;
height: 32px;
}
.note2any-pagination-current {
display: flex;
align-items: center;
justify-content: center;
padding: 8px 8px;
background: #fdf0f0;
border-radius: 16px;
font-family: 'Inter', sans-serif;
font-weight: 200;
font-size: 12px;
color: #767676;
white-space: nowrap;
border: 1px solid transparent;
text-align: center;
min-width: 32px;
cursor: text;
transition: all 0.2s ease;
}
.note2any-pagination-current:hover {
background: #fce8e8;
border-color: #f0d0d0;
}
.note2any-pagination-current:focus {
outline: none;
background: #ffffff;
border-color: #ff6b6b;
box-shadow: 0 0 0 2px rgba(255, 107, 107, 0.1);
}
.note2any-pagination-separator-text {
font-family: 'Inter', sans-serif;
font-weight: 500;
font-size: 12px;
color: #000000;
line-height: 1.4;
}
.note2any-pagination-total {
font-family: 'Inter', sans-serif;
font-weight: 200;
font-size: 12px;
color: #1e1e1e;
white-space: nowrap;
}
/* 切图按钮 */
.note2any-slice-button {
display: flex;
align-items: center;
justify-content: center;
gap: 8px;
padding: 12px;
background: #4a68a7;
border: 1px solid #2c2c2c;
border-radius: 8px;
color: #f5f5f5;
font-family: 'Inter', 'Noto Sans SC', 'Noto Sans JP', sans-serif;
font-weight: 300;
font-size: 12px;
cursor: pointer;
opacity: 0.8;
transition: opacity 0.2s;
white-space: nowrap;
}
.note2any-slice-button:hover {
opacity: 1;
}
.note2any-slice-button svg {
width: 16px;
height: 16px;
}
/* Chevron 下拉图标 */
.note2any-chevron-down {
width: 16px;
height: 16px;
display: inline-block;
}
.note2any-chevron-down::after {
content: '';
display: block;
width: 8px;
height: 8px;
border-right: 2px solid #1e1e1e;
border-bottom: 2px solid #1e1e1e;
transform: rotate(45deg) translateY(-2px);
margin: 2px auto 0;
}
/* 滚动条样式 */
.note2any-content-area::-webkit-scrollbar {
width: 8px;
}
.note2any-content-area::-webkit-scrollbar-track {
background: rgba(0, 0, 0, 0.05);
border-radius: 4px;
}
.note2any-content-area::-webkit-scrollbar-thumb {
background: rgba(0, 0, 0, 0.2);
border-radius: 4px;
}
.note2any-content-area::-webkit-scrollbar-thumb:hover {
background: rgba(0, 0, 0, 0.3);
}
/* =========================================================== */
/* UI 样式 */
/* 共用样式与去重 */
/* ===========================================================*/
/* 主题变量 - 仅保留实际使用的变量 */
:root {
--c-bg: #ffffff;
--c-border: #dadce0;
--c-text-muted: #5f6368;
--c-primary: #1e88e5;
--shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
}
.note-preview {
grid-template-rows: auto 1fr;
grid-template-columns: 1fr;
display: grid;
min-height: 100%;
width: 100%;
height: 100%;
background-color: var(--c-bg);
}
/* 预览内部平台容器需要可伸缩: */
.wechat-preview-container:not([style*="display: none"]),
.xiaohongshu-preview-container:not([style*="display: none"]) {
flex: 1;
display: flex !important;
min-height: 0; /* 允许内部滚动区域正确计算高度 */
}
/* 文章包裹:模拟公众号编辑器阅读宽度 */
.wechat-article-wrapper {
width: 100%;
max-width: clamp(360px, 80vw, 760px);
margin: 0 auto;
padding: 12px 18px 80px 18px; /* 底部留白方便滚动到底部操作 */
box-sizing: border-box;
}
/* 若内部 section.note-to-mp 主题没有撑开,确保文本可见基色 */
.wechat-article-wrapper .note-to-mp {
background: transparent;
}
.copy-button {
margin-right: 10px;
padding: 6px 14px;
background: var(--grad-primary);
color: white;
font-size: 13px;
box-shadow: var(--shadow-primary-2);
}
.copy-button:hover { box-shadow: var(--shadow-primary-4); }
.refresh-button {
margin-right: 10px;
padding: 6px 14px;
background: var(--grad-purple);
color: white;
font-size: 13px;
box-shadow: var(--shadow-purple-2);
}
.refresh-button:hover { box-shadow: var(--shadow-purple-4); }
.upload-input {
margin-left: 10px;
padding: 6px 10px;
border: 1px solid var(--c-border);
border-radius: 6px;
font-size: 13px;
transition: all 0.2s ease;
}
.upload-input[type="file"] {
cursor: pointer;
}
.upload-input:focus,
.style-select:focus {
outline: none;
border-color: var(--c-primary);
box-shadow: 0 0 0 3px rgba(30, 136, 229, 0.1);
}
/* 单选按钮样式 */
.input-style[type="radio"] {
width: 16px;
height: 16px;
margin: 0 6px 0 0;
cursor: pointer;
accent-color: var(--c-primary);
}
/* Label 标签样式 */
label {
font-size: 13px;
color: var(--c-text-muted);
cursor: pointer;
user-select: none;
transition: color 0.2s ease;
}
label:hover { color: var(--c-primary); }
.nmp-settings-tabs {
display: flex;
gap: 8px;
margin-top: 16px;
border-bottom: 1px solid var(--c-border);
padding-bottom: 8px;
flex-wrap: wrap;
}
.nmp-settings-tab-button {
border: none;
border-radius: 6px;
padding: 6px 14px;
font-size: 13px;
font-weight: 500;
color: var(--c-text-muted);
background: transparent;
cursor: pointer;
transition: all 0.2s ease;
}
.nmp-settings-tab-button:hover {
color: var(--c-primary);
background: rgba(30, 136, 229, 0.08);
}
.nmp-settings-tab-button.is-active {
color: var(--c-primary);
background: white;
/*box-shadow: var(--shadow-sm);*/
}
.nmp-settings-panels {
margin-top: 16px;
}
.nmp-settings-panel {
display: none;
gap: 12px;
flex-direction: column;
}
.nmp-settings-panel.is-active {
display: flex;
flex-direction: column;
}
.note-mpcard-wrapper {
margin: 20px 20px;
background-color: rgb(250, 250, 250);
padding: 10px 20px;
border-radius: 10px;
}
.note-mpcard-content {
display: grid;
grid-auto-flow: column;
align-items: center;
}
.note-mpcard-headimg {
border: none !important;
border-radius: 27px !important;
box-shadow: none !important;
width: 54px !important;
height: 54px !important;
margin: 0 !important;
}
.note-mpcard-info {
margin-left: 10px;
}
.note-mpcard-nickname {
font-size: 12px;
font-weight: 500;
color: rgba(0, 0, 0, 0.9);
}
.note-mpcard-signature {
font-size: 12px;
color: rgba(0, 0, 0, 0.55);
}
.note-mpcard-foot {
margin-top: 20px;
padding-top: 10px;
border-top: 1px solid #ececec;
font-size: 12px;
color: rgba(0, 0, 0, 0.3);
}
.loading-wrapper {
display: grid;
width: 100%;
height: 100%;
place-items: center;
}
.loading-spinner {
width: 50px; /* 可调整大小 */
height: 50px;
border: 4px solid #fcd6ff; /* 底色,浅灰 */
border-top: 4px solid #bb0cdf; /* 主色,蓝色顶部产生旋转感 */
border-radius: 50%; /* 圆形 */
animation: spin 1s linear infinite; /* 旋转动画 */
}
@keyframes spin {
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(360deg);
}
}
/* =========================================================== */
/* 保留的旧文章包裹样式(兼容性) */
/* =========================================================== */
.wechat-preview-container {
width: 100%;
height: 100%;
display: flex;
padding: 0;
box-sizing: border-box;
overflow: hidden;
}
/* =========================================================== */
/* Doc Modal 样式 */
/* =========================================================== */
.doc-modal {
width: 640px;
height: 720px;
}
.doc-modal-content {
display: grid;
grid-template-rows: auto auto 1fr;
row-gap: 8px;
min-height: 0;
}
.doc-modal-title {
margin-top: 0.5em;
}
.doc-modal-desc {
margin-bottom: 1em;
-webkit-user-select: text;
user-select: text;
}
.doc-modal-iframe {
min-height: 0;
}
/* =========================================================== */
/* Setting Tab 帮助文档样式 */
/* =========================================================== */
.setting-help-section {
display: grid;
grid-auto-flow: column;
align-items: center;
column-gap: 10px;
}
.setting-help-title {
margin-right: 10px;
}
/* =========================================================== */
/* Xiaohongshu WebView 样式 */
/* =========================================================== */
.xhs-webview {
display: none;
width: 1200px;
height: 800px;
}
/* =========================================================== */
/* 保留的 XHS 兼容样式 */
/* =========================================================== */
.xiaohongshu-preview-container {
width: 100%;
height: 100%;
display: flex;
padding: 0;
box-sizing: border-box;
overflow: hidden;
}
/* XHS 页面容器(保留用于内容渲染) */
.xhs-page-wrapper {
margin: 0 auto;
position: relative;
overflow: hidden;
display: block;
}
.xhs-page {
background: #ffffff;
box-shadow: 0 4px 12px rgba(0,0,0,0.1);
border-radius: 8px;
margin: 0;
}
.xhs-page img {
max-width: 100%;
height: auto;
}
/* =========================================================== */
/* Xiaohongshu Login Modal 样式 */
/* =========================================================== */
.xiaohongshu-login-modal {
width: 400px;
padding: 20px;
}
.xhs-login-title {
text-align: center;
margin-bottom: 20px;
color: #ff4757;
}
.xhs-login-desc {
text-align: center;
color: #666;
margin-bottom: 30px;
}
.xhs-code-container {
display: grid;
grid-template-columns: auto 1fr auto;
align-items: center;
gap: 10px;
margin-bottom: 20px;
}
.xhs-code-label {
min-width: 80px;
}
.xhs-code-input-wrapper {
flex: 1;
}
.xhs-input-full {
width: 100%;
font-size: 12px;
}
.xhs-send-code-btn {
min-width: 120px;
margin-left: 10px;
}
.xhs-status-message {
min-height: 30px;
margin-bottom: 20px;
text-align: center;
font-size: 12px;
}
.xhs-status-message.success {
color: #27ae60;
}
.xhs-status-message.error {
color: #e74c3c;
}
.xhs-status-message.info {
color: #3498db;
}
.xhs-button-container {
display: grid;
grid-auto-flow: column;
justify-content: center;
gap: 15px;
margin-top: 20px;
}
.xhs-login-btn {
min-width: 100px;
}