/* 托管页面样式 */
.host-page {
    padding: 40px 20px;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    background-color: #fff;
    border-radius: var(--border-radius-large);
    box-shadow: var(--apple-shadow);
    padding: 30px;
}

/* 标签页样式 */
.tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 30px;
}

.tab-btn {
    background: none;
    border: none;
    padding: 12px 20px;
    font-size: 16px;
    font-weight: 500;
    color: var(--text-color-secondary);
    cursor: pointer;
    position: relative;
    transition: color 0.3s;
}

.tab-btn:hover {
    color: var(--primary-color);
}

.tab-btn.active {
    color: var(--primary-color);
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--primary-color);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease-out;
}

/* 标题和描述 */
.tab-content h1 {
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--text-color);
}

.description {
    color: var(--text-color-secondary);
    margin-bottom: 30px;
}

/* 编辑器样式 */
.editor-container {
    margin-bottom: 20px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-base);
    overflow: hidden;
}

.CodeMirror {
    height: 400px;
    font-family: 'Menlo', 'Monaco', 'Courier New', monospace;
    font-size: 14px;
    background-color: #ffffff !important;
    color: #333333 !important;
    border: none;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05);
}

/* 自定义编辑器样式 */
.CodeMirror-gutters {
    background-color: #f8f9fa !important;
    border-right: 1px solid #e9ecef !important;
}

.CodeMirror-linenumber {
    color: #adb5bd !important;
}

.CodeMirror-cursor {
    border-left: 2px solid var(--primary-color) !important;
}

.CodeMirror-selected {
    background-color: rgba(66, 153, 225, 0.1) !important;
}

.CodeMirror-focused {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(66, 153, 225, 0.2);
}

/* 表单样式 */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-base);
    font-size: 16px;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus {
    border-color: var(--primary-color);
    outline: none;
}

.form-hint {
    font-size: 14px;
    color: var(--text-color-secondary);
    margin-top: 5px;
}

/* 按钮样式 */
.primary-btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--border-radius-base);
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.3s;
}

.primary-btn:hover {
    background-color: var(--primary-color-dark);
}

.primary-btn:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
}

/* 托管部分底部区域，包含按钮和广告 */
.host-section-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-top: 20px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .host-section-bottom {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }

    .host-section-bottom .primary-btn {
        width: 100%;
    }
}

/* 历史记录列表 */
.history-list {
    margin-top: 20px;
}

.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    margin-bottom: 15px;
    transition: transform 0.2s, box-shadow 0.2s;
    background-color: #fff;
}

.history-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.history-item-info {
    flex: 1;
}

.history-item-title {
    font-weight: 600;
    font-size: 16px;
    margin-bottom: 5px;
    color: #333;
}

.history-item-meta {
    display: flex;
    color: var(--text-color-secondary);
    font-size: 14px;
    flex-wrap: wrap;
    gap: 12px;
}

.history-item-meta span {
    display: flex;
    align-items: center;
}

.history-item-meta i {
    margin-right: 5px;
}

.history-item-actions {
    display: flex;
    gap: 8px;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
}

/* 移除不需要的样式 */
.action-group {
    display: none;
}

/* Apple风格按钮 */
.apple-btn {
    border: none;
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    background-color: #f5f5f7;
    color: #1d1d1f;
    white-space: nowrap;
    min-width: 0;
    flex-shrink: 1;
}

.apple-btn:hover {
    background-color: #e8e8ed;
}

.apple-btn:active {
    transform: scale(0.98);
}

/* 禁用状态的按钮 */
.apple-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* 删除按钮特殊样式 */
.delete-btn {
    color: #ff3b30;
}

.delete-btn:hover {
    background-color: #ffebeb;
}

/* 移除这些不需要的按钮样式 */
.view-btn,
.edit-btn,
.qrcode-btn,
.download-btn {
    background-color: #f5f5f7;
    color: #1d1d1f;
}

.view-btn:hover,
.edit-btn:hover,
.qrcode-btn:hover,
.download-btn:hover {
    background-color: #e8e8ed;
}

.loading {
    text-align: center;
    padding: 20px;
    color: var(--text-color-secondary);
}

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-color-secondary);
}

.empty-state p {
    margin-bottom: 20px;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .container {
        padding: 20px;
    }

    .history-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .history-item-actions {
        margin-top: 15px;
        width: 100%;
        overflow-x: auto;
        padding-bottom: 5px;
        -webkit-overflow-scrolling: touch;
        /* 提升iOS滚动体验 */
    }

    .apple-btn {
        font-size: 12px;
        padding: 6px 10px;
    }
}

/* 二维码弹窗样式 */
.qrcode-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.qrcode-modal-content {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    width: 90%;
    max-width: 400px;
    overflow: hidden;
}

.qrcode-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
}

.qrcode-modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: #333;
}

.qrcode-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #999;
}

.qrcode-modal-close:hover {
    color: #333;
}

.qrcode-modal-body {
    padding: 20px;
    text-align: center;
}

.qrcode-container {
    margin: 0 auto 15px;
    display: inline-block;
}

.qrcode-container canvas {
    display: block;
    margin: 0 auto;
}

.qrcode-url {
    margin: 10px 0 0;
    padding: 8px;
    background-color: #f5f5f7;
    border-radius: 4px;
    font-size: 14px;
    word-break: break-all;
    color: #666;
}

/* 二维码加载效果 */
.qrcode-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.qrcode-loading p {
    margin-top: 12px;
    color: #666;
    font-size: 14px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    border-top-color: #3498db;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* 密码显示样式 */
.history-item-meta strong {
    background-color: #f8f3e9;
    color: #d48806;
    padding: 1px 5px;
    border-radius: 3px;
    font-family: monospace;
    font-weight: 600;
    letter-spacing: 0.5px;
    border: 1px dashed #faad14;
}

/* 编辑弹框样式 */
.edit-form {
    width: 100%;
}

.edit-form .editor-container {
    margin: 15px 0;
}

.edit-form .CodeMirror {
    height: 300px;
}

.dialog-content {
    max-height: 80vh;
    overflow-y: auto;
    padding: 20px;
}

.dialog {
    width: 90%;
    max-width: 800px;
}

/* 移动端编辑操作按钮 */
.mobile-editor-actions {
    display: none;
    /* 默认隐藏，JS或媒体查询控制显示 */
    gap: 10px;
    margin-bottom: 15px;
}

.mobile-action-btn {
    flex: 1;
    padding: 10px 15px;
    border: none;
    background-color: var(--primary-color);
    color: white;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.mobile-action-btn:active {
    background-color: var(--primary-color-dark);
    transform: scale(0.98);
    box-shadow: none;
}

@media (max-width: 768px) {
    .mobile-editor-actions {
        display: flex !important;
    }
}

/* 封禁原因展示 */
.ban-reason-display {
    flex: 1;
    display: flex;
    align-items: center;
    padding: 8px 15px;
    background-color: #fff5f5;
    border: 1px solid #ffebee;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    min-width: 0;
}

.ban-reason-display:hover {
    background-color: #ffebee;
    border-color: #ff3b30;
}

.ban-reason-text {
    color: #ff3b30;
    font-size: 13px;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 快速理由选择 */
.quick-reasons-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-top: 8px;
}

.quick-reason-btn {
    padding: 8px 12px;
    background-color: #f5f5f7;
    border: 1px solid #d2d2d7;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
    color: #1d1d1f;
}

.quick-reason-btn:hover {
    background-color: #e8e8ed;
    border-color: #0071e3;
    color: #0071e3;
}

.quick-reason-btn:active {
    transform: scale(0.98);
}