/* Word Editor v2 — word-editor.css */

#we-wrap {
    position: relative;
    max-width: 960px;
    margin: 0 auto;
    min-height: 500px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: #1a1a1a;
}

/* ── Upload panel ── */
#we-upload-panel { padding: 40px 20px; }

#we-drop-zone {
    border: 2px dashed #d1d5db;
    border-radius: 14px;
    padding: 64px 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #fafafa;
}
#we-drop-zone:hover,
#we-drop-zone.we-drag-over {
    border-color: #2563eb;
    background: #eff6ff;
}
.we-drop-icon { color: #9ca3af; margin-bottom: 18px; transition: color 0.2s; }
#we-drop-zone:hover .we-drop-icon,
#we-drop-zone.we-drag-over .we-drop-icon { color: #2563eb; }
.we-drop-title { font-size: 19px; font-weight: 600; color: #374151; margin: 0 0 7px; }
.we-drop-sub   { font-size: 13px; color: #9ca3af; margin: 0; }

/* ── Editor panel ── */
#we-editor-panel {
    flex-direction: column;
    height: calc(100vh - 100px);
    min-height: 640px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 2px 12px rgba(0,0,0,0.07);
}

/* ── Toolbar ── */
#we-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 11px 18px;
    background: #1e293b;
    flex-shrink: 0;
}
#we-doc-name {
    font-size: 13px;
    font-weight: 600;
    color: #e2e8f0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 380px;
}
#we-toolbar-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}
#we-edit-badge {
    font-size: 12px;
    color: #fbbf24;
    font-weight: 500;
}

/* ── Buttons ── */
.we-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border-radius: 7px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: all 0.15s;
    white-space: nowrap;
    font-family: inherit;
}
.we-btn-ghost {
    background: transparent;
    color: #94a3b8;
    border: 1px solid #334155;
}
.we-btn-ghost:hover { background: #334155; color: #e2e8f0; }
.we-btn-primary     { background: #2563eb; color: #fff; }
.we-btn-primary:hover { background: #1d4ed8; }

/* ── Info bar ── */
#we-infobar {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 6px 18px;
    background: #f8fafc;
    border-bottom: 1px solid #e5e7eb;
    font-size: 12px;
    color: #64748b;
    flex-shrink: 0;
}
.we-info-edited { color: #d97706; font-weight: 600; }
.we-info-hint   { margin-left: auto; color: #94a3b8; font-style: italic; }

/* ── Doc area + iframe ── */
#we-doc-area {
    flex: 1;
    overflow: hidden;
    background: #f1f5f9;
    display: flex;
    align-items: stretch;
    padding: 20px;
}
#we-doc-frame-wrap {
    flex: 1;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 6px rgba(0,0,0,0.08);
    overflow: hidden;
}
#we-doc-iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

/* ── Loading overlay ── */
#we-loading {
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,0.93);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    z-index: 100;
    border-radius: 12px;
}
.we-spinner {
    width: 38px; height: 38px;
    border: 3px solid #e2e8f0;
    border-top-color: #2563eb;
    border-radius: 50%;
    animation: we-spin 0.7s linear infinite;
}
@keyframes we-spin { to { transform: rotate(360deg); } }
#we-loading-msg { font-size: 14px; color: #475569; margin: 0; }

/* ── Toast ── */
#we-toast {
    position: fixed;
    bottom: 24px; right: 24px;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.25s ease;
    pointer-events: none;
    z-index: 9999;
    max-width: 320px;
    font-family: inherit;
}
#we-toast.we-toast-show    { opacity: 1; transform: translateY(0); }
#we-toast.we-toast-success { background: #059669; color: #fff; }
#we-toast.we-toast-error   { background: #dc2626; color: #fff; }
#we-toast.we-toast-info    { background: #1e293b; color: #e2e8f0; }

/* ── Responsive ── */
@media (max-width: 600px) {
    #we-doc-area { padding: 10px; }
    #we-toolbar  { flex-wrap: wrap; gap: 8px; }
    #we-doc-name { max-width: 180px; }
    .we-info-hint { display: none; }
}

/* ── Format bar ── */
#we-format-bar {
    display: flex;
    align-items: center;
    gap: 3px;
    padding: 5px 14px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    flex-shrink: 0;
    flex-wrap: wrap;
}

.we-fmt-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 26px;
    padding: 0 7px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    background: #fff;
    cursor: pointer;
    font-size: 12px;
    font-family: inherit;
    color: #374151;
    transition: background 0.1s, border-color 0.1s;
    line-height: 1;
}
.we-fmt-btn:hover  { background: #f1f5f9; border-color: #6b7280; }
.we-fmt-btn:active { background: #e2e8f0; }
.we-fmt-btn b { font-weight: 800; font-size: 13px; }
.we-fmt-btn i { font-style: italic; font-size: 13px; }
.we-fmt-btn u { text-decoration: underline; font-size: 13px; }

#we-font-family,
#we-font-size {
    height: 26px;
    padding: 0 6px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    background: #fff;
    font-size: 12px;
    color: #374151;
    cursor: pointer;
}
#we-font-family { width: 130px; }
#we-font-size   { width: 58px; }

#we-font-color {
    width: 26px;
    height: 26px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    padding: 2px;
    cursor: pointer;
    background: #fff;
    flex-shrink: 0;
}

.we-fmt-sep {
    width: 1px;
    height: 18px;
    background: #d1d5db;
    margin: 0 3px;
    flex-shrink: 0;
}
