/* 後台管理專用樣式 */

/* 登入頁面樣式 */
.login-body {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.login-container {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 400px;
    padding: 2rem;
}

.login-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 3rem 2rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-header h1 {
    color: var(--text-color);
    margin-bottom: 0.5rem;
    font-size: 2rem;
}

.login-header p {
    color: var(--text-muted);
    margin: 0;
}

.login-form .form-group {
    margin-bottom: 1.5rem;
}

.password-input {
    position: relative;
}

.password-toggle {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    color: var(--text-muted);
    padding: 0.25rem;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.password-toggle:hover {
    background: var(--background-alt);
    color: var(--text-color);
}

.login-btn {
    width: 100%;
    padding: 1rem;
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    position: relative;
}

.login-footer {
    border-top: 1px solid var(--border-light);
    padding-top: 1.5rem;
}

.demo-info {
    background: var(--background-alt);
    padding: 1rem;
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
    text-align: center;
}

.demo-info h4 {
    color: var(--text-color);
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.demo-info p {
    margin: 0.25rem 0;
    font-size: 0.85rem;
    color: var(--text-light);
}

.login-links {
    text-align: center;
}

.login-background {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
}

.bg-animation {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="20" cy="20" r="2" fill="rgba(255,255,255,0.1)" opacity="0.6"><animate attributeName="r" values="2;4;2" dur="3s" repeatCount="indefinite"/></circle><circle cx="80" cy="80" r="3" fill="rgba(255,255,255,0.1)" opacity="0.4"><animate attributeName="r" values="3;6;3" dur="4s" repeatCount="indefinite"/></circle><circle cx="40" cy="70" r="1" fill="rgba(255,255,255,0.1)" opacity="0.8"><animate attributeName="r" values="1;3;1" dur="2s" repeatCount="indefinite"/></circle></svg>');
    animation: float 20s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(180deg); }
}

/* 通知樣式 */
#notification-container {
    position: fixed;
    top: 2rem;
    right: 2rem;
    z-index: 10000;
}

.notification {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: white;
    border-radius: var(--radius-md);
    padding: 1rem 1.5rem;
    margin-bottom: 0.5rem;
    box-shadow: var(--shadow-lg);
    border-left: 4px solid var(--primary-color);
    animation: slideInFromRight 0.3s ease;
    min-width: 300px;
}

.notification.success {
    border-left-color: #48bb78;
}

.notification.error {
    border-left-color: #f56565;
}

.notification-icon {
    font-size: 1.2rem;
    flex-shrink: 0;
}

.notification-message {
    flex: 1;
    color: var(--text-color);
    font-weight: 500;
}

/* 後台佈局 */
.admin-container {
    display: flex;
    min-height: 100vh;
    background: var(--background-alt);
}

/* 側邊欄樣式 */
.sidebar {
    width: 280px;
    background: white;
    border-right: 1px solid var(--border-light);
    display: flex;
    flex-direction: column;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.05);
    position: relative;
    z-index: 1000;
    transition: var(--transition);
}

.sidebar.collapsed {
    width: 80px;
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-light);
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
}

.sidebar-header h2 {
    margin: 0 0 0.5rem 0;
    font-size: 1.5rem;
    font-weight: 700;
}

.sidebar-header span {
    font-size: 0.9rem;
    opacity: 0.9;
}

.sidebar-menu {
    flex: 1;
    padding: 1rem 0;
    list-style: none;
    margin: 0;
}

.sidebar-menu li {
    margin: 0.25rem 0;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    color: var(--text-light);
    text-decoration: none;
    transition: var(--transition);
    border-left: 3px solid transparent;
    position: relative;
}

.menu-item:hover {
    background: var(--background-alt);
    color: var(--text-color);
    text-decoration: none;
    border-left-color: var(--primary-color);
}

.menu-item.active {
    background: rgba(102, 126, 234, 0.1);
    color: var(--primary-color);
    border-left-color: var(--primary-color);
    font-weight: 600;
}

.menu-icon {
    font-size: 1.2rem;
    width: 24px;
    text-align: center;
    flex-shrink: 0;
}

.menu-text {
    flex: 1;
}

.sidebar.collapsed .menu-text {
    display: none;
}

.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid var(--border-light);
    background: var(--background-alt);
}

.view-site-btn,
.logout-btn {
    display: flex;
    align-items: center;
    gap: 1rem;
    width: 100%;
    padding: 0.75rem 1rem;
    background: none;
    border: none;
    color: var(--text-light);
    text-decoration: none;
    font-size: 0.9rem;
    border-radius: var(--radius-md);
    transition: var(--transition);
    cursor: pointer;
    margin-bottom: 0.5rem;
}

.view-site-btn:hover,
.logout-btn:hover {
    background: var(--background-color);
    color: var(--text-color);
    text-decoration: none;
}

.logout-btn:hover {
    background: rgba(245, 101, 101, 0.1);
    color: #f56565;
}

/* 主要內容區域 */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    overflow: hidden;
}

/* 頂部導航欄 */
.top-bar {
    background: white;
    border-bottom: 1px solid var(--border-light);
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 999;
}

.sidebar-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--radius-sm);
    color: var(--text-color);
    transition: var(--transition);
}

.sidebar-toggle:hover {
    background: var(--background-alt);
}

#section-title {
    flex: 1;
    margin: 0;
    color: var(--text-color);
    font-size: 1.5rem;
}

.top-bar-actions {
    display: flex;
    gap: 0.5rem;
}

/* 內容區域 */
.content-section {
    display: none;
    flex: 1;
    padding: 2rem;
    overflow-y: auto;
    animation: fadeIn 0.3s ease;
}

.content-section.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.section-header h2 {
    margin: 0;
    color: var(--text-color);
    font-size: 2rem;
}

.header-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* 概覽統計卡片 */
.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
    display: flex;
    align-items: center;
    gap: 1rem;
    border: 1px solid var(--border-light);
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.stat-icon {
    font-size: 2.5rem;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 50%;
    color: white;
    text-shadow: 0 1px 3px rgba(0,0,0,0.3);
    flex-shrink: 0;
}

.stat-info {
    flex: 1;
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-color);
    line-height: 1;
    margin-bottom: 0.25rem;
}

.stat-label {
    color: var(--text-light);
    font-size: 0.9rem;
}

/* 概覽網格 */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
}

.dashboard-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-light);
}

.dashboard-card h3 {
    margin-bottom: 1rem;
    color: var(--text-color);
    border-bottom: 1px solid var(--border-light);
    padding-bottom: 0.5rem;
}

.quick-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

.quick-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1.5rem 1rem;
    background: var(--background-alt);
    border: 2px solid var(--border-light);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    color: var(--text-color);
}

.quick-action-btn:hover {
    background: var(--primary-color);
    color: white;
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.quick-action-btn .icon {
    font-size: 2rem;
}

/* 內容標籤頁 */
.content-tabs {
    display: flex;
    border-bottom: 2px solid var(--border-light);
    margin-bottom: 2rem;
    gap: 0.5rem;
}

.tab-btn {
    padding: 1rem 1.5rem;
    background: none;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: var(--transition);
    font-weight: 500;
}

.tab-btn:hover {
    color: var(--text-color);
    background: var(--background-alt);
}

.tab-btn.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    background: var(--background-alt);
}

.tab-content {
    position: relative;
}

.tab-panel {
    display: none;
    animation: fadeIn 0.3s ease;
}

.tab-panel.active {
    display: block;
}

/* 編輯器樣式 */
.editor-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    height: 600px;
}

.editor-toolbar {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    padding: 1rem;
    background: var(--background-alt);
    border-radius: var(--radius-md);
    flex-wrap: wrap;
}

#content-editor {
    width: 100%;
    height: 100%;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1rem;
    font-family: var(--font-family-mono);
    font-size: 0.9rem;
    line-height: 1.6;
    resize: none;
    background: white;
}

.editor-preview {
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    background: white;
    display: flex;
    flex-direction: column;
}

.editor-preview h4 {
    padding: 1rem;
    margin: 0;
    background: var(--background-alt);
    border-bottom: 1px solid var(--border-light);
    border-radius: var(--radius-md) var(--radius-md) 0 0;
}

#preview-content {
    flex: 1;
    padding: 1rem;
    overflow-y: auto;
}

/* 媒體庫樣式 */
.media-library {
    background: white;
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
}

.media-upload {
    margin-bottom: 2rem;
}

.media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
}

.media-item {
    background: var(--background-alt);
    border-radius: var(--radius-md);
    padding: 1rem;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    border: 2px solid var(--border-light);
}

.media-item:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

.media-item img {
    width: 100%;
    height: 100px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    margin-bottom: 0.5rem;
}

.media-item-name {
    font-size: 0.85rem;
    color: var(--text-light);
    word-break: break-all;
}

/* 模板管理樣式 */
.templates-manager {
    background: white;
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
}

.template-actions {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.templates-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.template-item {
    background: var(--background-alt);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    border: 2px solid var(--border-light);
    transition: var(--transition);
    cursor: pointer;
}

.template-item:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

.template-name {
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 0.5rem;
}

.template-description {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.template-actions-small {
    display: flex;
    gap: 0.5rem;
}

/* 導航管理樣式 */
.navigation-manager {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    height: 600px;
}

.nav-preview,
.nav-editor {
    background: white;
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
    display: flex;
    flex-direction: column;
}

.nav-preview h4,
.nav-editor h4 {
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-light);
}

.nav-preview-container {
    flex: 1;
    overflow-y: auto;
    background: var(--background-alt);
    border-radius: var(--radius-md);
    padding: 1rem;
}

#nav-preview-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

#nav-preview-list li {
    margin-bottom: 0.5rem;
}

#nav-preview-list a {
    display: block;
    padding: 0.5rem 1rem;
    background: white;
    border-radius: var(--radius-sm);
    color: var(--text-color);
    text-decoration: none;
    transition: var(--transition);
}

#nav-preview-list a:hover {
    background: var(--primary-color);
    color: white;
}

.nav-controls {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.nav-items-container {
    flex: 1;
    overflow-y: auto;
}

.sortable-nav {
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-item {
    background: var(--background-alt);
    border: 2px solid var(--border-light);
    border-radius: var(--radius-md);
    margin-bottom: 0.5rem;
    padding: 1rem;
    cursor: move;
    transition: var(--transition);
}

.nav-item:hover {
    border-color: var(--primary-color);
}

.nav-item.dragging {
    opacity: 0.5;
    transform: rotate(2deg);
}

.nav-item-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.nav-item-title {
    font-weight: 600;
    color: var(--text-color);
}

.nav-item-actions {
    display: flex;
    gap: 0.25rem;
}

.nav-item-form {
    display: none;
    grid-template-columns: 1fr 1fr auto;
    gap: 0.5rem;
    align-items: center;
    margin-top: 0.5rem;
}

.nav-item-form.active {
    display: grid;
}

.nav-item-form input {
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
}

/* 頁面管理網格 */
#pages-management-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.page-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
    border: 2px solid var(--border-light);
    transition: var(--transition);
}

.page-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.page-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.page-card-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-color);
    margin: 0 1rem 0 0;
    line-height: 1.3;
}

.page-card-actions {
    display: flex;
    gap: 0.25rem;
    flex-shrink: 0;
}

.page-card-content {
    margin-bottom: 1rem;
}

.page-card-subtitle {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.page-card-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.page-card-footer {
    border-top: 1px solid var(--border-light);
    padding-top: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.page-status {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.8rem;
    font-weight: 500;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
}

.page-status.published {
    background: rgba(72, 187, 120, 0.1);
    color: #38a169;
}

.page-status.draft {
    background: rgba(237, 137, 54, 0.1);
    color: #c05621;
}

/* 設定區域樣式 */
.settings-container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.settings-section {
    background: white;
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-light);
}

.settings-section h3 {
    margin-bottom: 1.5rem;
    color: var(--text-color);
    border-bottom: 1px solid var(--border-light);
    padding-bottom: 0.5rem;
}

.settings-section .form-group {
    margin-bottom: 1.5rem;
}

.theme-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.color-settings {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.color-settings input[type="color"] {
    width: 60px;
    height: 40px;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
}

/* 響應式設計 */
@media (max-width: 1024px) {
    .sidebar {
        position: fixed;
        left: -280px;
        top: 0;
        bottom: 0;
        z-index: 1001;
    }
    
    .sidebar.active {
        left: 0;
    }
    
    .sidebar-toggle {
        display: block;
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .editor-container {
        grid-template-columns: 1fr;
        height: auto;
    }
    
    .navigation-manager {
        grid-template-columns: 1fr;
        height: auto;
    }
    
    .theme-options {
        grid-template-columns: 1fr;
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    .quick-actions {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .content-section {
        padding: 1rem;
    }
    
    .top-bar {
        padding: 1rem;
    }
    
    .section-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .dashboard-stats {
        grid-template-columns: 1fr;
    }
    
    .stat-card {
        flex-direction: column;
        text-align: center;
    }
    
    .template-actions,
    .nav-controls {
        flex-direction: column;
    }
    
    .color-settings {
        grid-template-columns: 1fr;
    }
    
    .quick-actions {
        grid-template-columns: 1fr;
    }
    
    .modal-footer {
        flex-direction: column;
    }
    
    #pages-management-grid {
        grid-template-columns: 1fr;
    }
    
    .page-card-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .page-card-actions {
        margin-top: 1rem;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .login-container {
        padding: 1rem;
    }
    
    .login-card {
        padding: 2rem 1.5rem;
    }
    
    .sidebar {
        width: 100%;
        left: -100%;
    }
    
    .content-section {
        padding: 0.5rem;
    }
    
    .top-bar {
        padding: 0.5rem;
    }
    
    #section-title {
        font-size: 1.2rem;
    }
    
    .settings-section {
        padding: 1rem;
    }
    
    .stat-card {
        padding: 1rem;
    }
    
    .stat-icon {
        width: 50px;
        height: 50px;
        font-size: 2rem;
    }
    
    .stat-number {
        font-size: 1.5rem;
    }
}

/* 側邊欄遮罩 */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: none;
    backdrop-filter: blur(2px);
}

.sidebar-overlay.active {
    display: block;
}

/* 載入狀態 */
.btn.loading {
    pointer-events: none;
    opacity: 0.7;
}

.btn.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* 拖拽狀態 */
.dragging {
    opacity: 0.7 !important;
    transform: rotate(2deg) !important;
    z-index: 1000 !important;
}

.drag-over {
    background: rgba(102, 126, 234, 0.1) !important;
    border-color: var(--primary-color) !important;
}

/* 空狀態 */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-muted);
}

.empty-state .empty-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state h3 {
    color: var(--text-light);
    margin-bottom: 0.5rem;
}

.empty-state p {
    margin-bottom: 2rem;
    line-height: 1.6;
}

/* 表單驗證樣式 */
.form-group.error input,
.form-group.error textarea,
.form-group.error select {
    border-color: #f56565;
    box-shadow: 0 0 0 3px rgba(245, 101, 101, 0.1);
}

.form-group.success input,
.form-group.success textarea,
.form-group.success select {
    border-color: #48bb78;
    box-shadow: 0 0 0 3px rgba(72, 187, 120, 0.1);
}

.error-message {
    color: #f56565;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

.success-message {
    color: #48bb78;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* 內容管理樣式 */
.content-editor-section {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.05);
    margin-bottom: 2rem;
}

.editor-tabs {
    display: flex;
    border-bottom: 1px solid #e2e8f0;
    padding: 0 1.5rem;
}

.editor-tab {
    padding: 1rem 1.5rem;
    background: none;
    border: none;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.3s ease;
    color: #64748b;
    font-weight: 500;
}

.editor-tab.active {
    color: #667eea;
    border-bottom-color: #667eea;
}

.editor-tab:hover {
    color: #667eea;
    background: #f8fafc;
}

.editor-tab-content {
    display: none;
    padding: 1.5rem;
}

.editor-tab-content.active {
    display: block;
}

/* 編輯器工具欄 */
.editor-toolbar {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px 8px 0 0;
    flex-wrap: wrap;
}

.toolbar-group {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.toolbar-btn {
    padding: 0.5rem 0.75rem;
    background: white;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

.toolbar-btn:hover {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

/* 編輯器內容 */
.editor-content {
    display: flex;
    gap: 1.5rem;
}

.editor-sidebar {
    flex: 0 0 300px;
    background: #f8fafc;
    padding: 1.5rem;
    border-radius: 8px;
}

.editor-main {
    flex: 1;
}

#content-editor {
    width: 100%;
    height: 400px;
    padding: 1rem;
    border: 1px solid #d1d5db;
    border-radius: 0 0 8px 8px;
    border-top: none;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 14px;
    line-height: 1.5;
    resize: vertical;
}

#content-editor:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* 標籤輸入 */
.tag-input-container {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.tag-input-container input {
    flex: 1;
    padding: 0.5rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
}

.tag-input-container .btn {
    padding: 0.5rem 1rem;
    white-space: nowrap;
}

/* 標籤列表 */
.categories-list,
.tags-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tag-item {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.75rem;
    background: #e0e7ff;
    color: #3730a3;
    border-radius: 20px;
    font-size: 0.875rem;
}

.category-tag {
    background: #fef3c7;
    color: #92400e;
}

.tag-remove {
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    font-size: 1.2rem;
    line-height: 1;
    opacity: 0.7;
}

.tag-remove:hover {
    opacity: 1;
}

/* 編輯器動作 */
.editor-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    padding: 1.5rem;
    border-top: 1px solid #e2e8f0;
}

/* 預覽容器 */
.preview-container {
    max-height: 500px;
    overflow-y: auto;
    padding: 1.5rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: white;
}

.preview-container h1,
.preview-container h2,
.preview-container h3,
.preview-container h4 {
    margin-top: 0;
    margin-bottom: 1rem;
}

.preview-container p {
    margin-bottom: 1rem;
    line-height: 1.6;
}

.preview-container code {
    background: #f1f5f9;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
}

.preview-container pre {
    background: #1e293b;
    color: #f1f5f9;
    padding: 1rem;
    border-radius: 8px;
    overflow-x: auto;
}

/* 媒體上傳區域 */
.media-upload-area {
    border: 2px dashed #d1d5db;
    border-radius: 12px;
    padding: 3rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 2rem;
}

.media-upload-area:hover,
.media-upload-area.dragover {
    border-color: #667eea;
    background: #f0f4ff;
}

.upload-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.upload-text p {
    font-size: 1.125rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.5rem;
}

.upload-text small {
    color: #6b7280;
}

/* 媒體網格 */
.media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
}

/* 模板網格 */
.templates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
}

.template-card {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.template-card:hover {
    border-color: #667eea;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
    transform: translateY(-2px);
}

.template-preview {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.template-info h4 {
    margin-bottom: 0.5rem;
    color: #374151;
}

.template-info p {
    color: #6b7280;
    font-size: 0.875rem;
}

/* 內容列表 */
.content-list-section {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.05);
    padding: 1.5rem;
}

.content-filters {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.content-filters input,
.content-filters select {
    padding: 0.5rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    min-width: 200px;
}

.content-items {
    display: grid;
    gap: 1rem;
}

.content-item {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 1.5rem;
    transition: all 0.3s ease;
}

.content-item:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.content-item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.content-item-header h4 {
    margin: 0;
    color: #374151;
}

.content-item-actions {
    display: flex;
    gap: 0.5rem;
}

.content-item-meta {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.content-target {
    background: #f3f4f6;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.875rem;
    color: #374151;
}

.content-status {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
}

.content-status.published {
    background: #d1fae5;
    color: #065f46;
}

.content-status.draft {
    background: #fef3c7;
    color: #92400e;
}

.content-featured {
    background: #fde68a;
    color: #92400e;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
}

.content-item-excerpt {
    color: #6b7280;
    line-height: 1.5;
    margin-bottom: 1rem;
}

.content-item-footer {
    border-top: 1px solid #f3f4f6;
    padding-top: 1rem;
}

/* 響應式設計 */
@media (max-width: 768px) {
    .editor-content {
        flex-direction: column;
    }
    
    .editor-sidebar {
        flex: none;
    }
    
    .toolbar-group {
        width: 100%;
        justify-content: space-between;
    }
    
    .content-filters {
        flex-direction: column;
    }
    
    .content-filters input,
    .content-filters select {
        min-width: auto;
        width: 100%;
    }
}