/* ===== 自助发布中心样式 ===== */
:root {
    --bg: #000814;
    --panel-bg: rgba(15, 22, 42, 0.88);
    --panel-border: rgba(255, 255, 255, 0.09);
    --text: #e8ecf5;
    --text-dim: #8a93a8;
    --accent: #4f6ef7;
    --accent-2: #7c4dff;
    --hl: #ff8787;
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent;}

html { height: 100%; overflow: hidden; }

body {
    height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background:
        radial-gradient(ellipse 900px 520px at 18% -8%, rgba(79, 110, 247, 0.16), transparent 62%),
        radial-gradient(ellipse 800px 500px at 88% 12%, rgba(124, 77, 255, 0.13), transparent 60%),
        var(--bg);
    color: var(--text);
    font-family: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
}

a { color: #7aa2ff; }

/* ===== 顶部导航 ===== */
.top-nav {
    position: sticky;
    top: 0;
    z-index: 200;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 26px;
    background: rgba(6, 10, 26, 0.82);
    border-bottom: 1px solid var(--panel-border);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.nav-home {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 16px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: #fff;
    font-size: 13.5px;
    font-weight: 600;
    text-decoration: none;
    transition: filter 0.2s, transform 0.2s;
    box-shadow: 0 4px 14px rgba(79, 110, 247, 0.35);
}

.nav-home:hover { filter: brightness(1.15); transform: translateY(-1px); }

.nav-user { display: flex; align-items: center; gap: 10px; }
.nav-nick { font-size: 13.5px; color: #c3cadb; }
.nav-login {
    padding: 8px 16px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--panel-border);
    color: #c3cadb;
    font-size: 13.5px;
    text-decoration: none;
    transition: background 0.2s;
}
.nav-login:hover { background: rgba(255, 255, 255, 0.15); }

/* ===== 实时预览：悬浮卡片 ===== */
/* 触发按钮：固定在视口左上角 */
.preview-open-btn {
    position: fixed;
    right: 20px;
    top: 72px;
    z-index: 101;
    padding: 10px 18px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 12px;
    background: rgba(15, 22, 42, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: #c3cadb;
    font-size: 13.5px;
    font-weight: 600;
    letter-spacing: 1px;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
    transition: background 0.2s, color 0.2s, transform 0.2s;
}

.preview-open-btn:hover {
    background: rgba(30, 40, 72, 0.92);
    color: #fff;
    transform: translateY(-1px);
}

/* 预览容器：透明无背景，尺寸仅包住卡片，从左上角弹出 */
.preview-container {
    position: fixed;
    left: 20px;
    top: 72px;
    z-index: 102;
    width: 320px;
    max-width: calc(100vw - 32px);
    transform-origin: top left;
    transition: transform 0.38s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.22s ease;
}

.preview-container.hide {
    transform: scale(0);
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
    transition: transform 0.24s ease-in, opacity 0.24s ease-in, visibility 0s linear 0.24s;
}

/* ===== 预览卡：1:1 复刻首页 .card / .card.vip，保证所见即所得 ===== */
@keyframes setIconSpin {
    0%   { transform: rotate(0deg) scale(1); }
    50%  { transform: rotate(180deg) scale(1.1); }
    100% { transform: rotate(360deg) scale(1); }
}

@keyframes setCarousel360 {
    0%   { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.preview-card {
    position: relative;
    z-index: 0;
    background: #fff;
    border-radius: 10px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
    transition: transform 0.25s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow: visible;
    min-height: 380px;
    max-height: 380px;
    width: 100%;
    max-width: 320px;
}

.preview-card:hover {
    transform: translate3d(0, -6px, 0);
}

/* VIP 渐变边框层：与首页 .card .fancy-border 完全同构 */
.preview-card .fancy-border {
    display: none;
    position: absolute;
    top: -6px;
    left: -6px;
    right: -6px;
    bottom: -6px;
    border-radius: 13px;
    z-index: -1;
    overflow: hidden;
}

.preview-card.vip .fancy-border { display: block; }

.preview-card .fancy-border::before {
    content: '';
    position: absolute;
    z-index: 0;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: var(--vip-border-color, linear-gradient(25deg, #c71585, #00bfff, #ff0000, #ffa500, #008000, #32cd32, #c71585));
}

.preview-card .fancy-border.marquee::before { animation: setCarousel360 8s linear infinite; }

.preview-card .fancy-border::after {
    content: '';
    position: absolute;
    top: 5px;
    left: 5px;
    right: 5px;
    bottom: 5px;
    background: var(--vip-bg-color, linear-gradient(-35deg, #fff, #fff));
    border-radius: 10px;
    z-index: 10;
}

/* 右上角 VIP 角标：与首页 .vip-text 一致 */
.preview-card .vip-text {
    display: none;
    pointer-events: none;
    position: absolute;
    z-index: 12;
    top: 10px;
    right: 10px;
}

.preview-card .vip-text::after {
    content: 'VIP';
    position: absolute;
    right: 0;
    top: 0;
    padding: 1px 10px;
    white-space: nowrap;
    font-size: 1rem;
    font-weight: bold;
    text-shadow: 0 0 2px rgba(0, 0, 0, 0.5);
    border-radius: 5px;
    color: red;
    background-color: #fff;
}

/* 标题行：与首页 .card .title-box 一致 */
.preview-card .title-box {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    margin-bottom: 20px;
    gap: 10px;
    overflow: hidden;
    position: relative;
    z-index: 11;
}

.preview-card .title-box img {
    width: 50px;
    height: 50px;
    min-width: 50px;
    min-height: 50px;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.preview-card .title-box img.rotate360 { animation: setIconSpin 3s linear infinite; }

.preview-card .title-box .title {
    font-size: 1.1rem;
    color: var(--vip-title-cl, #2d3748);
    font-weight: bold;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 内容区：与首页 .card .content-box 一致（紫色渐变徽章 label） */
.preview-card .content-box {
    width: 100%;
    overflow: hidden;
    position: relative;
    z-index: 11;
}

.preview-card .content-box .label {
    display: inline-block;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    box-shadow: 0 2px 6px rgba(102, 126, 234, 0.2);
    white-space: nowrap;
    margin-bottom: 6px;
}

.preview-card .content-box .content-item {
    display: block;
    margin-bottom: 12px;
    width: 100%;
    min-height: 100px;
    position: relative;
    z-index: 11;
}

.preview-card .content-box .content-text {
    color: var(--vip-text-cl, #718096);
    font-size: 14px;
    line-height: 1.6;
    word-wrap: break-word;
    overflow-wrap: break-word;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    white-space: normal;
    user-select: text;
}

/* 「了解更多」：与首页 .card-link 一致 */
.preview-card .card-link {
    display: inline-flex;
    align-items: center;
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    position: relative;
    z-index: 11;
}

.preview-card .card-link::after {
    content: '→';
    margin-left: 8px;
    transition: transform 0.3s ease;
}

.preview-card:hover .card-link::after { transform: translateX(3px); }

/* ===== 主体（滚动区，页面本身不滚动） ===== */
.container {
    max-width: 780px;
    width: 100%;
    margin: 0 auto;
    padding: 44px 22px 90px;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: rgba(122, 162, 255, 0.35) transparent;
}

.container::-webkit-scrollbar { width: 8px; }
.container::-webkit-scrollbar-thumb { background: rgba(122, 162, 255, 0.3); border-radius: 4px; }
.container::-webkit-scrollbar-track { background: transparent; }

.header { text-align: center; margin-bottom: 32px; }
.header h1 {
    font-size: 27px;
    margin-bottom: 10px;
    background: linear-gradient(135deg, #fff 30%, #9db4ff 70%, #c9a7ff);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.header p { color: var(--text-dim); font-size: 14px; }
.header .login-state { margin-top: 12px; }
.header .login-state.ok { color: #3dd68c; }

/* ===== 设置面板（分组玻璃卡片） ===== */
.settings-panel { display: flex; flex-direction: column; gap: 20px; }

.setting-group {
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    border-radius: 16px;
    padding: 24px 26px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.28);
    transition: border-color 0.25s, transform 0.25s;
}

.setting-group:hover { border-color: rgba(122, 162, 255, 0.32); }

.setting-group h3 {
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 15.5px;
    color: #dfe6f5;
    margin-bottom: 18px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--panel-border);
}

.g-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 9px;
    background: linear-gradient(135deg, rgba(79, 110, 247, 0.22), rgba(124, 77, 255, 0.22));
    border: 1px solid rgba(122, 162, 255, 0.25);
    font-size: 15px;
}

.setting-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 11px 0;
    flex-wrap: wrap;
}

.setting-item.sub {
    margin: 2px 0 6px;
    padding: 13px 14px;
    background: rgba(0, 0, 0, 0.22);
    border-left: 2px solid var(--accent);
    border-radius: 0 10px 10px 0;
}

.setting-item.color-row { flex-direction: column; align-items: stretch; gap: 8px; }

.setting-label { font-size: 14px; color: #c3cadb; min-width: 140px; }
.setting-label.sm { min-width: 0; font-size: 13px; color: var(--text-dim); }

.label-sub { font-size: 12px; color: #6a7390; margin-top: 3px; font-weight: normal; }

.setting-control { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.setting-control.full { width: 100%; }

.url-row { justify-content: flex-start; white-space: nowrap; flex-wrap: wrap; }
.url-row .input-value { flex: 1; min-width: 220px; }
.inline-label { font-size: 13.5px; color: var(--text-dim); }

/* ===== 输入控件 ===== */
.input-value, .setting-control input[type="text"] {
    padding: 11px 14px;
    background: rgba(0, 0, 0, 0.32);
    border: 1px solid var(--panel-border);
    border-radius: 9px;
    color: var(--text);
    font-size: 13.5px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    width: 100%;
}

.input-value:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(79, 110, 247, 0.18);
}
.input-value::placeholder { color: #5a647c; }
.input-value[readonly] { opacity: 0.85; }

/* 注意事项提示卡 */
.notice {
    margin: 4px 0 10px;
    padding: 12px 16px;
    background: rgba(255, 107, 107, 0.07);
    border: 1px solid rgba(255, 107, 107, 0.22);
    border-radius: 10px;
    font-size: 13px;
    color: #93a0bd;
    line-height: 1.9;
}

.notice-title { color: #ff8787; font-weight: 600; margin-bottom: 4px; }
.notice ul { list-style: none; }
.notice li { padding-left: 16px; position: relative; }
.notice li::before { content: '·'; position: absolute; left: 4px; color: var(--accent); font-weight: bold; }
.hl { color: var(--hl); }
.emoji { margin-left: 8px; }
.arrow { color: #6a7390; }

.icon-slot { font-size: 13px; color: #6a7390; display: flex; align-items: center; min-height: 48px; }
.icon-slot img { max-width: 44px; max-height: 44px; border-radius: 8px; background: #fff; padding: 2px; }

.preview-btn {
    padding: 11px 18px;
    border: 0;
    border-radius: 9px;
    font-size: 13.5px;
    cursor: pointer;
    transition: filter 0.2s, transform 0.15s;
    flex-shrink: 0;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: #fff;
    box-shadow: 0 4px 14px rgba(79, 110, 247, 0.3);
}

.preview-btn:hover { filter: brightness(1.15); transform: translateY(-1px); }
.preview-btn:disabled { filter: grayscale(0.7); cursor: not-allowed; transform: none; }

/* 文本域 + 字符计数 */
.textarea-wrapper { position: relative; width: 100%; }

.textarea-wrapper textarea {
    width: 100%;
    min-height: 74px;
    padding: 11px 14px 26px;
    background: rgba(0, 0, 0, 0.32);
    border: 1px solid var(--panel-border);
    border-radius: 9px;
    color: var(--text);
    font-size: 13.5px;
    line-height: 1.6;
    resize: vertical;
    outline: none;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.textarea-wrapper textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(79, 110, 247, 0.18);
}
.textarea-wrapper textarea::placeholder { color: #5a647c; }
.textarea-wrapper textarea[readonly] { opacity: 0.85; }

.char-counter {
    position: absolute;
    right: 10px;
    bottom: 8px;
    font-size: 11.5px;
    color: #6a7390;
}

/* ===== 开关 ===== */
.toggle-switch {
    width: 48px;
    height: 26px;
    border-radius: 13px;
    background: #2a3352;
    position: relative;
    cursor: pointer;
    transition: background 0.25s;
    flex-shrink: 0;
}

.toggle-switch::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #8a93a8;
    transition: all 0.25s;
}

.toggle-switch.active {
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    box-shadow: 0 0 12px rgba(79, 110, 247, 0.45);
}
.toggle-switch.active::after { left: 25px; background: #fff; }

/* ===== 颜色选择 ===== */
.color-picker-wrapper { display: flex; align-items: center; gap: 8px; }

.color-picker {
    width: 40px;
    height: 32px;
    border: 1px solid var(--panel-border);
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.3);
    cursor: pointer;
    padding: 2px;
    transition: transform 0.15s;
}

.color-picker:hover { transform: scale(1.08); }

.color-value { font-size: 12px; color: var(--text-dim); font-family: Consolas, monospace; min-width: 62px; }

.gradient-preview {
    width: 86px;
    height: 26px;
    border-radius: 7px;
    border: 1px solid var(--panel-border);
    background: linear-gradient(90deg, var(--c1, #f00), var(--c2, #0cf));
}

/* ===== 代码块 ===== */
.code-block {
    background: #0b1124;
    border: 1px solid #232c47;
    border-radius: 12px;
    margin-top: 14px;
    overflow: hidden;
}

.code-header {
    background: #131a33;
    padding: 10px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #232c47;
}

.code-title { color: #fff; font-size: 13px; font-weight: 600; }
.code-lang {
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: #fff;
    padding: 2px 10px;
    border-radius: 5px;
    font-size: 11.5px;
}

.code-content {
    margin: 0;
    padding: 13px 15px;
    overflow-x: auto;
}

.code-content code {
    font-family: Consolas, Monaco, monospace;
    font-size: 12.5px;
    line-height: 1.6;
    color: #9ecbff;
    white-space: pre;
}

/* ===== 发布按钮 ===== */
.save-button {
    width: 100%;
    margin-top: 6px;
    padding: 15px;
    border: 0;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: #fff;
    font-size: 15.5px;
    font-weight: 600;
    letter-spacing: 4px;
    cursor: pointer;
    transition: filter 0.2s, transform 0.15s, box-shadow 0.2s;
    box-shadow: 0 8px 24px rgba(79, 110, 247, 0.35);
}

.save-button:hover {
    filter: brightness(1.12);
    transform: translateY(-1px);
    box-shadow: 0 10px 30px rgba(79, 110, 247, 0.5);
}
.save-button:active { transform: scale(0.99); }
.save-button:disabled { filter: grayscale(0.7); cursor: not-allowed; transform: none; }

/* 状态提示 */
.status-message {
    margin-top: 14px;
    min-height: 22px;
    text-align: center;
    font-size: 13.5px;
    opacity: 0;
    transition: opacity 0.3s;
}

.status-message.show { opacity: 1; }
.status-message.success { color: #3dd68c; }
.status-message.error { color: #ff5c5c; }

/* ===== 响应式 ===== */
@media (max-width: 640px) {
    .preview-open-btn { right: 10px; top: auto; bottom: 10px; padding: 8px 6px; width: auto;}
    .preview-container { left: 14px; top: 66px; width: calc(100vw - 28px); }
    .setting-label { min-width: 100%; }
    .setting-control { width: 100%; }
    .setting-group { padding: 18px 16px; }
    .container { padding: 30px 14px 70px; }
    .header h1 { font-size: 22px; }
}
