/* public/ocr/style.css */

.hidden { display: none !important; }

/* 容器 */
.ocr-app { margin-top: 12px; }
.ocr-container { padding: 14px; }

/* Notice */
.ocr-notice {
    border: 1px solid rgba(245,158,11,0.25);
    background: rgba(245,158,11,0.08);
    border-left: 4px solid rgba(245,158,11,0.65);
    border-radius: 16px;
    padding: 12px 12px;
}

.ocr-notice-title {
    font-weight: 800;
    margin-bottom: 6px;
}

.ocr-notice-list {
    margin: 0;
    padding-left: 18px;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.6;
}
.ocr-notice-list strong { color: var(--text); }

/* grid */
.ocr-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 10px;
}

@media (max-width: 980px) {
    .ocr-grid { grid-template-columns: 1fr; }
}

/* fields */
.ocr-field { margin-bottom: 10px; }

.ocr-label {
    display: block;
    font-size: 14px;
    color: var(--muted);
    margin: 0 0 6px;
    font-weight: 500;
}

.ocr-input {
    width: 100%;
    border-radius: 12px;
    border: 1px solid rgba(148,163,184,0.5);
    background: rgba(2,6,23,0.16);
    color: var(--text);
    padding: 10px 12px;
    outline: none;
}

.ocr-input:hover {
    border-color: rgba(56,189,248,0.45);      /* 微加強 hover */
    background: rgba(56,189,248,0.08);
    transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.ocr-input:focus {
    border-color: rgba(56,189,248,0.75);      /* 保留但更清楚 */
    box-shadow: 0 0 0 3px rgba(56,189,248,0.22);
}

.ocr-hidden { display: none; }

/* dropzone */
.ocr-dropzone {
    margin-top: 8px;
    border-radius: 16px;
    border: 1px dashed rgba(148,163,184,0.25);
    background: rgba(2,6,23,0.25);
    padding: 16px;
    display: flex;
    gap: 12px;
    align-items: center;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.ocr-dropzone:hover {
    border-color: rgba(56,189,248,0.35);
    background: rgba(56,189,248,0.06);
}

.ocr-dropzone.is-dragover {
    border-color: rgba(56,189,248,0.65);
    box-shadow: 0 0 0 2px rgba(56,189,248,0.18);
    background: rgba(56,189,248,0.10);
}

.ocr-drop-icon {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    font-weight: 900;
    color: #001018;
    background: linear-gradient(135deg, rgba(56,189,248,1), rgba(34,197,94,1));
    flex-shrink: 0;
}

.ocr-drop-title { font-weight: 800; }
.ocr-drop-sub { color: var(--muted); font-size: 12px; margin-top: 2px; }

/* actions */
.ocr-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 10px;
}

button.btn {
    cursor: pointer;
}
button.btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

/* blocks */
.ocr-block { margin-top: 12px; }

.ocr-block-title {
    font-weight: 800;
    margin-bottom: 8px;
}

/* tables */
.ocr-table-wrap {
    border-radius: 16px;
    border: 1px solid rgba(148,163,184,0.12);
    overflow: hidden;
    background: rgba(2,6,23,0.25);
}

.ocr-table-scroll { max-height: 320px; overflow: auto; }

.ocr-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.ocr-table thead {
    background: rgba(15,23,42,0.55);
}

.ocr-table th,
.ocr-table td {
    text-align: left;
    padding: 10px 12px;
    border-bottom: 1px solid rgba(148,163,184,0.10);
    vertical-align: top;
    white-space: nowrap;
}

.ocr-table tbody tr:nth-child(even) {
    background: rgba(15,23,42,0.20);
}

.ocr-sticky th {
    position: sticky;
    top: 0;
    z-index: 2;
}

/* header key/val subtle */
.ocr-td-key { color: var(--text); font-weight: 700; }
.ocr-td-val { color: var(--muted); }

/* Toast */
.aisin-toast-container {
    position: fixed;
    top: 70px; /* 避开 topbar */
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    pointer-events: none;
    z-index: 80;
}

.aisin-toast {
    pointer-events: auto;
    border-radius: 14px;
    padding: 10px 12px;
    margin: 6px 10px;
    border: 1px solid rgba(148,163,184,0.18);
    background: rgba(2,6,23,0.85);
    color: var(--text);
    box-shadow: 0 10px 24px rgba(0,0,0,0.35);
    animation: aisinFadeIn 180ms ease-out;
    max-width: min(720px, calc(100vw - 24px));
}

.aisin-toast.is-success { border-color: rgba(34,197,94,0.35); }
.aisin-toast.is-error   { border-color: rgba(245,158,11,0.35); }

.aisin-toast.is-leaving {
    animation: aisinFadeOut 220ms ease-in forwards;
}

@keyframes aisinFadeIn {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes aisinFadeOut {
    from { opacity: 1; transform: translateY(0); }
    to   { opacity: 0; transform: translateY(-6px); }
}

/* Overlay */
.aisin-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    backdrop-filter: blur(8px);
    display: grid;
    place-items: center;
    z-index: 90;
}

.aisin-overlay-box {
    width: min(520px, calc(100vw - 24px));
    border-radius: 18px;
    border: 1px solid rgba(148,163,184,0.16);
    background: rgba(2,6,23,0.85);
    padding: 18px;
    display: grid;
    gap: 12px;
    justify-items: center;
}

.aisin-spinner {
    width: 42px;
    height: 42px;
    border-radius: 9999px;
    border: 3px solid rgba(229,231,235,0.18);
    border-top-color: rgba(56,189,248,0.95);
    animation: aisinSpin 0.9s linear infinite;
}

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

.aisin-overlay-text {
    margin: 0;
    color: var(--text);
    font-weight: 700;
}

/* ===============================
   Hero + Notice layout
   =============================== */

.hero-with-notice {
    display: grid;
    grid-template-columns: 1fr 1fr; /* ← 關鍵：一半一半 */
    gap: 20px;
    align-items: start;
}

.hero-main {
    flex: 1 1 auto;
    min-width: 0;
}

.hero-notice {
    flex: unset;
    width: 100%;
    margin: 0;
}


/* Desktop only: side by side */
@media (max-width: 980px) {
    .hero-with-notice {
        flex-direction: column;
    }

    .hero-notice {
        flex: none;
        margin-top: 10px;
    }
}
