/* Global Reset */
* { box-sizing: border-box; }
body { margin: 0; padding: 0; font-family: sans-serif; overflow: hidden; height: 100vh; }

/* Controls (Top Right) */
.controls {
    position: fixed;
    top: 15px;
    right: 15px;
    z-index: 1000;
    display: flex;
    gap: 10px;
    background: rgba(0, 0, 0, 0.6);
    padding: 8px 12px;
    border-radius: 6px;
    opacity: 0.2; /* Back to stealth mode */
    transition: opacity 0.3s;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.controls:hover {
    opacity: 1;
}

/* Hide controls slightly in stealth modes if needed, or keep visible */
body.skin-tui .controls, body.skin-excel .controls {
    opacity: 0.1;
}
body.skin-tui .controls:hover, body.skin-excel .controls:hover {
    opacity: 1;
}

.control-group { display: flex; align-items: center; gap: 8px; }
.label { color: #aaa; font-size: 11px; font-weight: bold; letter-spacing: 0.5px; }
.btn {
    background: #444; 
    color: #fff; 
    border: 1px solid #666;
    padding: 4px 10px; 
    font-size: 11px; 
    cursor: pointer;
    min-width: 60px;
    border-radius: 3px;
    transition: all 0.1s;
    font-weight: 600;
}
.btn:hover { background: #666; border-color: #888; }
.btn:active { background: #222; transform: translateY(1px); }
.btn.loading { opacity: 0.7; cursor: wait; }

/* Skin Containers */
.skin-container { width: 100%; height: 100%; }
.hidden { display: none !important; }

/* --- TUI Skin --- */
#skin-tui {
    background-color: #0c0c0c;
    color: #cccccc;
    font-family: 'Courier New', Courier, monospace;
    padding: 20px;
    font-size: 14px;
    overflow-y: auto;
}
#skin-tui .header { color: #fff; margin-bottom: 20px; }
#skin-tui .user { color: #00ff00; }
#skin-tui .path { color: #5555ff; }
#skin-tui .log-entry { margin-bottom: 6px; cursor: pointer; }
#skin-tui .log-entry:hover { background-color: #222; color: #fff; }
#skin-tui .timestamp { color: #666; margin-right: 10px; }
#skin-tui .source { color: #d19a66; margin-right: 10px; }
#skin-tui .title-en { color: #ccc; }
#skin-tui .title-zh { color: #888; display: block; margin-left: 160px; font-size: 0.9em; }
#skin-tui .input-line { margin-top: 20px; }
#skin-tui .cursor { animation: blink 1s step-end infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* --- Excel Skin --- */
#skin-excel {
    background-color: #fff;
    color: #000;
    display: flex;
    flex-direction: column;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 13px;
}
.excel-toolbar { background: #f3f3f3; border-bottom: 1px solid #e1e1e1; padding-bottom: 5px; }
.excel-menu { background: #217346; color: #fff; padding: 5px 10px; font-size: 12px; }
.excel-ribbon { padding: 10px; display: flex; gap: 15px; align-items: center; border-bottom: 1px solid #ddd; background: #fff; }
.excel-formula-bar { display: flex; align-items: center; padding: 5px; background: #fff; border-bottom: 1px solid #ddd; }
.excel-formula-bar .fx { color: #999; font-style: italic; margin-right: 10px; font-weight: bold; }
.excel-formula-bar input { width: 100%; border: none; outline: none; font-family: monospace; }

.excel-grid { flex: 1; overflow: auto; display: flex; flex-direction: column; }
.excel-header-row { display: flex; background: #e6e6e6; border-bottom: 1px solid #ccc; }
.cell-header { text-align: center; border-right: 1px solid #ccc; padding: 2px; font-weight: bold; color: #666; }
.row-num { width: 40px; background: #e6e6e6; border-right: 1px solid #ccc; border-bottom: 1px solid #ccc; text-align: center; color: #666; }
.col-a { width: 150px; }
.col-b { width: 100px; }
.col-c { flex: 1; }
.col-d { width: 80px; }

.excel-row { display: flex; border-bottom: 1px solid #eee; height: 24px; align-items: center; }
.excel-row:hover { background: #e8f5e9; cursor: pointer; }
.excel-cell { padding: 0 5px; border-right: 1px solid #eee; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; height: 100%; line-height: 24px; }
.excel-cell.num { width: 40px; background: #e6e6e6; text-align: center; color: #666; border-right: 1px solid #ccc; }
.excel-cell.time { width: 150px; color: #666; }
.excel-cell.source { width: 100px; color: #217346; }
.excel-cell.title { flex: 1; }
.excel-cell.heat { width: 80px; text-align: right; color: #888; }

.excel-footer { background: #f3f3f3; border-top: 1px solid #ccc; padding: 2px; display: flex; gap: 5px; }
.sheet-tab { background: #fff; padding: 3px 15px; border: 1px solid #ccc; border-bottom: none; border-radius: 3px 3px 0 0; cursor: pointer; }
.sheet-tab.active { color: #217346; font-weight: bold; border-bottom: 2px solid #fff; margin-bottom: -3px; z-index: 10; }

/* --- Boss Overlay --- */
#boss-overlay {
    position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
    background: #0078d7; color: #fff; z-index: 9999;
    display: flex; align-items: center; justify-content: center;
    font-family: 'Segoe UI', sans-serif; cursor: none;
}
.bsod { font-size: 24px; max-width: 800px; }
.bsod p { margin-bottom: 20px; }
.bsod .small { font-size: 16px; margin-top: 40px; }

/* --- Card Skin --- */
#skin-card {
    background-color: #f4f4f9;
    color: #333;
    overflow-y: auto;
    padding: 20px;
}

.card-header {
    max-width: 1200px;
    margin: 0 auto 20px auto;
    padding-top: 40px;
}

.card-header h1 {
    font-size: 24px;
    margin-bottom: 10px;
    color: #2c3e50;
}

.card-filters {
    display: flex;
    gap: 10px;
}

.filter-tag {
    background: #fff;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 12px;
    color: #666;
    cursor: pointer;
    border: 1px solid #ddd;
    transition: all 0.2s;
}

.filter-tag.active, .filter-tag:hover {
    background: #007bff;
    color: #fff;
    border-color: #007bff;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    max-width: 1200px;
    margin: 0 auto;
    padding-bottom: 40px;
}

.news-card {
    background: #fff;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid #eee;
    animation: fadeIn 0.3s ease-out forwards;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.news-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.card-meta {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: #999;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.card-category {
    color: #007bff;
    font-weight: bold;
}

.card-title {
    font-size: 16px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 10px;
    line-height: 1.4;
}

.card-summary {
    font-size: 13px;
    color: #666;
    line-height: 1.6;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-footer {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: #aaa;
}

.card-source {
    display: flex;
    align-items: center;
    gap: 5px;
}

.card-heat {
    color: #ff6b6b;
}

/* --- Chat Modal --- */
#chat-modal {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-content {
    background: #fff;
    width: 400px;
    max-width: 90%;
    height: 500px;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 5px 20px rgba(0,0,0,0.3);
    overflow: hidden;
}

.chat-header {
    padding: 15px;
    background: #f8f9fa;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: bold;
    color: #333;
}

.btn-close {
    background: none; border: none; font-size: 20px; cursor: pointer; color: #999;
}
.btn-close:hover { color: #333; }

.chat-messages {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    background: #fff;
    display: flex;
    flex-direction: column-reverse; /* Newest at bottom visually if we append, but let's stick to standard top-down */
}

.chat-msg {
    margin-bottom: 10px;
    padding: 8px 12px;
    background: #f1f3f5;
    border-radius: 15px;
    font-size: 13px;
    line-height: 1.4;
    align-self: flex-start;
    max-width: 85%;
}

.chat-msg .time {
    display: block;
    font-size: 10px;
    color: #999;
    margin-top: 4px;
    text-align: right;
}

.chat-input-area {
    padding: 15px;
    border-top: 1px solid #eee;
    display: flex;
    gap: 10px;
    background: #f8f9fa;
}

#chat-input {
    flex: 1;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    outline: none;
}

#chat-input:focus { border-color: #007bff; }

