* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background: #e9eef5;
    color: #1d2a34;
}

a { color: #1a3d8f; }

.page-wrap {
    max-width: 1200px;
    margin: 18px auto;
    background: #fff;
    border: 1px solid #b8c9da;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}

.portal-header {
    position: relative;
    padding: 12px 16px 18px;
    background: linear-gradient(180deg, #f6fbff 0%, #ddebf7 100%);
    border-bottom: 1px solid #b8c9da;
}

.translate-box {
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: flex-end;
    font-size: 13px;
    margin-bottom: 6px;
}

.logo-area {
    min-height: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.company-logo {
    max-width: 100%;
    max-height: 90px;
    object-fit: contain;
}

.animated-svg-logo {
    width: 100%;
    max-width: 950px;
    height: 90px;
    overflow: visible;
}

.animated-svg-logo text {
    font-size: 40px;
    font-weight: 700;
    fill: url(#logoGradient);
    stroke: #7ab8e4;
    stroke-width: 1.2;
    letter-spacing: 1px;
    filter: drop-shadow(0 3px 4px rgba(0,0,0,.15));
    animation: shimmer 3s ease-in-out infinite alternate;
}

.logo-upload-box {
    margin-top: 10px;
    display: flex;
    justify-content: flex-end;
}

.main-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    min-height: 620px;
}

.sidebar {
    background: #eef3f9;
    border-right: 1px solid #b8c9da;
    padding: 18px 14px;
}

.menu-block {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 26px;
}

.menu-block a {
    text-decoration: none;
    padding: 9px 12px;
    background: #fff;
    border: 1px solid #c5d3df;
    border-radius: 8px;
    font-weight: 700;
}

.menu-block a.active,
.menu-block a:hover {
    background: #dbeaff;
    color: #572c93;
}

.admin-box,
.notice,
.chat-card,
.history-item,
.logo-upload-box,
.editor-form,
.portal-content,
.chatbot-panel {
    border-radius: 12px;
}

.admin-box {
    background: #fff;
    border: 1px solid #c5d3df;
    padding: 14px;
}

.stack-form,
.chat-form,
.editor-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

input[type="text"],
input[type="password"],
input[type="file"],
textarea,
button {
    font: inherit;
}

input[type="text"],
input[type="password"],
input[type="file"] {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #bfcdd9;
    border-radius: 8px;
    background: #fff;
}

button {
    align-self: flex-start;
    border: 0;
    background: #1f6fb2;
    color: #fff;
    padding: 10px 18px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 700;
}

button:hover { background: #15598f; }

.content-area {
    padding: 24px;
    background: #f7fbff;
}

.content-area h1 {
    margin-top: 0;
    margin-bottom: 18px;
    font-size: 28px;
}

.notice {
    padding: 12px 14px;
    margin-bottom: 16px;
}

.notice.success {
    background: #e6f8ea;
    border: 1px solid #aad4b1;
}

.notice.error {
    background: #ffe7e7;
    border: 1px solid #e8b1b1;
}

.portal-content,
.editor-form,
.chatbot-panel,
.history-item {
    background: #fff;
    border: 1px solid #c5d3df;
    padding: 18px;
}

.rich-content iframe {
    width: 100%;
    min-height: 420px;
    border: 0;
}

.rich-content img {
    max-width: 100%;
    height: auto;
}

.chatbot-panel {
    display: grid;
    grid-template-columns: 1.5fr 300px;
    gap: 20px;
    align-items: start;
}

.chat-card {
    background: #f7fbff;
    border: 1px solid #c4d8ea;
    padding: 14px;
    margin-top: 14px;
}

.bot-avatar {
    width: 100%;
    max-width: 220px;
    display: block;
    margin: 0 auto 12px;
}

.pulse-dot {
    transform-origin: center;
    animation: pulse 1.1s infinite alternate;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.history-meta {
    color: #5d6a75;
    font-size: 13px;
    margin-bottom: 8px;
}

.ck-editor__editable_inline {
    min-height: 380px;
}

@keyframes shimmer {
    from { opacity: 0.8; transform: translateY(0px); }
    to { opacity: 1; transform: translateY(-1px); }
}

@keyframes pulse {
    from { transform: scale(1); opacity: 0.8; }
    to { transform: scale(1.25); opacity: 1; }
}

@media (max-width: 900px) {
    .main-layout,
    .chatbot-panel {
        grid-template-columns: 1fr;
    }
}
