/* 开枝散叶 - 偷渡诸天 */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', 'PingFang SC', sans-serif;
    background: linear-gradient(135deg, #0a0a0f 0%, #1a1a2e 50%, #16213e 100%);
    min-height: 100vh;
    color: #e0e0e0;
    overflow-x: hidden;
}

#app {
    max-width: 1400px;
    margin: 0 auto;
    padding: 10px;
}

/* 头部 */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 10px;
    margin-bottom: 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.header-left h1 {
    font-size: 1.8em;
    color: #f39c12;
    text-shadow: 0 0 20px rgba(243, 156, 18, 0.5);
}

.status-idle { color: #666; }
.status-active { color: #2ecc71; animation: pulse 2s infinite; }
.status-danger { color: #e74c3c; }

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.header-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

#realm-name { color: #f39c12; font-weight: bold; }
#realm-level { color: #9b59b6; }

.btn-small {
    padding: 6px 15px;
    font-size: 0.9em;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.hidden { display: none !important; }

/* 主布局 */
#main {
    display: flex;
    gap: 15px;
    min-height: calc(100vh - 120px);
}

.panel {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 15px;
}

.left-panel {
    width: 320px;
    flex-shrink: 0;
    overflow-y: auto;
    max-height: calc(100vh - 120px);
}

.right-panel {
    flex: 1;
    overflow: hidden;
}

/* 左侧面板 */
.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.panel-header h2 { color: #f39c12; font-size: 1.2em; }

.btn-refresh {
    background: rgba(255, 255, 255, 0.1);
    padding: 5px 10px;
    font-size: 0.8em;
}

.realm-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-bottom: 20px;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.05);
    padding: 8px 10px;
    border-radius: 6px;
}

.stat-icon { font-size: 1.1em; }
.stat-label { color: #888; font-size: 0.85em; }
.stat-value { margin-left: auto; color: #f39c12; font-weight: bold; }

.panel-section {
    margin-bottom: 20px;
}

.panel-section h3 {
    color: #9b59b6;
    font-size: 1em;
    margin-bottom: 10px;
    padding-bottom: 5px;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.1);
}

.item-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.item-cell {
    background: rgba(255, 255, 255, 0.05);
    padding: 8px;
    border-radius: 5px;
    font-size: 0.85em;
    text-align: center;
}

.build-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-top: 10px;
}

.build-btn {
    background: rgba(243, 156, 18, 0.15);
    border: 1px solid rgba(243, 156, 18, 0.3);
    padding: 10px 5px;
    font-size: 0.8em;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
}

.build-btn:hover {
    background: rgba(243, 156, 18, 0.3);
    transform: translateY(-2px);
}

.build-btn small { color: #888; }

.resident-list {
    max-height: 150px;
    overflow-y: auto;
}

.resident-item {
    background: rgba(255, 255, 255, 0.05);
    padding: 8px 10px;
    border-radius: 5px;
    margin-bottom: 5px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85em;
}

.resident-race { color: #3498db; }

/* 右侧面板 - 屏幕 */
.screen {
    height: 100%;
    min-height: calc(100vh - 150px);
}

/* 登录/注册 */
.auth-box {
    max-width: 400px;
    margin: 80px auto;
    text-align: center;
    background: rgba(255, 255, 255, 0.03);
    padding: 40px;
    border-radius: 15px;
}

.auth-box h2 {
    font-size: 2.5em;
    color: #f39c12;
    margin-bottom: 10px;
    text-shadow: 0 0 30px rgba(243, 156, 18, 0.5);
}

.subtitle {
    color: #888;
    margin-bottom: 30px;
    font-size: 1.1em;
}

input {
    width: 100%;
    padding: 12px 15px;
    margin: 10px 0;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.3);
    color: #fff;
    font-size: 16px;
    transition: border-color 0.3s;
}

input:focus {
    outline: none;
    border-color: #f39c12;
}

button {
    background: linear-gradient(135deg, #f39c12, #e67e22);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1em;
    margin: 10px 5px;
    transition: all 0.3s;
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(243, 156, 18, 0.4);
}

button:active { transform: translateY(0); }

.link-text { color: #888; margin-top: 15px; }
.link-text a { color: #f39c12; text-decoration: none; }
.link-text a:hover { text-decoration: underline; }

/* 界门 */
.gate-box {
    max-width: 500px;
    margin: 60px auto;
    text-align: center;
    background: rgba(255, 255, 255, 0.03);
    padding: 30px;
    border-radius: 15px;
}

.gate-box h2 { color: #f39c12; margin-bottom: 10px; }
.gate-info {
    background: rgba(0, 0, 0, 0.3);
    padding: 15px;
    border-radius: 8px;
    margin: 20px 0;
    text-align: left;
}

.info-item {
    color: #e74c3c;
    margin: 8px 0;
    font-size: 0.95em;
}

.draw-section { margin-top: 30px; }

.btn-gate {
    background: linear-gradient(135deg, #9b59b6, #8e44ad);
    padding: 15px 50px;
    font-size: 1.2em;
}

.btn-gate:hover {
    box-shadow: 0 5px 30px rgba(155, 89, 182, 0.5);
}

/* 身份卡 */
.identity-card {
    background: linear-gradient(135deg, rgba(155, 89, 182, 0.2), rgba(142, 68, 173, 0.2));
    border: 2px solid #9b59b6;
    border-radius: 10px;
    padding: 20px;
    margin: 20px 0;
    text-align: left;
}

.identity-card .name { font-size: 1.3em; color: #fff; margin-bottom: 10px; }
.identity-card .tier {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 10px;
    font-size: 0.8em;
    margin-bottom: 10px;
}

.tier-N { background: #888; }
.tier-R { background: #3498db; }
.tier-SR { background: #9b59b6; }
.tier-SSR { background: linear-gradient(135deg, #f39c12, #e74c3c); }

.identity-card .chapter { color: #f39c12; margin: 10px 0; }
.identity-card .talent { color: #2ecc71; font-size: 0.9em; }
.identity-card .tasks { color: #3498db; font-size: 0.9em; margin-top: 5px; }

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* 游戏主界面 */
.game-layout {
    display: flex;
    gap: 15px;
    height: 100%;
}

.event-area {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.event-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.event-header h3 { color: #f39c12; }

#current-chapter {
    background: rgba(155, 89, 182, 0.2);
    padding: 5px 12px;
    border-radius: 15px;
    color: #9b59b6;
    font-size: 0.9em;
}

.event-log {
    flex: 1;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    padding: 15px;
    overflow-y: auto;
    max-height: calc(100vh - 280px);
    font-size: 0.95em;
    line-height: 1.8;
}

.event-entry {
    padding: 8px 0;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.05);
    animation: fadeIn 0.3s ease;
}

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

.event-time { color: #666; font-size: 0.85em; }
.event-text { color: #ccc; }
.event-loot { color: #f39c12; }
.event-danger { color: #e74c3c; }
.event-success { color: #2ecc71; }

.action-area {
    width: 320px;
    flex-shrink: 0;
}

.identity-badge {
    background: linear-gradient(135deg, rgba(155, 89, 182, 0.2), rgba(142, 68, 173, 0.2));
    border: 1px solid #9b59b6;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 15px;
    font-size: 0.9em;
}

.identity-badge .name { color: #fff; font-weight: bold; }
.identity-badge .info { color: #888; margin-top: 5px; }

.action-panel {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
}

.action-panel h4 {
    color: #3498db;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.1);
}

#current-task { margin-bottom: 15px; }
.task-item {
    background: rgba(255, 255, 255, 0.05);
    padding: 10px;
    border-radius: 6px;
    margin-bottom: 8px;
}

.task-name { color: #2ecc71; }
.task-desc { color: #888; font-size: 0.85em; margin-top: 5px; }

.choices { margin-top: 10px; }

.choice-btn {
    display: block;
    width: 100%;
    background: rgba(52, 152, 219, 0.2);
    border: 1px solid rgba(52, 152, 219, 0.3);
    padding: 10px 15px;
    margin: 8px 0;
    border-radius: 6px;
    text-align: left;
    color: #fff;
}

.choice-btn:hover {
    background: rgba(52, 152, 219, 0.4);
}

.quick-actions {
    display: flex;
    gap: 10px;
}

.quick-actions button {
    flex: 1;
    padding: 10px;
    font-size: 0.9em;
    background: rgba(255, 255, 255, 0.1);
}

/* 结算 */
.result-box {
    max-width: 500px;
    margin: 50px auto;
    background: rgba(0, 0, 0, 0.4);
    padding: 30px;
    border-radius: 15px;
    text-align: center;
}

.result-box h2 { color: #f39c12; margin-bottom: 20px; }

.result-content {
    background: rgba(0, 0, 0, 0.3);
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    text-align: left;
    line-height: 1.8;
}

.result-loot { margin: 20px 0; }

.result-loot .loot-item {
    display: inline-block;
    background: rgba(243, 156, 18, 0.2);
    border: 1px solid rgba(243, 156, 18, 0.3);
    padding: 5px 12px;
    border-radius: 15px;
    margin: 5px;
    font-size: 0.9em;
}

.result-rating {
    font-size: 3em;
    margin: 20px 0;
}

.rating-S { color: #f39c12; text-shadow: 0 0 30px rgba(243, 156, 18, 0.8); }
.rating-A { color: #2ecc71; }
.rating-B { color: #3498db; }
.rating-C { color: #888; }
.rating-D { color: #e74c3c; }

/* 滚动条 */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: rgba(0,0,0,0.2); }
::-webkit-scrollbar-thumb { background: #f39c12; border-radius: 3px; }
